Page 1 of 1

SDSF in REXX

PostPosted: Thu Jan 26, 2012 5:34 am
by arshadhrashid
Hi,
I would like to know the following if anyone has experience.

I have got the following REXX code, for saving the joblog of a job from SDSF to a member of a PDS dataset.
The name of the job is supplied as input.

PARSE ARG JOBNAME
PDS=KA.JES2LOGS <----------- My PDS name, alreday allocated.
ADDRESS TSO
"ALLOCATE FILE(ISFIN) TRACKS SPACE(1) REU"
"ALLOC F(ISFOUT) DA("PDS"("JOBNAME")) OLD REUSE"

QUEUE "OWNER *"
QUEUE "PREFIX *"
QUEUE "ST "
QUEUE "SELECT "JOBNAME
QUEUE "AFD REFRESSH"
QUEUE "FIND "JOBNAME " LAST"
QUEUE "++S"
QUEUE "PRT ODSN JES2LOGS("JOBNAME") * OLD"
QUEUE "PRINT 1 9999999"
QUEUE "PRINT CLOSE"
QUEUE "END"
QUEUE "END"
QUEUE "END"
QUEUE " "
"EXECIO" QUEUED()" DISKW ISFIN (FINIS "
ADDRESS ISPEXEC "SELECT PGM(SDSF) PARM('++60,132')"

The script works but it copies all the SDSF screens into the destination member.
I am only interested in getting the job log and not the output of the commands that are run before the job
is selected and opened.

Is there any way ?

Also I am not sure how come PGM(SDSF) call knows the input is in ISFIN and output will be wrttien to ISFOUT?

Would apprecaite anyone's help.
Thansk

Re: SDSF in REXX

PostPosted: Thu Jan 26, 2012 10:31 am
by enrico-sorichetti
see here for a smarter way
http://ibmmainframes.com/about54926.html

Re: SDSF in REXX

PostPosted: Sat Jan 28, 2012 5:23 am
by arshadhrashid
thanks for your help. Could not find in the manual what I was looking for but found the folloiwng JCL to do the exact same thing.
I think its a better of achieveing this, so I am posting it for every one's benefits. The only draw-back is, since thsi is JCL so jobname can not be supplied from
prompt line an dyou have to modify JCL each time to enter a new JOBNAME.

//BSDSF EXEC PGM=SDSF
//REPORT DD DISP=(OLD,CATLG,),DSN=HLQ.KA.SDSFOUT,
// SPACE=(CYL,(1,1)),RECFM=FB,LRECL=133,BLKSIZE=0
//ISFIN DD *
ST
PRE JOBNAME
FIND JOBNAME
++?
FIND JESMSGLG
++S
PRINT FILE REPORT
PRINT 1 9999
PRINT CLOSE
END
EXIT
//ISFOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*

Re: SDSF in REXX

PostPosted: Sun Jan 29, 2012 4:09 pm
by enrico-sorichetti
I think its a better of achieveing this, so I am posting it for every one's benefits.


NO, the best way is to make use of the smarter REXX SDSF interface

the way You are doing it, You just issue a bunch of commands in the hope that everything will be right

with the smart REXX SDSF interface You are always in control for error checking and corrective actions.