Discussion:
Rexx to Copy all the Job output
(too old to reply)
Jake Anderson
2016-04-27 14:38:11 UTC
Permalink
Hello,

I am looking for a help on sample REXX exec which can copy all the Job
submitted by particular Owner to a Dataset ?

Does anyone has a similar Exec running and willing to Share the Logic ?

Regards,
Jake

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Arlen Stovall
2016-04-27 14:52:31 UTC
Permalink
Jake, here is one I use. Let me know if you have any questions. You will
need access to retrieve sysout from jobs that you did not submit.
Post by Jake Anderson
Hello,
I am looking for a help on sample REXX exec which can copy all the Job
submitted by particular Owner to a Dataset ?
Does anyone has a similar Exec running and willing to Share the Logic ?
Regards,
Jake
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
--
Thanks
Arlen Stovall

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
David Spiegel
2016-04-27 15:19:51 UTC
Permalink
Hi Arlen,
I read your Exec and have 2 suggestions for improvement:
1) BLKSIZE(133) is inefficient space-wise and CPU-wise. Please change
it to 27930 (half-track blocking).
2) UNIT(SYSDA) does not exist in all shops. (It depends what the SysProg
put into the HCD Esoteric definitions.) Please change it to SYSALLDA.
This exists in all z/OS systems.

Regards,
David Spiegel
Post by Arlen Stovall
Jake, here is one I use. Let me know if you have any questions. You will
need access to retrieve sysout from jobs that you did not submit.
Post by Jake Anderson
Hello,
I am looking for a help on sample REXX exec which can copy all the Job
submitted by particular Owner to a Dataset ?
Does anyone has a similar Exec running and willing to Share the Logic ?
Regards,
Jake
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
--
Thanks
Arlen Stovall
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
John McKown
2016-04-27 14:55:06 UTC
Permalink
Post by Jake Anderson
Hello,
I am looking for a help on sample REXX exec which can copy all the Job
submitted by particular Owner to a Dataset ?
Does anyone has a similar Exec running and willing to Share the Logic ?
Regards,
Jake
​I wrote a JES2DISK REXX program. Look here:
https://gist.github.com/JohnArchieMckown/b27747d0c4750a258997
The page has a "DOWNLOAD" button on it which will download the file in ZIP
format to your desktop.​
--
The unfacts, did we have them, are too imprecisely few to warrant our
certitude.

Maranatha! <><
John McKown

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Paul Gilmartin
2016-04-29 21:55:32 UTC
Permalink
...in our shop having no UNIT defaults to SYSDA which
sends the dataset to work volumes that get purged constantly. ...
So you may want to add an optional UNIT parameter to JES2DISK for
flexibility, defaulting to SYSALLDA perhaps.
​Hum, I could. My assumption at the time was that since JES2DISK was meant
to be run from a batch TMP job, that it would pick up the correct UNIT from
the TSO segment. Or, as in our shop, be assigned the correct storage group
​in the ACS routines.
I don't know how far to go to accommodate parochial and idiosyncratic
configuration.

Likewise, at our shop the default SYSOUT class gets purged at job completion.

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Lizette Koehler
2016-04-27 14:56:13 UTC
Permalink
Do an internet search for JES2DISK by John McKown. It is set up to use ISFEXEC (SDSF REXX) can write to a Unix file or dasd dataset.

Lizette
-----Original Message-----
Jake Anderson
Sent: Wednesday, April 27, 2016 7:38 AM
Subject: [TSO-REXX] Rexx to Copy all the Job output
Hello,
I am looking for a help on sample REXX exec which can copy all the Job
submitted by particular Owner to a Dataset ?
Does anyone has a similar Exec running and willing to Share the Logic ?
Regards,
Jake
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
John Wallin
2016-04-27 18:26:15 UTC
Permalink
See BUILDPDS, in "Implementing REXX Support in SDSF" redbook, sg24-7419-00,
Chapter 2 "Copying SYSOUT to a PDS".
Post by Lizette Koehler
Do an internet search for JES2DISK by John McKown. It is set up to use
ISFEXEC (SDSF REXX) can write to a Unix file or dasd dataset.
Lizette
-----Original Message-----
Behalf Of
Jake Anderson
Sent: Wednesday, April 27, 2016 7:38 AM
Subject: [TSO-REXX] Rexx to Copy all the Job output
Hello,
I am looking for a help on sample REXX exec which can copy all the Job
submitted by particular Owner to a Dataset ?
Does anyone has a similar Exec running and willing to Share the Logic ?
Regards,
Jake
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
--
Regards,
John Wallin
z/OS Systems Programmer
Dillard Store Services
501-376-5154
***@Dillards.com

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Paul Gilmartin
2016-04-27 23:17:50 UTC
Permalink
Post by John Wallin
See BUILDPDS, in "Implementing REXX Support in SDSF" redbook, sg24-7419-00,
Chapter 2 "Copying SYSOUT to a PDS".
In www.redbooks.ibm.com/redbooks/pdfs/sg247419.pdf I read:

Although the code copies RECFM, LRECL, and BLKSIZE from the currently
existing output, PDSE, JES, and IEBGENER limit our choices. During testing, we
discovered that JES sets the RECFM of the spool data set to Variable Block (VB)
and, of course, IEBGENER demands a match to work. So, in this case, either
your PDS will be VB, or you will need an alternative copy utility.

I don't entirely agree with this. For *one* of my jobs, SDSF reports:

ISFROWS is 1 for tokens: 1
Job SJA Reader : RECFM=F LRECL=80 CHARS=**** DEST=
1 1 JESJCLIN: RECFM=F LRECL=80 CHARS=****,****,****,**** DEST=
2 2 JESMSGLG: RECFM=UA LRECL=133 CHARS=GT12,****,****,**** DEST=LOCAL
3 3 JESJCL : RECFM=V LRECL=132 CHARS=GT12,****,****,**** DEST=LOCAL
4 4 JESYSMSG: RECFM=VA LRECL=133 CHARS=GT12,****,****,**** DEST=LOCAL
5 5 $INTTEXT: RECFM=V LRECL=8192 CHARS=****,****,****,**** DEST=
6 6 $JOURNAL: RECFM=V LRECL=380 CHARS=****,****,****,**** DEST=
7 8 EVENTLOG: RECFM=U LRECL=32760 CHARS=****,****,****,**** DEST=
8 101 DUMMY : RECFM=F LRECL=80 CHARS=****,****,****,**** DEST=
9 102 DUMMY : RECFM=F LRECL=80 CHARS=****,****,****,**** DEST=
10 103 SYSUT1 : RECFM=F LRECL=80 CHARS=****,****,****,**** DEST=
11 104 SMPCNTL : RECFM=F LRECL=80 CHARS=****,****,****,**** DEST=
12 105 SMPCLNT : RECFM=F LRECL=80 CHARS=****,****,****,**** DEST=
13 106 SYSPRINT: RECFM=FBA LRECL=121 CHARS=GT12,****,****,**** DEST=LOCAL
14 107 SYSTSPRT: RECFM=VB LRECL=247 CHARS=GT12,****,****,**** DEST=LOCAL
15 108 SMPLOG : RECFM=VB LRECL=506 CHARS=GT12,****,****,**** DEST=LOCAL
16 109 SMPRPT : RECFM=FBA LRECL=121 CHARS=GT12,****,****,**** DEST=LOCAL
17 110 SYSPRINT: RECFM=FBA LRECL=121 CHARS=GT12,****,****,**** DEST=LOCAL

So within jobs, or even within a job, spool data set attributes can
vary wildly. IEBGENER is a good strategy since it copies attributes
from its SYSUT1 to SYSUT2. But each data set should go to a different
target. This is most readily done if the job output is stored in a
UNIX directory hierarchy, not in a PDS.

