I want use the value of the rc of a previous step in a next one.
For example:
-BACKUP 00
-RUNCOB 01
-DELETE 00
-RENAME 00
after that I want to use the value "01" of the RUNCOB in a new step and that's exactly the instruction &RUNCOB.RC. PACOTES that is not resolved
//HISTADD EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=A
//SYSIN DD DUMMY
//SYSUT2 DD DSN=&LIBRARY..PT.PRDBLU.HIST,
// DISP=(MOD,CATLG),
// UNIT=SYSDAPRD,LRECL=80,RECFM=FB,SPACE=(CYL,(1,1))
//SYSUT1 DD *,SYMBOLS=EXECSYS
&ACNAME. | D&YYMMDD | T&LHHMMSS | &RUNCOB.RC. PACOTES | SUBMETIDO
//*
Use the rc of a previous step
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: Use the rc of a previous step
1. Re-post your message in this format:
2. Explain in a clear manner: what is RUNCOB in your sample???
Based on the syntax &RUNCOB it must be a JCL variable, but in your sample it is not like this?
3. Any RC returned by a job step can be used EXCLUSIVELY in JCL // IF statement, or in JCL // EXEC COND= parameter. Nothing else is possible.
PRDVCF wrote:I want use the value of the rc of a previous step in a next one.
For example:Code: Select all
-BACKUP 00
-RUNCOB 01
-DELETE 00
-RENAME 00
after that I want to use the value "01" of the RUNCOB in a new step and that's exactly the instruction &RUNCOB.RC. PACOTES that is not resolvedCode: Select all
//HISTADD EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=A
//SYSIN DD DUMMY
//SYSUT2 DD DSN=&LIBRARY..PT.PRDBLU.HIST,
// DISP=(MOD,CATLG),
// UNIT=SYSDAPRD,LRECL=80,RECFM=FB,SPACE=(CYL,(1,1))
//SYSUT1 DD *,SYMBOLS=EXECSYS
&ACNAME. | D&YYMMDD | T&LHHMMSS | &RUNCOB.RC. PACOTES | SUBMETIDO
//*
2. Explain in a clear manner: what is RUNCOB in your sample???
Based on the syntax &RUNCOB it must be a JCL variable, but in your sample it is not like this?
3. Any RC returned by a job step can be used EXCLUSIVELY in JCL // IF statement, or in JCL // EXEC COND= parameter. Nothing else is possible.
Javas and Pythons come and go, but JCL and SORT stay forever.
Re: Use the rc of a previous step
RUNCOB is a step where I ran a cobol program to identify how much lines exist in a dsn. In this case did only found one ( rc=01 )
In the HISTADD step I need to translate the symbol &RUNCOB.RC and that doesn't happen.
Please look the result, all other symbols are translate except the RUNCOB.RC
//HISTADD EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=A
//SYSIN DD DUMMY
//SYSUT2 DD DSN=NDVRCER.CER.JOB22.PT.PRDBLU.HIST,
// DISP=(MOD,CATLG),
// UNIT=SYSDAPRD,LRECL=80,RECFM=FB,SPACE=(CYL,(1,1))
//SYSUT1 DD *,SYMBOLS=EXECSYS
AC437685 | D231030 | T120702 | RUNCOB.RC PACOTES | SUBMETIDO
//*
In the HISTADD step I need to translate the symbol &RUNCOB.RC and that doesn't happen.
Please look the result, all other symbols are translate except the RUNCOB.RC
//HISTADD EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=A
//SYSIN DD DUMMY
//SYSUT2 DD DSN=NDVRCER.CER.JOB22.PT.PRDBLU.HIST,
// DISP=(MOD,CATLG),
// UNIT=SYSDAPRD,LRECL=80,RECFM=FB,SPACE=(CYL,(1,1))
//SYSUT1 DD *,SYMBOLS=EXECSYS
AC437685 | D231030 | T120702 | RUNCOB.RC PACOTES | SUBMETIDO
//*
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: Use the rc of a previous step
Please, learn how to use the Code button when posting messages!!!!!!
Your RUNCOB.RC is not the symbol that can be substituted!!!!
My impression is: you do not read the given responses, but just continue repeating the same mantras.
Your RUNCOB.RC is not the symbol that can be substituted!!!!
My impression is: you do not read the given responses, but just continue repeating the same mantras.
Javas and Pythons come and go, but JCL and SORT stay forever.
Re: Use the rc of a previous step
...and my impression is: You are too rude. Sorry to disturb you.
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: Use the rc of a previous step
PRDVCF wrote:...and my impression is: You are too rude. Sorry to disturb you.
I recommend you to begin reading the answers, and recommendations, rather than ignoring any advices...

