Dynamic Change of sysout class via JCL

JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...
tem_li
Posts: 1
Joined: Tue Sep 26, 2017 5:16 pm
Skillset: JCL; COBOL; TELON
Referer: internet

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)

enrico-sorichetti
Global moderator
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
Referer: www.ibmmainframes.com

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

steve-myers
Global moderator
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Skillset: Assembler, JCL, utilities
Referer: zos.efglobe.com

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.

willy jensen
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: 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.

NicC
Global moderator
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
Referer: Google
Location: Pushing up the daisies (almost)

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


  • Similar Topics
    Replies
    Views
    Last post