I'd like to tag my UNIX file output with suitable FILEDATA; I must
guess at this, mostly inferring from DDNAME. And with CCSID: The
closest that JES comes is the CHARS attribute. Is there any defined
conversion from CHARS to CCSID?

I might point this out to the authors:
Lydia Parziale
Ludvik Drobnic
Dario Facchinetti
Richard Levey
Amy Miu
... if the Redbook contained contact information.

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Robert Zenuk
2016-04-27 23:29:11 UTC
Permalink
Here is a bare bones examples of using SDSF/REXX for this purpose. It accepts the OWNER as input and writes all qualifying jobs to the OUTPUT DD as one long output.

There are 3 optional parms:
OWNER defaults to the submitters ID
DELIM defaults to N (add delimiters between jobs)
Q defaults to H (HOLD queue vs O, I, DA or ST)

/* rexx - Sample SDSF/REXX to extract all held jobs from an OWNER */
arg owner delim q .
if owner = '' then owner = userid()
if delim = '' then delim = 'N'
if q = '' then q = 'H'
if isfcalls('ON') <> 0 then exit 99
o = 0
call sdsf "ISFEXEC" q
do h=1 to isfrows
if ownerid.h = owner then
do
if delim <> 'N' then
do
o = o + 1
output.o = '===>' left(jname.h,8) jobid.h 'BEGIN <==='
end
call sdsf "ISFACT" q "TOKEN('"token.h"') PARM(NP ?) (PREFIX $"
do d=1 to $ddname.0
call sdsf "ISFACT" q "TOKEN('"$token.d"') PARM(NP SA)"
address TSO "EXECIO * DISKR" isfddname.1 "(STEM OUT. FINIS"
do s=1 to out.0
o = o + 1
output.o = strip(out.s,'T')
if output.o = '' then output.o = ' '
end
end
if delim <> 'N' then
do
o = o + 1
output.o = '===>' left(jname.h,8) jobid.h 'END <==='
end
end
end
address TSO "EXECIO * DISKW OUTPUT (STEM OUTPUT. FINIS"
exit RC
sdsf: parse arg sdsfcall
address SDSF sdsfcall
select
when isfmsg = '' then return
when isfmsg = 'DATA SET ALLOCATED' then return
otherwise
do
say isfmsg
do e=1 to isfmsg2.0
say sdsfcall right(e,2)':' isfmsg2.e
end
exit 16
end
end

Here is some JCL to run it

//jc...
//SDSFRHOW EXEC PGM=IKJEFT01,PARM='SDSFRHOW ownerid Y H'
//SYSEXEC DD DSN=your.rexx.pds,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//OUTPUT DD SYSOUT=*

I hadn't posted in a while and have been distracted with distributed stuff lately... I needed something mainframey to bite into. I feel much better now. :-)

Rob


-----Original Message-----
From: John Wallin <***@DILLARDS.COM>
To: TSO-REXX <TSO-***@VM.MARIST.EDU>
Sent: Wed, Apr 27, 2016 11:26 am
Subject: Re: Rexx to Copy all the Job output

See BUILDPDS, in "Implementing REXX Support in SDSF" redbook, sg24-7419-00,
Chapter 2 "Copying SYSOUT to a PDS".
Post by Lizette Koehler
Do an internet search for JES2DISK by John McKown. It is set up to use
ISFEXEC (SDSF REXX) can write to a Unix file or dasd dataset.
Lizette
-----Original Message-----
Behalf Of
Jake Anderson
Sent: Wednesday, April 27, 2016 7:38 AM
Subject: [TSO-REXX] Rexx to Copy all the Job output
Hello,
I am looking for a help on sample REXX exec which can copy all the Job
submitted by particular Owner to a Dataset ?
Does anyone has a similar Exec running and willing to Share the Logic ?
Regards,
Jake
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
--
Regards,
John Wallin
z/OS Systems Programmer
Dillard Store Services
501-376-5154
***@Dillards.com

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX


----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Russ Lilley
2016-04-28 18:43:10 UTC
Permalink
Jake,

Find below a rexx exec, ispf panel (optional), and ISPF help panel that should be all you need to capture and index SDSF output. If you execute RDTSVSDF with parms the panel is not necessary.

The help is display by TSO RDTSVSDF ?

Hth,

Russ


//********************** REXX EXEC *************************

EXEC:

/* Rexx - RDTSVSDF - copy job output from SDSF to a PDS */
/* */
/* This exec will capture and index the job listings from SDSF and */
/* store them in a library. The job capture is controlled by */
/* input arguments. The arguments can control: */
/* Job Prefix */
/* Job Owner */
/* Job Id */
/* Queue (DA, H, ST) */
/* Output Dataset name. The dataset can either be pre-allocated */
/* or will be allocated */
/* */
/* Duplicate job names cannot be saved. If you receive the */
/* error message you may want to use a different ODSN. */
/* */
/*-------------------------------------------------------------------*/
/* Args: */
/* Job Prefix */
/* Job Owner */
/* Job JobId */
/* Job Queue */
/* Output PDS where SDSF output is captured */
/* */
/* If RDTSVSDF is called without any args a panel will display */
/* where your options can be set. */
/*-------------------------------------------------------------------*/
MsgStat = MSG("OFF")

arg inparms

Call Set_Defaults
Call Parse_Args
Call Verify_Options
Call Alloc_Output
Call Copy_Queue
Call Free_Output
Call Display_Finish_Message

Exit

Free_Output: NOP
/*-------------------------------------------------------------------*/
/* Free the output DS allocation. */
/*-------------------------------------------------------------------*/

Address TSO "FREE FI(SDSFOUT)"

Return

Alloc_Output: NOP
/*-------------------------------------------------------------------*/
/* Allocate the output dataset if it does not already exist. */
/* If the dataset does not exist it will be allocated as a PDSE */
/*-------------------------------------------------------------------*/

ODSN = "'"strip(ODSN,"B","'")"'" /* remove quotes from a quoted DS */
/* and put our own quotes on */

If SYSDSN(ODSN) /= "OK" then do
ALine1 = "CYL SPACE(1 5) NEW CATALOG DSORG(PO)"
ALine2 = "LRECL(255) RECFM(F B) DSNTYPE(LIBRARY)"
End
Else do /* alloc existing as SHR */
Call Validate_Existing_DS /* make user DS matches required */
ALine1 = ""
ALine2 = "SHR"
End

address tso "ALLOC DD(SDSFOUT) DS("ODSN")",
ALine1,
ALine2

Call Allocate_Index

return

Verify_Options: NOP
/*-------------------------------------------------------------------*/
/* Verify that all options have been set and that PREFIX and */
/* OWNER and not both *. If both are * the entire SDSF queue will */
/* be copied. */
/*-------------------------------------------------------------------*/

Call Validate_JPrefix
Call Validate_JJobId

Return

Validate_JPrefix:
/*-------------------------------------------------------------------*/
/* Validate the JPrefix field */
/*-------------------------------------------------------------------*/
if (jprefix = ' ' & jowner = ' '),
| (jprefix = ' ' & jowner = '*'),
| (jprefix = '*' & jowner = ' '),
| (jprefix = '*' & jowner = '*') then do
say "Both the NAME and TYPE fields cannot be blank"
say "NAME contains PREFIX and TYPE contains OWNER"
say "one or both of these must be used"
Exit 8
End

Return