Javas and Pythons come and go, but JCL and SORT stay forever.
-
- Posts: 474
- Joined: Thu Mar 10, 2016 5:03 pm
- Skillset: assembler rexx zOS ispf racf smf
- Referer: saw it in the experts foprum thought I could help here
Re: Use the rc of a previous step
The only method that I am aware of is using the REXX SDSF API to scan the job output till the current program. As sergeyken correctly stated, the RC value is not directly available.
Re: Use the rc of a previous step
Thank you Willy. I'll check that.
-
- Posts: 474
- Joined: Thu Mar 10, 2016 5:03 pm
- Skillset: assembler rexx zOS ispf racf smf
- Referer: saw it in the experts foprum thought I could help here
Re: Use the rc of a previous step
If you want to go the REXX way, I might be able to dig out a sample. But please check the manual and give it a try yourself, the SDSF Users Guide is pretty good.
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: Use the rc of a previous step
Despite that my opinion is ignored here, I dare to give some advices. They might help to someone else.
1. The approach of "using the REXX SDSF API to scan the job output till the current program" can really work, but for this particular task such method would resemble the process of hammering nails using a microscope as a tool. It really can be done, no doubt. But...
2. Returning "the number of records" via a job step return code is a terrible way of doing this primitive task. Especially when this produced number should be used for following processing - either calculation, or text substitution. To say nothing that its value is limited to 32K.
My recommendation (highly likely to be ignored...) is: create the whole output line right in RUNCOB step (BTW: senseless step name, about the same as STEP1), rather than in a special separate IEBGENER step. For this simple task even no specific COBOL program is needed; it can be easily done with one of many standard utilities, such as SORT.
For example:
1. The approach of "using the REXX SDSF API to scan the job output till the current program" can really work, but for this particular task such method would resemble the process of hammering nails using a microscope as a tool. It really can be done, no doubt. But...

2. Returning "the number of records" via a job step return code is a terrible way of doing this primitive task. Especially when this produced number should be used for following processing - either calculation, or text substitution. To say nothing that its value is limited to 32K.
My recommendation (highly likely to be ignored...) is: create the whole output line right in RUNCOB step (BTW: senseless step name, about the same as STEP1), rather than in a special separate IEBGENER step. For this simple task even no specific COBOL program is needed; it can be easily done with one of many standard utilities, such as SORT.
For example:
Code: Select all
//HISTADD EXEC PGM=SORT,
// PARM='JP0"&ACNAME",JP1"D&YYMMDD",JP2"T&LHHMMSS"'
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=input.data
//HISTOUT DD DSN=&LIBRARY..PT.PRDBLU.HIST,
// DISP=(MOD,CATLG),
// UNIT=SYSDAPRD,LRECL=80,RECFM=FB,SPACE=(CYL,(1,1))
//SYSIN DD *
INCLUDE COND=(...) - optional selection of records to be counted
SORT FIELDS=COPY
OUTFIL FNAMES=HISTOUT,
NODETAIL,REMOVECC,
TRAILER1=(X,JP0,C' | ',JP1,C' | ',JP2,C' | ',
COUNT=(M0),C' PACOTES | SUBMETIDO')
END
//*
Javas and Pythons come and go, but JCL and SORT stay forever.
-
- Similar Topics
- Replies
- Views
- Last post
-
- 9
- 2710
-
by sergeyken
View the latest post
Thu Jan 09, 2025 11:59 pm
-
-
Sending o/p file's content to spool withot adding extra step
by Misha786 » Tue Jan 12, 2021 6:51 pm » in JCL - 4
- 2015
-
by sergeyken
View the latest post
Tue Jan 12, 2021 11:28 pm
-