Copying SYSOUT of a job in a PS file



IBM's Command List programming language & Restructured Extended Executor

Copying SYSOUT of a job in a PS file

Postby S Chakraborty » Thu Aug 08, 2013 5:13 pm

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 !!
S Chakraborty
 
Posts: 2
Joined: Mon Aug 05, 2013 11:20 am
Has thanked: 0 time
Been thanked: 0 time

Re: Copying SYSOUT of a job in a PS file

 

Re: Copying SYSOUT of a job in a PS file

Postby NicC » Thu Aug 08, 2013 6:19 pm

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

Re: Copying SYSOUT of a job in a PS file

Postby c62ap90 » Thu Aug 08, 2013 6:42 pm

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.
c62ap90
 
Posts: 125
Joined: Thu Oct 11, 2012 10:24 pm
Has thanked: 1 time
Been thanked: 6 times

Re: Copying SYSOUT of a job in a PS file

Postby dick scherrer » Thu Aug 08, 2013 9:28 pm

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).
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Copying SYSOUT of a job in a PS file

Postby S Chakraborty » Fri Aug 09, 2013 12:57 am

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.
S Chakraborty
 
Posts: 2
Joined: Mon Aug 05, 2013 11:20 am
Has thanked: 0 time
Been thanked: 0 time

Re: Copying SYSOUT of a job in a PS file

Postby dick scherrer » Fri Aug 09, 2013 1:27 am

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".
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post