Validate_JJobId:
/*-------------------------------------------------------------------*/
/* Validate the JobId field */
/*-------------------------------------------------------------------*/
If JJobid /= "" then do
ValidJID = "TSU JOB STC"
If (wordpos(substr(JJOBID,1,3),ValidJID) = 0),
| (length(JJOBID) /= 8),
| (datatype(substr(JJOBID,4,5)) /= "NUM") then do
Say "Invalid JJOBID= specified"
Say "The JJOBID= must start with TSU or JOB or STC and "
Say "be 8 characters in length and the last 5 characters"
Say "must be numeric"
Exit 8
End
End

Return

Validate_Existing_DS:
/*-------------------------------------------------------------------*/
/* If the user is using an existing dataset make sure it is a PDS */
/* or PDSE and the LRECL = 255. */
/*-------------------------------------------------------------------*/
if (LISTDSI(ODSN) > 4) then do
Say "Error alloacting the ODSN "odsn
Say "LISTDSI SYSREASON = "SYSREASON
Exit 8
End

If (SYSDSORG <> "PO"),
| (SYSLRECL <> 255) then do
Say "SYSDSORG must be PO"
Say "SYSLRECL must be 255"
Say ODSN" has an LRECL of "SYSLRECL" and a DSORG of "SYSDSORG
Exit 8
End

Return

Allocate_Index:
/*-------------------------------------------------------------------*/
/* Allocate the index member which is stored in the output DS. */
/* If an INDEX member already exists read it and populate INDEX. */
/* Else set INDEX.0 = 0 */
/*-------------------------------------------------------------------*/

read_index = 1
Indmem = "'"strip(odsn,"B","'")"(INDEX)'"
If SYSDSN(Indmem) /= "OK" then read_index = 0

address TSO "alloc fi(outindex) ds("indmem") shr"

if read_index = 1 then
address TSO "EXECIO * DISKR outindex (STEM index. FINIS)"
Else
index.0 = 0

IF DEBUG = "Y" then say "INDEX.0 = "index.0

Return

Populate_Old_Index: NOP
/*-------------------------------------------------------------------*/
/* If the output dataset already existed we need to append the new */
/* listings to the existying list. */
/*-------------------------------------------------------------------*/

address TSO "EXECIO * DISKR outindex (STEM index. FINIS)"

Return

Set_Defaults: NOP
DEBUG = " "
JPREFIX = "*"
JOWNER = "*"
JQUEUE = "ST"
JJOBID = " "
SDATE = " "
EDATE = " "
DATEN = "9999.999"
STIME = " "
ETIME = " "
TIMEN = "99:99:99"
MSGS = "ON"
/*
SDATE = Substr(DATE("S"),1,4)"."Substr(DATE("J"),3,3)
EDATE = Substr(DATE("S"),1,4)"."Substr(DATE("J"),3,3)
STIME = TIME()
ETIME = TIME()
*/
DQUAL = substr(DATE("S"),3,6)
ODSN = "'"userid()".SDSFOUT.D"DQUAL".T"TIME(M)"'"
Return

Parse_Args: NOP
/*-------------------------------------------------------------------*/
/* Parse the incoming args: */
/* OutputDSN - DSN where you want the output saved */
/* Job Prefix - Job Name Prefix to save */
/* Job Owner - Job Owner to save */
/* JobId - JobId (JOB09456 or TSU00234) */
/* Start Date - Filter selection by Start Date */
/* Stop Date - Filter selections by Ending Date */
/* Start Time - Filter selection by Start Time */
/* Stop Time - Filter selections by Ending Time */
/*-------------------------------------------------------------------*/

If inparms = "?" then do
Call Display_Help
Exit 0
End

If inparms = " " then do
Call Display_Panel
Call Format_Panel_Vars
USEPARM = TRANSLATE(SPACE(USEPRE USEOWN USEDSN USEQ),',',' ')
End

validprm = "JPREFIX= JOWNER= SDATE= EDATE= STIME= ETIME= ODSN=",
"JQUEUE= JJOBID= DEBUG= JTRACE= MSGS="

say inparms

Do Forever
parse var inparms chkparm '=' parmval ',' rest
interpret chkparm "='"parmval"'"
if index(validprm,chkparm) = 0 then,
Call rcexit 8 'Invalid parm supplied. Parms: 'chkparm,
'is not a valid parm. VALID PARMS: 'VALIDPRM
if rest = "" then leave
inparms = rest
End /* end, DO FOREVER */


Return

Display_Panel:
/*-------------------------------------------------------------------*/
/* Display the input panel */
/* Default the Prefix to userid */
/* Default the Owner to blank */
/*-------------------------------------------------------------------*/

JPREFIX = userid()||'*'
JOWNER = ''

address ISPEXEC "ADDPOP"
address ISPEXEC "DISPLAY PANEL(RDTSVSDF)"
DispRC = RC
address ISPEXEC "REMPOP"
If DispRC >= 8 then do
Say 'SDSF output not saved, You issued END.'
exit 8
End

Return

Format_Panel_Vars:
/*-------------------------------------------------------------------*/
/* Format the input panel fields into a valid inparms */
/*-------------------------------------------------------------------*/

usepre = ''
useown = ''
usedsn = ''
useQ = ''
useJID = ''
Call Validate_JPrefix
Call Validate_JJobId
if JPREFIX /= '' then usepre = strip('JPREFIX='JPREFIX)
if JOWNER /= '' then useown = strip('JOWNER='JOWNER)
if ODSN /= '' then usedsn = strip('ODSN='ODSN)
if JQUEUE /= '' then useQ = strip('JQUEUE='JQUEUE)
if JJOBID /= '' then useJ = strip('JQUEUE='JJOBID)
/* space will reduce the 4 word to only 1 space between and the */
/* translate will change the space to a , so we end up with */
/* commas between each word. */
inparms = translate(space(usepre useown usedsn useQ useJID),',',' ')

Return

Display_Finish_Message: NOP
/*-------------------------------------------------------------------*/
/* Display the output dataset and other important info. */
/*-------------------------------------------------------------------*/
Say ""
Say "Your output is saved in "odsn
Say "Using parms; Prefix: "Jprefix", Owner:" Jowner", Queue: "JQueue
Say ""

Return

Display_Help:

Say ""
Say "RDTSVSDF Help"
Say ""
Say "Call RDTSVSDF JPREFIX=MYJOB*,JQUEUE=H"
Say "Call RDTSVSDF JOWNER=MYJOB,JQUEUE=ST"
Say "Call RDTSVSDF JOWNER=MYJOB,JQUEUE=ST,ODSN=MYJOB.SDSF.TEST"
Say ""
Say "If ODSN= is not specified the output dataset will be"
Say "like: userid().SDSFOUT.D120927.T866"
Say ""
Say "The output dataset will have an INDEX member that describes"
Say "each of the members saved."
Say ""
Say "The output dataset name will be displayed at exit"
Say ""

Return

Copy_Queue: NOP
/*-------------------------------------------------------------------*/
/* Use ISF (SDSF) to copy the requested output to the output DS */
/* An index member is also created containing a list of all */
/* members written to the library. */
/*-------------------------------------------------------------------*/
ISFrc = isfcalls("ON")
ISFPREFIX = JPREFIX
ISFOWNER = JOWNER
address SDSF "isfexec "JQUEUE" (delayed"
ISFPRTDSNAME = ODSN
ISFPRTDISP = "SHR"

do i = 1 to isfrows

ISFPRTMEMBER = jobid.i
prtmem = "'"strip(odsn,"B","'")"("ISFPRTMEMBER")'"

/* User has additionally filtered by JOBID */
If JJOBID /= "",
& JJOBID /= JOBID.I then iterate

If SDATE /= "" then do
If DATEN.i < SDATE then Iterate
If STIME /= "" then do
If TIMEN.i < STIME then Iterate
End
End

