Use the rc of a previous step



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Use the rc of a previous step

Postby PRDVCF » Mon Oct 30, 2023 4:51 pm

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
//*
PRDVCF
 
Posts: 6
Joined: Thu Nov 17, 2022 7:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Use the rc of a previous step

Postby sergeyken » Mon Oct 30, 2023 5:43 pm

1. Re-post your message in this format:
PRDVCF wrote: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
//*


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.
User avatar
sergeyken
 
Posts: 438
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Re: Use the rc of a previous step

Postby PRDVCF » Mon Oct 30, 2023 5:53 pm

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
//*
PRDVCF
 
Posts: 6
Joined: Thu Nov 17, 2022 7:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Use the rc of a previous step

Postby sergeyken » Mon Oct 30, 2023 6:44 pm

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.
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 438
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Re: Use the rc of a previous step

Postby PRDVCF » Mon Oct 30, 2023 8:49 pm

...and my impression is: You are too rude. Sorry to disturb you.
PRDVCF
 
Posts: 6
Joined: Thu Nov 17, 2022 7:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Use the rc of a previous step

Postby sergeyken » Mon Oct 30, 2023 9:28 pm

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.
User avatar
sergeyken
 
Posts: 438
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Re: Use the rc of a previous step

Postby willy jensen » Tue Oct 31, 2023 1:53 am

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.
willy jensen
 
Posts: 467
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 70 times

Re: Use the rc of a previous step

Postby PRDVCF » Tue Oct 31, 2023 4:57 am

Thank you Willy. I'll check that.
PRDVCF
 
Posts: 6
Joined: Thu Nov 17, 2022 7:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Use the rc of a previous step

Postby willy jensen » Tue Oct 31, 2023 2:29 pm

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.
willy jensen
 
Posts: 467
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 70 times

Re: Use the rc of a previous step

Postby sergeyken » Tue Oct 31, 2023 5:41 pm

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:
//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.
User avatar
sergeyken
 
Posts: 438
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post