Page 1 of 1

Dynamic Change of sysout class via JCL

PostPosted: Tue Sep 26, 2017 5:33 pm
by tem_li
Supposed a program creates a report. Now I want the report to be created in SDSF spool using a temporary output class let's say T. then I want to check the existence of the report in spool. if the report has only a header and detail, delete the report else change the sysout class to R to be swept in infopac. Is it possible to do via JCL only? I can suppress it via program but I'm thinking to handle it via JCL? any thoughts on how to do it?

current JCL structure- the current code allows the report to be sweep in INFOPAC
//STEP1 EXEC DBABAT3,
// PROG=MYPGM
//RPTFILE DD UNIT=SYSDA,SPACE=(CYL,(2,1))
//SYSIN DD DDNAME=PC
//PC DD DSN=MY.CNTLLIB(RPTCTC),DISP=SHR

the content of RPTCTC
PC1SYSOUT=(R,MYPGMA,STD1)
PC2SYSOUT=(R,MYPGMB,STD1)

Re: Dynamic Change of sysout class via JCL

PostPosted: Tue Sep 26, 2017 6:39 pm
by enrico-sorichetti
Is it possible to do via JCL only?

NO

Re: Dynamic Change of sysout class via JCL

PostPosted: Tue Sep 26, 2017 7:08 pm
by steve-myers
As Mr. Sorichetti says, values specified in JCL are fixed for the duration of the job and cannot be changed. The values specified in your RPTCTC require a program to transform them to their dynamic allocation equivalents, allocate a SYSOUT data set with these attributes, and copy the contents of the data set specified by the RPTFILE DD statement to the SYSOUT data set.

Now why would you want a "temporary output class?" Other than the fact there is no such thing.

Re: Dynamic Change of sysout class via JCL

PostPosted: Wed Sep 27, 2017 2:02 pm
by willy jensen
No, but...
One solution which springs to mind:
- Write the report to a temporary dataset.
- Use ICETOOL to strip header and trailer records and set a special return code if there are additional records
- IEBGENER to write the temporary dataset to sysout R if ICETOOL return code indicates report data.

Not pure JCL, because that is not possible, but not a programming solution either.

Re: Dynamic Change of sysout class via JCL

PostPosted: Wed Sep 27, 2017 6:45 pm
by NicC
if the report has only a header and detail, delete the report else change the sysout class to R

Very confusing! Delete the report if it has been created? Then what is there to re-route if there is no report generated?