If EDATE /= "" then do
If DATEN.i > EDATE then Iterate
If ETIME /= "" then do
If TIMEN.i > ETIME then Iterate
End
End

/* If the same JOBID has already been saved say so and skip */
If SYSDSN(prtmem) = "OK" then do
Say ISFPRTMEMBER" already exists, not saving"
iterate
End

say "Adding: " ISFPRTMEMBER
Call Capture_Index_Detail
address sdsf "isfact "JQUEUE" token('"token.i"') PARM(NP XDC)"
if DEBUG = "Y" then say isfmsg
end

ISFrc = isfcalls("OFF")
Call Create_Index /* write the INDEX member */

Return

Capture_Index_Detail:
/*-------------------------------------------------------------------*/
/* As each output listing is saved into ODSN build an index record */
/* describing what the output is. This will be saved in the INDEX */
/* member of ODSN. */
/*-------------------------------------------------------------------*/

If INDEX.0 = 0 then Call Create_IndexHDR
cnt = index.0 + 1
index.0 = cnt
index.cnt = left(JNAME.I,8," "),
left(JOBID.I,8," "),
left(PNAME.I,25," "),
left(OWNERID.I,8," "),
left(RETCODE.I,10," "),
left(DATER.I,12," "),
left(TIMER.I,12," ")

Return

Create_IndexHDR: NOP
/*-------------------------------------------------------------------*/
/* Write a HDR line to the index member. This header places column */
/* headers as the first line in the Index member. */
/*-------------------------------------------------------------------*/

index.0 = 1
Index.1 = left("JobName",8," "),
left("JOBID",8," "),
left("PgmName",25," "),
left("OWNER",8," "),
left("RC",10," "),
left("DATE",12," "),
left("TIME",12," ")

Return

Create_Index: NOP
/*-------------------------------------------------------------------*/
/* Create the Index member in the ODSN. The index will help you */
/* identify what each member in the PDS is. */
/* The index is create by writing the INDEX. compound variable */
/* to the INDEX member of the library. */
/*-------------------------------------------------------------------*/

address TSO "EXECIO * DISKW outindex (STEM index. FINIS)"
address TSO "free fi(outindex)"

return


