Dynamic Change of sysout class via JCL



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

Dynamic Change of sysout class via JCL

Postby tem_li » Tue Sep 26, 2017 5:33 pm

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)
tem_li
 
Posts: 1
Joined: Tue Sep 26, 2017 5:16 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Dynamic Change of sysout class via JCL

Postby enrico-sorichetti » Tue Sep 26, 2017 6:39 pm

Is it possible to do via JCL only?

NO
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: Dynamic Change of sysout class via JCL

Postby steve-myers » Tue Sep 26, 2017 7:08 pm

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.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Dynamic Change of sysout class via JCL

Postby willy jensen » Wed Sep 27, 2017 2:02 pm

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

Re: Dynamic Change of sysout class via JCL

Postby NicC » Wed Sep 27, 2017 6:45 pm

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?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post