Page 1 of 1

Copying SYSOUT of a job in a PS file

PostPosted: Thu Aug 08, 2013 5:13 pm
by S Chakraborty
Hi All,

I am trying to write a REXX code that will copy SYSOUT of a JOB into a PS file.

For that I have done the below steps :

Step 1 : Allocating the PS file. This step is running fine.

ADDRESS TSO
BOOK1='<ps file name>'
"ALLOC DA('"BOOK1"') SHR REUSE FI(BOOK1)"
"EXECIO * DISKR BOOK1 (FINIS STEM KEY."
"EXECIO 0 DISKR BOOK1 (FINIS"
"FREE F(BOOK1)"

Step 2: Load the SDSF ENVIRONMENT and abort on failure. This step is running fine.

ISFRC = ISFCALLS( "ON" )

Step 3: Display ST panel.

ISFOWNER = "<Owner>"
ISFPREFIX = "Job Prefix"
ISFFILTER = "QUEUE = PRINT"
ADDRESS SDSF "ISFEXEC ST"
SAY "ISFROWS" ISFROWS
SAY "MEMBERRULE" MEMBERRULE
I=1
DDNAME="SYSOUT"

CALL PROCESSSYSOUT JNAME.I,JOBID.I,TOKEN.I,DDNAME

PROCESSSYSOUT: PARSE ARG JOBNAME, MEMBERNAME, SDSFTOKEN, DDN

Step 4: Display Job dataset.

ADDRESS SDSF "ISFACT ST TOKEN('"SDSFTOKEN"') PARM(NP ?) (PREFIX J_"

Step 5: Get the correct dataset.

IF J_DDNAME.JX <> DDN THEN ITERATE
END


Step 6: Display the SYSOUT dataset.

ADDRESS SDSF "ISFACT ST TOKEN('"SDSFTOKEN"') PARM(NP SA)"

CS_INPUT = "DD:"||ISFDDNAME.1

Step 7: Allocating datasets.

CALL BPXWDYN "ALLOC DSN('"CS_INPUT"') SHR RTDDN(SYSUT1DD)" ,
"MSG(CS_MSG.)"

/* Allocate a dummy dataset for SYSIN */
CALL BPXWDYN "ALLOC DUMMY RTDDN(SYSINDD) MSG(CS_MSG.)"

/* Allocate a temporary dataset for SYSPRINT */
CALL BPXWDYN "ALLOC UNIT(SYSALLDA) SPACE(10,10) TRACKS" ,
"RTDDN(SYSPRINTDD) MSG(CS_MSG.)"

Step 8: Build the DD name substitution list


PARM=""
DDLIST = COPIES( '00'X, 8 ) ||, /* DD 1: SYSLIN */
COPIES( '00'X, 8 ) ||, /* DD 2: N/A */
COPIES( '00'X, 8 ) ||, /* DD 3: SYSLMOD */
COPIES( '00'X, 8 ) ||, /* DD 4: SYSLIB */
LEFT( SYSINDD, 8 ) ||, /* DD 5: SYSIN */
LEFT( SYSPRINTDD, 8 ) ||, /* DD 6: SYSPRINT */
COPIES( '00'X, 8 ) ||, /* DD 7: SYSPUNCH */
LEFT( SYSUT1DD, 8 ) ||, /* DD 8: SYSUT1 */
BOOK1||, /* DD 9: SYSUT2 */
COPIES( '00'X, 8 ) ||, /* DD 10: SYSUT3 */
COPIES( '00'X, 8 ) ||, /* DD 11: SYSUT4 */
COPIES( '00'X, 8 ) ||, /* DD 12: SYSTERM */
COPIES( '00'X, 8 ) ||, /* DD 13: N/A */
COPIES( '00'X, 8 ) /* DD 14: SYSCIN */

ADDRESS LINKMVS "IEBGENER PARM DDLIST"

SAY "RC8" RC


Step 8 is giving RC as 12. I think there a problem with Step 6 though it's giving RC as 0.Can you please help me in this context ?
Need to fix it ASAP. Thanks for ur cooperation in advance !!

Re: Copying SYSOUT of a job in a PS file

PostPosted: Thu Aug 08, 2013 6:19 pm
by NicC
Errr, why not just write the SYSOUT to a dataset to start with? If you also need it on the spool then copy the dataset to spool as the next step after creation. For existing stuf on the spool why not just XDC it to a dataset?

Re: Copying SYSOUT of a job in a PS file

PostPosted: Thu Aug 08, 2013 6:42 pm
by c62ap90
Sorry, do not know enough REXX to help with your code.
I use - COD, XD or X line command in SDSF to Copy to Output Dataset.

Re: Copying SYSOUT of a job in a PS file

PostPosted: Thu Aug 08, 2013 9:28 pm
by dick scherrer
Hello and welcome to the forum,

If this is to be part of a batch process, suggest you do as Nic advised - write the datato a dataset and then copy if to SYSOUT if a sysout is also needed.

If the job has ended, use XDC (also suggested by Nic).

Re: Copying SYSOUT of a job in a PS file

PostPosted: Fri Aug 09, 2013 12:57 am
by S Chakraborty
Thanks Nic and D.sch for your quick response. One thing that I skipped to mention that this process of copying the spool data is not applicable for a single job. There will not be any change in the job. So if the job does not have any SYSOUT dataset then the idea you have given will be difficult to implement.

Re: Copying SYSOUT of a job in a PS file

PostPosted: Fri Aug 09, 2013 1:27 am
by dick scherrer
Hello,

You need to explain much more clearly . . . What we have proposed will work for a single job or many jobs. I believe you are focused on SYSOUT dasd datasets rather than SYSOUT queued data.

There will probably be one or more JCL changes for this to work in "real time".