//************************ PANEL ****************************

)Attr Default() /* x'01' x'02' x'03' */
AB TYPE(AB ) /* Action Bar */
AC TYPE(ABSL ) GE(ON) /* Action Bar Separator line */
03 TYPE(NEF ) PADC(USER) CAPS(ON) /* CMD prompt Entry Field */
_ TYPE(NEF ) PAD('_') CAPS(ON) /* Normal Entry Underline */
% TYPE(ET ) /* % Text Intens High */
05 TYPE(PT ) /* Panel Title */
06 TYPE(LEF ) /* List Entry Field */
07 TYPE(LI ) /* List Output field */
º TYPE(OUTPUT) COLOR(RED) INTENS(HIGH) /* like LI except red */
+ TYPE(NT ) /* Normal Text */
` TYPE(FP ) /* Field Prompt Text */
| TYPE(CH ) /* Column/Group Header */
^ TYPE(DT ) /* Descriptive Text */
{ TYPE(INPUT ) pas(on) skip(off) /* Point and Shoot input */
} TYPE(TEXT) skip(on) color(turq) /* Text looks like { */
08 TYPE(OUTPUT) COLOR(RED) INTENS(HIGH) /* Warning Text */
09 TYPE(WASL ) /* Work area separater line */

)body window(60,15) expand(\\) outline(BOX)
Ú-\-\- Capture SDSF Output Ú-\-\- +
+
+Command ===>_ZCMD +
+
+|Either Prefix or Owner (or both) is Required +
+|Press 'Enter' to process +
+ +
+ OutDSN:_ODSN +
+ Prefix:_JPREFIX + (MYJOBA* or MYJOBAB)
+ Owner: _JOWNER + (MYUSER)
+ Queue: _JQUEUE+ (DA, H, ST)
+ JobId: _JJOBID + (JOB05692)
+ Resrv: _JDATE + (Reserved for future use)
+ Resrv: _JTIME + (Reserved for future use)
+
)INIT
.CURSOR = ZCMD
.HELP = RDTSVSDH
)END


//************************* help panel **********************

)Panel Keylist(ISRHELP ISR)
)Attr Default(`}~)
` TYPE(TEXT) INTENS(HIGH)
} TYPE(TEXT) INTENS(LOW) COLOR(GREEN)
~ TYPE(INPUT) COLOR(TURQ) CAPS(ON) JUST(LEFT)
^ TYPE(TEXT) INTENS(LOW) COLOR(BLUE)
! TYPE(TEXT) INTENS(LOW) COLOR(TURQ)
º TYPE(PS)
{ AREA(SCRL) EXTEND(ON)
)Body Expand (\\)
!-\-\- ADM Help - Save and Index SDSF Listings -\-\-}
}Option ===>~ZCMD
`RIGHT}to scroll down;`LEFT}to scroll up;`END}to return
{SAREA1 {
)Area SAREA1
}
`Index and save output from the SDSF queue to my dataset.
}
}!RDTSVSDF}will capture and index the job listings from SDSF and
} store them in a library. The job capture is controlled by
} input arguments. The arguments can control:
}
} Job Prefix
} Job Owner
} Job Id
} Queue (DA, H, ST)
} Output Dataset name. The dataset can either be pre-allocated
} or will be allocated if it does not exist.
}
} If ODSN= is not specified the output dataset will be similar to
} userid().SDSFOUT.D120927.T866
}
}
} Duplicate job names cannot be saved. If you receive the
} error message you may want to use a different ODSN.
}
}______________________________________________________________________
}______________________________________________________________________
}
} Input parms:
}
} JPREFIX= Prefix a
} JQUEUE= Queue a
} JOWNER= Owner Id a
} JJOBID= Job Id (JOB02507 or TSU02234) a
} ODSN= Output dataset name a
}______________________________________________________________________
}______________________________________________________________________
}
} If RDTSVSDF is called without any args a panel will display
} where your options can be set.
}
}______________________________________________________________________
}______________________________________________________________________
}
} Examples:
}
} Display the RDTSVSDF input panel so I can make selections
}
} TSO RDTSVSDF
}
} Save all Jobs from the Held Queue with the Prefix DVRLL* into a new
} dataset. The dataset name will be displayed when the command ends.
}
} TSO RDTSVSDF JPREFIX=DVRLL*,JQUEUE=H
}
} Save all Jobs from the Status Queue with the Prefix DVRLL* into a new
} dataset. The dataset name will be displayed when the command ends.
}
} TSO RDTSVSDF JOWNER=DVRLL,JQUEUE=ST
}
} Save all Jobs from the Status Queue Where the Owner Id = DVRLL and
} save them in dataset DVRLL.SDSF.TEST
}
} TSO RDTSVSDF JOWNER=DVRLL,JQUEUE=ST,ODSN=DVRLL.SDSF.TEST
}
}______________________________________________________________________
}______________________________________________________________________
}
} The output dataset will have an INDEX member that describes
} each of the members saved.
}
} The output dataset name will be displayed at exit
} the
)Proc
)End

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Jake Anderson
Sent: Wednesday, April 27, 2016 10:38 AM
To: TSO-***@VM.MARIST.EDU
Subject: Rexx to Copy all the Job output

Hello,

I am looking for a help on sample REXX exec which can copy all the Job submitted by particular Owner to a Dataset ?

Does anyone has a similar Exec running and willing to Share the Logic ?

Regards,
Jake

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Anania, Philip D
2016-04-29 13:54:45 UTC
Permalink
Hi Jake,

Looks like you've gotten a lot of responses to your quest to capture SDSF
output. I have one that you feed a mask to and it will capture any jobs
that fall within the mask format and you can provide a list of the DD names
you are interested in. We had a need to be able to extract certain DD's
like SYSTSPRNT without getting everything. If this seems like it would be
something of interest I'll gladly share it with you but it is a bit
different than what you asked for and it appears you may have gotten what
you need. Anyway, the offer is there.

Phil
Post by Jake Anderson
Hello,
I am looking for a help on sample REXX exec which can copy all the Job
submitted by particular Owner to a Dataset ?
Does anyone has a similar Exec running and willing to Share the Logic ?
Regards,
Jake
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
--

"Go about your Music citizen" - PdotDdot

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
David McCrina
2016-04-29 14:28:55 UTC
Permalink
Phil, if no one else is, I would be interested in a copy of your exec.

Thanks,
David McCrina
Post by Anania, Philip D
Hi Jake,
Looks like you've gotten a lot of responses to your quest to capture SDSF
output. I have one that you feed a mask to and it will capture any jobs
that fall within the mask format and you can provide a list of the DD names
you are interested in. We had a need to be able to extract certain DD's
like SYSTSPRNT without getting everything. If this seems like it would be
something of interest I'll gladly share it with you but it is a bit
different than what you asked for and it appears you may have gotten what
you need. Anyway, the offer is there.
Phil
Post by Jake Anderson
Hello,
I am looking for a help on sample REXX exec which can copy all the Job
submitted by particular Owner to a Dataset ?
Does anyone has a similar Exec running and willing to Share the Logic ?
Regards,
Jake
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
--
"Go about your Music citizen" - PdotDdot
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Anania, Philip D
2016-04-29 15:19:00 UTC
Permalink
Hola,

I hope this translates properly. I had to grab this from work and send to
my MAC and send it out. Here is the JCL and the REXX:

JCL Follows:

//*
//* SAVE SDSF OUTPUTS.
//*
//SAVEP EXEC PGM=IKJEFT01,REGION=0M
//SYSEXEC DD DISP=SHR,DSN=YOUR.SYSEXEC
//* Enter DD's you want to capture as input to DDIN...
//DDIN DD *
EN$DPMSG
SYSTSPRT
SUSUT2
/*
//SYSTSPRT DD SYSOUT=*
//* Parm is the JOB or TASK ID Mask.
//* The "Y" indicates to create a file for the output.
//* Otherwise it writes the output to SYSOUT for review.
//SYSTSIN DD *
%SDSFCMEW EAPISVP Y
/*
//*

REXX Follows:

/* REXX : SDSFCMET */
/* */
parse arg task_id update_sw

call INITIALIZE
call READ_DDS_TO_PROCESS
call SETUP_SDSF
call PROCESS_SDSF
call FINISH
EXIT 99

/* */
/* Standard Initialization Routine... */
/* */
INITIALIZE:

"DELSTACK"
"NEWSTACK"

drop out.
o = 0

dt = right(date('S'),6)
yy = left(dt,2)
mm = substr(dt,3,2)
dd = right(dt,2)
mmddyy = mm'/'dd'/'yy

id = userid()
jid = jobnam()
jid = strip(jid)
jnum = workid()
jnum = strip(jnum)

lpar = mvsvar(syssmfid)
os = mvsvar(SYSOPSYS)
plex = mvsvar(SYSPLEX)

parse source . . pgmid .

say pgmid' Submitted by JOB('jid') under TSOID: 'id
say 'Running on' lpar' SYSPLEX' plex', OS' os' on' mmddyy '@' TIME('L')

msg = pgmid' - Successful Completion' 0

RETURN 0

/* */
/* Read DD's... */
/* */
READ_DDS_TO_PROCESS:

dds. = 0

"EXECIO * DISKR DDIN (FINIS"
if RC <> 0
then
do
msg = pgmid' - Bad READ of DDIN' RC
signal FINISH
end

do queued()

pull rec

dd = strip(rec)

dds.dd = 'Y'

end

RETURN 0

/* */
/* Connect to SDSF... */
/* */
SETUP_SDSF:

/* Open SDSF. */
call isfcalls "ON"

address SDSF

/* Set Variables for SDSF. */
isfprefix = 'EAPISVP*'
isfprefix = task_id'*'
isfowner = '*'
isfcols = jname jobid dater timer queue
isfsort = "DATER D TIMER D"

/* Use DELAY option to allow for use of certain variables. Use SDSF */
/* COLSHELP for a list of available variables. */
"ISFEXEC ST (DELAYED)"

RETURN 0

/* */
/* */
/* */
PROCESS_SDSF:

keys = ''
dsns = ''

/* Loop thru the current EAPISVP outputs and grab the info we need. */
if jname.0 > 0
then
do n = 1 to jname.0

say
say jname.n jobid.n queue.n dater.n timer.n

/* Ignore anything not in PRINT status. */
if strip(queue.n) <> 'PRINT' then iterate n

/* Check the DSN - if it exists, we bypass it from view. */
parse value dater.n with yyyy '.' ddd
dt = 'D'yyyy||ddd
parse value timer.n with hh ':' mm ':' ss '.' .
tm = 'T'hh||mm||ss
dsn = 'NDVR.'jname.n'.'dt'.'tm'.'jobid.n
if SYSDSN("'"dsn"'") = 'OK'
then
do
say
say 'DSN Exists' dsn
iterate n
end

/* Add the TASK info to the KEYS variable and add the DSN info to */
/* the DSN Variable. */
keys = keys jname.n'.'jobid.n
m = words(keys)
job_token.m = token.n
dsns = dsns dsn

end

/* Loop through the selected EAPISVP info. */
isfcols = 'DDNAME STEPN'

do n = 1 to words(keys)

/* Get the Job Token ID for this EAPISVP Task. */
job_token = job_token.n

say
say 'Processing Task:' word(keys,n) date('S') time()

/* Set SDSF to ST "?" mode. */
address SDSF
"ISFACT ST TOKEN('"job_token"') PARM(NP ?)"

/* Initialize variables for this TASK: DD_TOEKN, REC. and OUT. */
drop out.
o = 0
dd_token = ''
drop rec.
dd = 0

/* Loop thru the DD Outputs. */
do m = 1 to ddname.0

ddname = ddname.m

if dds.ddname = 'Y'
then
do
if ddname.m stepn.m = ddname' 'task_id
then
do
o = o + 1
out.o = '$$$: BEGIN 'ddname' OUTPUT'
dd_token = token.m
end
else
do
iterate m
end
end
else
do
iterate m
end

say
say 'Processing DD:' ddname.m '('m')'

/* Get the DD into the SDSF array. */
address SDSF
"ISFACT ST TOKEN('"dd_token"') PARM(NP SA)"

/* Read the DD output into an array. */
drop rec.
address TSO "EXECIO * DISKR" isfddname.1 "(STEM rec. FINIS"

say
say 'Records to add to output:' rec.0

/* Add the DD info for this DD to Output for this TASK. */
do dd = 1 by 1 to rec.0
o = o + 1
out.o = rec.dd
end

say rec.0 'Recs added to Total OUT' o

/* End of the DD Loop. */
end m

if update_sw = 'Y'
then
do
call WRITE_IT
end
else
do x = 1 by 1 to o
say '>' left(out.x,72)
end

/* EAPISVP Outer Loop. */
end n

RETURN 0

WRITE_IT:

say 'WRITEIT'
/* Free the DD OUT as it gets resued. */
x = outtrap('x.')
"FREE DD(OUT)"
x = outtrap('off')

/* Allocate the Output DD. */
dsn = word(dsns,n)
address TSO
"ALLOC F(OUT) DA('"dsn"') NEW CATALOG REUSE RECFM(F B)",
" LRECL(134) BLKSIZE(0)"
if RC <> 0
then
do
msg = pgmid' - Bad ALLOC of OUT' RC
signal FINISH
end

/* Write the OUT Backup for this EAPISVP. */
say
say 'Writing' o 'records for' dsn

out.0 = o
"EXECIO * DISKW OUT (STEM out. FINIS"
if RC <> 0
then
do
msg = pgmid' - Bad WRITE of OUT for JOB' RC
signal FINISH
end

RETURN 0

/* */
/* Standard EOJ Routine... */
/* */
FINISH:

/* Disconnect SDSF. */
call isfcalls "OFF"

/* Display the current status message. */
say msg

/* Find the pointer to the RC in the status message. */
x = words(msg)

/* Extract the RC from the status message. */
xx = word(msg,x)

/* Delete the stack. */
"DELSTACK"

EXIT xx
Post by David McCrina
Phil, if no one else is, I would be interested in a copy of your exec.
Thanks,
David McCrina
Post by Anania, Philip D
Hi Jake,
Looks like you've gotten a lot of responses to your quest to capture SDSF
output. I have one that you feed a mask to and it will capture any jobs
that fall within the mask format and you can provide a list of the DD
names
Post by Anania, Philip D
you are interested in. We had a need to be able to extract certain DD's
like SYSTSPRNT without getting everything. If this seems like it would
be
Post by Anania, Philip D
something of interest I'll gladly share it with you but it is a bit
different than what you asked for and it appears you may have gotten what
you need. Anyway, the offer is there.
Phil
On Wed, Apr 27, 2016 at 10:38 AM, Jake Anderson <
Post by Jake Anderson
Hello,
I am looking for a help on sample REXX exec which can copy all the Job
submitted by particular Owner to a Dataset ?
Does anyone has a similar Exec running and willing to Share the Logic ?
Regards,
Jake
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
--
"Go about your Music citizen" - PdotDdot
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
--

"Go about your Music citizen" - PdotDdot

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Farley, Peter x23353
2016-04-29 14:37:17 UTC
Permalink
Hi Philip,

I would be interested to see a copy of your routine. It sounds quite useful.

Peter

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Anania, Philip D
Sent: Friday, April 29, 2016 9:55 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: Rexx to Copy all the Job output

Hi Jake,

Looks like you've gotten a lot of responses to your quest to capture SDSF
output. I have one that you feed a mask to and it will capture any jobs
that fall within the mask format and you can provide a list of the DD names
you are interested in. We had a need to be able to extract certain DD's
like SYSTSPRNT without getting everything. If this seems like it would be
something of interest I'll gladly share it with you but it is a bit
different than what you asked for and it appears you may have gotten what
you need. Anyway, the offer is there.

Phil
Post by Jake Anderson
Hello,
I am looking for a help on sample REXX exec which can copy all the Job
submitted by particular Owner to a Dataset ?
Does anyone has a similar Exec running and willing to Share the Logic ?
Regards,
Jake
--


This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system.
Anania, Philip D
2016-04-29 15:19:55 UTC
Permalink
Hola,

I hope this translates properly. I had to grab this from work and send to
my MAC and send it out. Here is the JCL and the REXX:

JCL Follows:

//*
//* SAVE SDSF OUTPUTS.
//*
//SAVEP EXEC PGM=IKJEFT01,REGION=0M
//SYSEXEC DD DISP=SHR,DSN=YOUR.SYSEXEC
//* Enter DD's you want to capture as input to DDIN...
//DDIN DD *
EN$DPMSG
SYSTSPRT
SUSUT2
/*
//SYSTSPRT DD SYSOUT=*
//* Parm is the JOB or TASK ID Mask.
//* The "Y" indicates to create a file for the output.
//* Otherwise it writes the output to SYSOUT for review.
//SYSTSIN DD *
%SDSFCMEW EAPISVP Y
/*
//*

REXX Follows:

/* REXX : SDSFCMET */
/* */
parse arg task_id update_sw

call INITIALIZE
call READ_DDS_TO_PROCESS
call SETUP_SDSF
call PROCESS_SDSF
call FINISH
EXIT 99

/* */
/* Standard Initialization Routine... */
/* */
INITIALIZE:

"DELSTACK"
"NEWSTACK"

drop out.
o = 0

dt = right(date('S'),6)
yy = left(dt,2)
mm = substr(dt,3,2)
dd = right(dt,2)
mmddyy = mm'/'dd'/'yy

id = userid()
jid = jobnam()
jid = strip(jid)
jnum = workid()
jnum = strip(jnum)

lpar = mvsvar(syssmfid)
os = mvsvar(SYSOPSYS)
plex = mvsvar(SYSPLEX)

parse source . . pgmid .

say pgmid' Submitted by JOB('jid') under TSOID: 'id
say 'Running on' lpar' SYSPLEX' plex', OS' os' on' mmddyy '@' TIME('L')

msg = pgmid' - Successful Completion' 0

RETURN 0

/* */
/* Read DD's... */
/* */
READ_DDS_TO_PROCESS:

dds. = 0

"EXECIO * DISKR DDIN (FINIS"
if RC <> 0
then
do
msg = pgmid' - Bad READ of DDIN' RC
signal FINISH
end

do queued()

pull rec

dd = strip(rec)

dds.dd = 'Y'

end

RETURN 0

/* */
/* Connect to SDSF... */
/* */
SETUP_SDSF:

/* Open SDSF. */
call isfcalls "ON"

address SDSF

/* Set Variables for SDSF. */
isfprefix = 'EAPISVP*'
isfprefix = task_id'*'
isfowner = '*'
isfcols = jname jobid dater timer queue
isfsort = "DATER D TIMER D"

/* Use DELAY option to allow for use of certain variables. Use SDSF */
/* COLSHELP for a list of available variables. */
"ISFEXEC ST (DELAYED)"

RETURN 0

/* */
/* */
/* */
PROCESS_SDSF:

keys = ''
dsns = ''

/* Loop thru the current EAPISVP outputs and grab the info we need. */
if jname.0 > 0
then
do n = 1 to jname.0

say
say jname.n jobid.n queue.n dater.n timer.n

/* Ignore anything not in PRINT status. */
if strip(queue.n) <> 'PRINT' then iterate n

/* Check the DSN - if it exists, we bypass it from view. */
parse value dater.n with yyyy '.' ddd
dt = 'D'yyyy||ddd
parse value timer.n with hh ':' mm ':' ss '.' .
tm = 'T'hh||mm||ss
dsn = 'NDVR.'jname.n'.'dt'.'tm'.'jobid.n
if SYSDSN("'"dsn"'") = 'OK'
then
do
say
say 'DSN Exists' dsn
iterate n
end

/* Add the TASK info to the KEYS variable and add the DSN info to */
/* the DSN Variable. */
keys = keys jname.n'.'jobid.n
m = words(keys)
job_token.m = token.n
dsns = dsns dsn

end

/* Loop through the selected EAPISVP info. */
isfcols = 'DDNAME STEPN'

do n = 1 to words(keys)

/* Get the Job Token ID for this EAPISVP Task. */
job_token = job_token.n

say
say 'Processing Task:' word(keys,n) date('S') time()

/* Set SDSF to ST "?" mode. */
address SDSF
"ISFACT ST TOKEN('"job_token"') PARM(NP ?)"

/* Initialize variables for this TASK: DD_TOEKN, REC. and OUT. */
drop out.
o = 0
dd_token = ''
drop rec.
dd = 0

/* Loop thru the DD Outputs. */
do m = 1 to ddname.0

ddname = ddname.m

if dds.ddname = 'Y'
then
do
if ddname.m stepn.m = ddname' 'task_id
then
do
o = o + 1
out.o = '$$$: BEGIN 'ddname' OUTPUT'
dd_token = token.m
end
else
do
iterate m
end
end
else
do
iterate m
end

say
say 'Processing DD:' ddname.m '('m')'

/* Get the DD into the SDSF array. */
address SDSF
"ISFACT ST TOKEN('"dd_token"') PARM(NP SA)"

/* Read the DD output into an array. */
drop rec.
address TSO "EXECIO * DISKR" isfddname.1 "(STEM rec. FINIS"

say
say 'Records to add to output:' rec.0

/* Add the DD info for this DD to Output for this TASK. */
do dd = 1 by 1 to rec.0
o = o + 1
out.o = rec.dd
end

say rec.0 'Recs added to Total OUT' o

/* End of the DD Loop. */
end m

if update_sw = 'Y'
then
do
call WRITE_IT
end
else
do x = 1 by 1 to o
say '>' left(out.x,72)
end

/* EAPISVP Outer Loop. */
end n

RETURN 0

WRITE_IT:

say 'WRITEIT'
/* Free the DD OUT as it gets resued. */
x = outtrap('x.')
"FREE DD(OUT)"
x = outtrap('off')

/* Allocate the Output DD. */
dsn = word(dsns,n)
address TSO
"ALLOC F(OUT) DA('"dsn"') NEW CATALOG REUSE RECFM(F B)",
" LRECL(134) BLKSIZE(0)"
if RC <> 0
then
do
msg = pgmid' - Bad ALLOC of OUT' RC
signal FINISH
end

/* Write the OUT Backup for this EAPISVP. */
say
say 'Writing' o 'records for' dsn

out.0 = o
"EXECIO * DISKW OUT (STEM out. FINIS"
if RC <> 0
then
do
msg = pgmid' - Bad WRITE of OUT for JOB' RC
signal FINISH
end

RETURN 0

/* */
/* Standard EOJ Routine... */
/* */
FINISH:

/* Disconnect SDSF. */
call isfcalls "OFF"

/* Display the current status message. */
say msg

/* Find the pointer to the RC in the status message. */
x = words(msg)

/* Extract the RC from the status message. */
xx = word(msg,x)

/* Delete the stack. */
"DELSTACK"

EXIT xx


On Fri, Apr 29, 2016 at 10:37 AM, Farley, Peter x23353 <
Post by Farley, Peter x23353
Hi Philip,
I would be interested to see a copy of your routine. It sounds quite useful.
Peter
-----Original Message-----
Of Anania, Philip D
Sent: Friday, April 29, 2016 9:55 AM
Subject: Re: Rexx to Copy all the Job output
Hi Jake,
Looks like you've gotten a lot of responses to your quest to capture SDSF
output. I have one that you feed a mask to and it will capture any jobs
that fall within the mask format and you can provide a list of the DD names
you are interested in. We had a need to be able to extract certain DD's
like SYSTSPRNT without getting everything. If this seems like it would be
something of interest I'll gladly share it with you but it is a bit
different than what you asked for and it appears you may have gotten what
you need. Anyway, the offer is there.
Phil
Post by Jake Anderson
Hello,
I am looking for a help on sample REXX exec which can copy all the Job
submitted by particular Owner to a Dataset ?
Does anyone has a similar Exec running and willing to Share the Logic ?
Regards,
Jake
--
This message and any attachments are intended only for the use of the
addressee and may contain information that is privileged and confidential.
If the reader of the message is not the intended recipient or an authorized
representative of the intended recipient, you are hereby notified that any
dissemination of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately by
e-mail and delete the message and any attachments from your system.
--

"Go about your Music citizen" - PdotDdot

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Hobart Spitz
2016-05-01 18:19:35 UTC
Permalink
Apologies in advance for going a bit off topic.

There was a time when this problem would be approached by writing the
output to a dataset(s) and printing it (them) with a COND=EVEN step(s).
Today I would use a single COND=EVEN batch REXX step that would check for
the existence of each dataset (SYSDSN(dsname) = "OK"), and printing those
that exist. ("ALLOC FI(OUT) SYSOUT(c)")

Possibly there is a need for some kind of integration between JES spool and
the dataset name space. This might be an opportunity for a new product,
even tho it would probably be priced out of the reach of some sites. I
have used the JES command interface, and it was worse than more
conventional approaches.

That said, having used either CMS Pipes or TSO PIpes for much of the last
20 years, I find these efforts to be a case for using REXX in batch and/or
for using TSO Pipes. They would greatly simplify the process.

Keep in mind that z/VM-CMS do not need JCL. It uses REXX in batch. z/OS
can also (in almost all cases).

You should do two things:

1. Look into the TSO/REXX equivalents to JCL. Replacing JCL with REXX
is doable; the first one is the hardest.
2. Check to see if you have Pipes: [tso] pipe query . Every temporary
dataset is an opportunity to simplify a batch job and make it run faster to
boot.

I hope this helps.
Post by Anania, Philip D
Hola,
I hope this translates properly. I had to grab this from work and send to
//*
//* SAVE SDSF OUTPUTS.
//*
//SAVEP EXEC PGM=IKJEFT01,REGION=0M
//SYSEXEC DD DISP=SHR,DSN=YOUR.SYSEXEC
//* Enter DD's you want to capture as input to DDIN...
//DDIN DD *
EN$DPMSG
SYSTSPRT
SUSUT2
/*
//SYSTSPRT DD SYSOUT=*
//* Parm is the JOB or TASK ID Mask.
//* The "Y" indicates to create a file for the output.
//* Otherwise it writes the output to SYSOUT for review.
//SYSTSIN DD *
%SDSFCMEW EAPISVP Y
/*
//*
/* REXX : SDSFCMET */
/* */
parse arg task_id update_sw
call INITIALIZE
call READ_DDS_TO_PROCESS
call SETUP_SDSF
call PROCESS_SDSF
call FINISH
EXIT 99
/* */
/* Standard Initialization Routine... */
/* */
"DELSTACK"
"NEWSTACK"
drop out.
o = 0
dt = right(date('S'),6)
yy = left(dt,2)
mm = substr(dt,3,2)
dd = right(dt,2)
mmddyy = mm'/'dd'/'yy
id = userid()
jid = jobnam()
jid = strip(jid)
jnum = workid()
jnum = strip(jnum)
lpar = mvsvar(syssmfid)
os = mvsvar(SYSOPSYS)
plex = mvsvar(SYSPLEX)
parse source . . pgmid .
say pgmid' Submitted by JOB('jid') under TSOID: 'id
msg = pgmid' - Successful Completion' 0
RETURN 0
/* */
/* Read DD's... */
/* */
dds. = 0
"EXECIO * DISKR DDIN (FINIS"
if RC <> 0
then
do
msg = pgmid' - Bad READ of DDIN' RC
signal FINISH
end
do queued()
pull rec
dd = strip(rec)
dds.dd = 'Y'
end
RETURN 0
/* */
/* Connect to SDSF... */
/* */
/* Open SDSF. */
call isfcalls "ON"
address SDSF
/* Set Variables for SDSF. */
isfprefix = 'EAPISVP*'
isfprefix = task_id'*'
isfowner = '*'
isfcols = jname jobid dater timer queue
isfsort = "DATER D TIMER D"
/* Use DELAY option to allow for use of certain variables. Use SDSF */
/* COLSHELP for a list of available variables. */
"ISFEXEC ST (DELAYED)"
RETURN 0
/* */
/* */
/* */
keys = ''
dsns = ''
/* Loop thru the current EAPISVP outputs and grab the info we need. */
if jname.0 > 0
then
do n = 1 to jname.0
say
say jname.n jobid.n queue.n dater.n timer.n
/* Ignore anything not in PRINT status. */
if strip(queue.n) <> 'PRINT' then iterate n
/* Check the DSN - if it exists, we bypass it from view. */
parse value dater.n with yyyy '.' ddd
dt = 'D'yyyy||ddd
parse value timer.n with hh ':' mm ':' ss '.' .
tm = 'T'hh||mm||ss
dsn = 'NDVR.'jname.n'.'dt'.'tm'.'jobid.n
if SYSDSN("'"dsn"'") = 'OK'
then
do
say
say 'DSN Exists' dsn
iterate n
end
/* Add the TASK info to the KEYS variable and add the DSN info to */
/* the DSN Variable. */
keys = keys jname.n'.'jobid.n
m = words(keys)
job_token.m = token.n
dsns = dsns dsn
end
/* Loop through the selected EAPISVP info. */
isfcols = 'DDNAME STEPN'
do n = 1 to words(keys)
/* Get the Job Token ID for this EAPISVP Task. */
job_token = job_token.n
say
say 'Processing Task:' word(keys,n) date('S') time()
/* Set SDSF to ST "?" mode. */
address SDSF
"ISFACT ST TOKEN('"job_token"') PARM(NP ?)"
/* Initialize variables for this TASK: DD_TOEKN, REC. and OUT. */
drop out.
o = 0
dd_token = ''
drop rec.
dd = 0
/* Loop thru the DD Outputs. */
do m = 1 to ddname.0
ddname = ddname.m
if dds.ddname = 'Y'
then
do
if ddname.m stepn.m = ddname' 'task_id
then
do
o = o + 1
out.o = '$$$: BEGIN 'ddname' OUTPUT'
dd_token = token.m
end
else
do
iterate m
end
end
else
do
iterate m
end
say
say 'Processing DD:' ddname.m '('m')'
/* Get the DD into the SDSF array. */
address SDSF
"ISFACT ST TOKEN('"dd_token"') PARM(NP SA)"
/* Read the DD output into an array. */
drop rec.
address TSO "EXECIO * DISKR" isfddname.1 "(STEM rec. FINIS"
say
say 'Records to add to output:' rec.0
/* Add the DD info for this DD to Output for this TASK. */
do dd = 1 by 1 to rec.0
o = o + 1
out.o = rec.dd
end
say rec.0 'Recs added to Total OUT' o
/* End of the DD Loop. */
end m
if update_sw = 'Y'
then
do
call WRITE_IT
end
else
do x = 1 by 1 to o
say '>' left(out.x,72)
end
/* EAPISVP Outer Loop. */
end n
RETURN 0
say 'WRITEIT'
/* Free the DD OUT as it gets resued. */
x = outtrap('x.')
"FREE DD(OUT)"
x = outtrap('off')
/* Allocate the Output DD. */
dsn = word(dsns,n)
address TSO
"ALLOC F(OUT) DA('"dsn"') NEW CATALOG REUSE RECFM(F B)",
" LRECL(134) BLKSIZE(0)"
if RC <> 0
then
do
msg = pgmid' - Bad ALLOC of OUT' RC
signal FINISH
end
/* Write the OUT Backup for this EAPISVP. */
say
say 'Writing' o 'records for' dsn
out.0 = o
"EXECIO * DISKW OUT (STEM out. FINIS"
if RC <> 0
then
do
msg = pgmid' - Bad WRITE of OUT for JOB' RC
signal FINISH
end
RETURN 0
/* */
/* Standard EOJ Routine... */
/* */
/* Disconnect SDSF. */
call isfcalls "OFF"
/* Display the current status message. */
say msg
/* Find the pointer to the RC in the status message. */
x = words(msg)
/* Extract the RC from the status message. */
xx = word(msg,x)
/* Delete the stack. */
"DELSTACK"
EXIT xx
On Fri, Apr 29, 2016 at 10:37 AM, Farley, Peter x23353 <
Post by Farley, Peter x23353
Hi Philip,
I would be interested to see a copy of your routine. It sounds quite useful.
Peter
-----Original Message-----
Of Anania, Philip D
Sent: Friday, April 29, 2016 9:55 AM
Subject: Re: Rexx to Copy all the Job output
Hi Jake,
Looks like you've gotten a lot of responses to your quest to capture SDSF
output. I have one that you feed a mask to and it will capture any jobs
that fall within the mask format and you can provide a list of the DD
names
Post by Farley, Peter x23353
you are interested in. We had a need to be able to extract certain DD's
like SYSTSPRNT without getting everything. If this seems like it would
be
Post by Farley, Peter x23353
something of interest I'll gladly share it with you but it is a bit
different than what you asked for and it appears you may have gotten what
you need. Anyway, the offer is there.
Phil
On Wed, Apr 27, 2016 at 10:38 AM, Jake Anderson <
Post by Jake Anderson
Hello,
I am looking for a help on sample REXX exec which can copy all the Job
submitted by particular Owner to a Dataset ?
Does anyone has a similar Exec running and willing to Share the Logic ?
Regards,
Jake
--
This message and any attachments are intended only for the use of the
addressee and may contain information that is privileged and
confidential.
Post by Farley, Peter x23353
If the reader of the message is not the intended recipient or an
authorized
Post by Farley, Peter x23353
representative of the intended recipient, you are hereby notified that
any
Post by Farley, Peter x23353
dissemination of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately by
e-mail and delete the message and any attachments from your system.
--
"Go about your Music citizen" - PdotDdot
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
--
OREXXMan

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Paul Gilmartin
2016-05-01 21:17:01 UTC
Permalink
Post by Hobart Spitz
There was a time when this problem would be approached by writing the
output to a dataset(s) and printing it (them) with a COND=EVEN step(s).
Today I would use a single COND=EVEN batch REXX step that would check for
the existence of each dataset (SYSDSN(dsname) = "OK"), and printing those
that exist. ("ALLOC FI(OUT) SYSOUT(c)")
How would those data sets be created?
Post by Hobart Spitz
Possibly there is a need for some kind of integration between JES spool and
the dataset name space. This might be an opportunity for a new product,
even tho it would probably be priced out of the reach of some sites. I
have used the JES command interface, and it was worse than more
conventional approaches.
OS/360 used to work that way (FSVO "work") prior to the development of JES.
I understand it faltered on selection of data set attributes, particularly
SPACE. Nowadays, a similar JES interface to the UNIX filesystem would be
invaluable.
Post by Hobart Spitz
That said, having used either CMS Pipes or TSO PIpes for much of the last
20 years, I find these efforts to be a case for using REXX in batch and/or
for using TSO Pipes. They would greatly simplify the process.
The (fairly new) SDSF API to Rexx is excellent for this purpose. It
allocates a DDNAME to each spool data set and I can use IEBGENER to copy
that to a UNIX file, indexed by job step, DDNAME, and DSID. PDSes would
be an alternative, much less attractive for lack of hierarchial name space
and difficulty of accommodating unlike spool file attributes.

I can do this under UNIX shell, TSO READY prompt, or as an ISPF Edit macro.
I haven't tried IRXJCL; I have no reason to suspect it wouldn't work.
Post by Hobart Spitz
2. Check to see if you have Pipes: [tso] pipe query . Every temporary
dataset is an opportunity to simplify a batch job and make it run faster to
boot.
If you have z/OS, you certainly have POSIX pipes available; no need to check.

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Loading...