Got it! Thanks! :-)
-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf
Of Bob Hamilton
Sent: Mon 02 Jun 2008 13:03
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] OUTPUT command in rexx exec
Google for zenuk & gdg; If you cannot find it ; i'll send a copy
On Mon, 2 Jun 2008 12:00:15 -0700
"Cruz, Robert" <***@CTB.COM> wrote:
> I have a similar need. Could you point me to the www site where you
> found the code?
>
> -----Original Message-----
> From: TSO REXX Discussion List
> [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Hamilton, Robert L
> Sent: Fri 30 May 2008 11:06
> To: TSO-***@VM.MARIST.EDU
> Subject: Re: [TSO-REXX] OUTPUT command in rexx exec
>
> Thanks Very much for your help; The requirements for the project are
> to create one step to be put into any jcl just before any FTP step
> that will scan the sysout, find dataset names of a certain format
> (xyz.abc.jobname.) followed by anything else and check to see if they
> are empty; if they are empty AND the JOBNAME corresponds with a member
> name of a PDS copy the contents of that member into the dataset;
> otherwise do nothing...
>
> I found your code on the www and it appears to what we need.
>
> Thanks very much
>
> bobh
>
> -----Original Message-----
> From: TSO REXX Discussion List
> [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Robert Zenuk
> Sent: Friday, May 30, 2008 12:49 PM
> To: TSO-***@VM.MARIST.EDU
> Subject: Re: OUTPUT command in rexx exec
>
> As the author of the ZENUK routine, I am still not sure this is the
> best solution. This is using anti-aircraft missiles to kill
> mosquitos...
> (any Monty
> Python fans out there?)
>
> A much more straight forward approach to this is an EXEC that checks
> for records and sets an RC and using basic IF/COND logic to make good
> decisions (all suggested already). I thought I posted a working
> solution to a similar request recently. However, I did not find it in
> the archives, so here it is again.
>
> CHKMTGDG EXEC
>
> /* rexx - CHKMTGDG */
> "EXECIO 1 DISKR EMPTY (STEM REC. FINIS"
> exit RC
>
> FTP JCL to Check for an Empty GDG
>
> //jobcard...
>
//***************************************************************
> //* PROC USING CHKMTGDG
> *
>
//***************************************************************
> //CHKNFTP PROC FTPDSN=,FTPBAD=DSN.NORECS.MODEL
>
//***************************************************************
> //* IS IT EMPTY?
> *
>
//***************************************************************
> //EMPTY EXEC PGM=IKJEFT01,PARM=CHKMTGDG
> //SYSEXEC DD DSN=your.EXEC.pds,DISP=SHR
> //EMPTY DD DSN=&FTPDSN,DISP=SHR
> //SYSTSPRT DD SYSOUT=*
> //SYSTSIN DD DUMMY
>
//***************************************************************
> // IF EMPTY.RC = 0 THEN
>
//***************************************************************
> //* FILE NOT EMPTY FTP IT
> *
>
//***************************************************************
> //FTPGOOD EXEC PGM=IEFBR14
> //SEND DD DSN=&FTPDSN,DISP=SHR
>
//***************************************************************
> // ELSE
>
//***************************************************************
> //* FILE IS EMPTY, SEND THE "NO RECORDS TO SEND" FILE
> *
>
//***************************************************************
> //FTPBAD EXEC PGM=IEFBR14
> //SEND DD DSN=&FTPBAD,DISP=SHR
>
//***************************************************************
> // ENDIF
>
//***************************************************************
> // PEND
>
//***************************************************************
> //* SEQUENTIAL FILE WITH RECORDS AS INPUT
> *
>
//***************************************************************
> //NOTEMPTY EXEC CHKNFTP,FTPDSN=my.TESTZ.GDG(-1)
>
//***************************************************************
> //* EMPTY SEQUENTIAL FILE AS INPUT
> *
>
//***************************************************************
> //EMPTY EXEC CHKNFTP,FTPDSN=my.TESTZ.GDG(0)
>
>
> Replace the FTP/IEFBR14 steps with real FTP steps and use the
> //DD:SEND syntax to make your life easier.
>
> If you still insist, here is the SDSFEXT JCL and program:
>
> //jobcard...
> //SDSFEXT1 EXEC PGM=IKJEFT01,PARM='SDSFEXT'
> //SYSEXEC DD DSN=OPSROZ.EXEC,DISP=SHR
> //SYSTSPRT DD SYSOUT=*
> //SYSTSIN DD DUMMY
>
> SDSFEXT EXEC (sorry if the indentation was lost):
>
>
/*********************************************************************/
> /* REXX
> */
>
/*********************************************************************/
> /* Purpose: Extract current Job's SYSOUT using SDSF */
>
/*-------------------------------------------------------------------*/
> /* Syntax: SDSFEXT sysoutdd
> */
>
/*-------------------------------------------------------------------*/
> /* Parms: sysoutdd - The Sysout DD to extract
> */
> /*
>
> */
> /* Notes: Return Codes
> */
> /* 00 Everything worked output should be in
> ISFEXT DSN
> */
> /* 08 Jobname is missing
> */
> /* 10 Allocation error on ISFIN
> */
> /* 11 Allocation error on ISFEXT
> */
> /* 12 Allocation error on ISFOUT
> */
> /* 16 EXECIO error loading ISFIN
> */
> /* ?? Anything else is probably from SDSF
> */
> /*
>
> */
> /* Extract DSN will be userid.SDSF.OUTPUT.jobname if
> ISFEXT DD is */
> /* not pre-allocated (possibly for size reasons) */
> /*
>
> */
> /* Sample JCL
> */
> /*
>
> */
> /* //SDSFEXT EXEC PGM=IKJEFT01,PARM='SDSFEXT JESYSMSG'
> */
> /* //SYSEXEC DD DSN=your.exec.pds,DISP=SHR
> */
> /* //SYSTSPRT DD SYSOUT=*
> */
> /* //SYSTSIN DD DUMMY
> */
> /*
>
> */
>
/*********************************************************************/
> /* Change Log
> */
> /*
>
> */
> /* Author Date Reason
> */
> /* -------- ---------
> ----------------------------------------- */
> /* R. Zenuk Dec 2003 Initial Creation
> */
> /* R. Zenuk 05/30/08 Optional SYSOUT DD
> */
> /*
>
> */
>
/*********************************************************************/
> /* Accept input parameters
> */
>
/*********************************************************************/
> arg sysoutdd .
> parse source execenv . execname . execdsn .
>
/*********************************************************************/
> /* Find Jobname and jobnum
> */
>
/*********************************************************************/
> jobname = mvsvar('SYMDEF',JOBNAME)
> tcb = storage(21c,4)
> tiot = storage(d2x(c2d(tcb)+12),4)
> jscb = storage(d2x(c2d(tcb)+180),4)
> ssib = storage(d2x(c2d(jscb)+316),4)
> jobnum = storage(d2x(c2d(ssib)+12),8)
>
/*********************************************************************/
> /* ISFIN is the DDNAME to hold the formatted SDSF commands */
>
/*********************************************************************/
> EXITRC = listdsi("ISFIN" "FILE")
> if EXITRC <> 0 then
> do
> "ALLOC F(ISFIN) UNIT(VIO) SPACE(1) TRACKS NEW LRECL(80)"
> if RC <> 0 then exit(10)
> end
>
/*********************************************************************/
> /* ISFEXT is the DDNAME to hold the extract SYSOUT dataset */
>
/*********************************************************************/
> EXITRC = listdsi("ISFEXT" "FILE")
> if EXITRC <> 0 then
> do
> sdsfdsn = "'"userid()".SDSF.OUTPUT."jobname"'"
> if sysdsn(sdsfdsn) = 'OK' then "DELETE" sdsfdsn "ALLOC
> F(ISFEXT)
> DA("sdsfdsn") NEW CATALOG SPACE(10 1) CYLINDERS",
> "LRECL(133) BLKSIZE(137) RECFM(V B A) UNIT(SYSDA)"
> if RC <> 0 then exit(11)
> end
>
/*********************************************************************/
> /* ISFOUT is the DDNAME to hold the SDSF Output */
>
/*********************************************************************/
> EXITRC = listdsi("ISFOUT" "FILE")
> if EXITRC <> 0 then
> do
> "ALLOC F(ISFOUT) SYSOUT(Z)"
> if RC <> 0 then exit(12)
> end
>
/*********************************************************************/
> /* Build ISFIN input
> */
>
/*********************************************************************/
> if sysoutdd = '' then
> do
>
/*********************************************************************/
> /* Entire Output
> */
>
/*********************************************************************/
> isfin.1 = 'PREFIX' jobname
> isfin.2 = 'DA'
> isfin.3 = 'SELECT' jobname jobnum
> isfin.4 = 'FIND' jobname
> isfin.5 = '++S'
> isfin.6 = 'PRINT FILE ISFEXT'
> isfin.7 = 'PRINT 1 99999999'
> isfin.8 = 'PRINT CLOSE'
> end
> else
> do
>
/*********************************************************************/
> /* Specfic SYSOUT
> */
>
/*********************************************************************/
> isfin.1 = 'PREFIX' jobname
> isfin.2 = 'DA'
> isfin.3 = 'SELECT' jobname jobnum
> isfin.4 = 'FIND' jobname
> isfin.5 = '++?'
> isfin.6 = 'FIND' sysoutdd
> isfin.7 = '++S'
> isfin.8 = 'PRINT FILE ISFEXT'
> isfin.9 = 'PRINT 1 99999999'
> isfin.10 = 'PRINT CLOSE'
> end
> "EXECIO * DISKW ISFIN (STEM ISFIN. FINIS"
> if RC <> 0 then exit(16)
>
/*********************************************************************/
> /* Invoke SDSF (set default depth and width values) */
>
/*********************************************************************/
> depth = 200
> width = 132
> address ATTCHMVS "SDSF depth width"
> EXITRC = RC
> "FREE F(ISFEXT ISFIN ISFOUT)"
>
/*********************************************************************/
> /* Process the ISFEXT output
> */
>
/*********************************************************************/
> "ALLOC F(ISFEXT) DA("sdsfdsn") SHR REUSE"
> "EXECIO * DISKR ISFEXT (STEM ISFEXT. FINIS"
> do i=1 to isfext.0
>
/*********************************************************************/
> /* Insert your processing here
> */
>
/*********************************************************************/
> say isfext.i
> end
>
/*********************************************************************/
> /* Exit
> */
>
/*********************************************************************/
> shutdown: exit(EXITRC)
>
>
>
>
>
>
> Rob
>
>
>
>
> In a message dated 5/30/2008 6:02:06 A.M. US Mountain Standard Time,
> ***@UTDALLAS.EDU writes:
>
> This entire thread is my fault. OUTPUT works only for JOBNAMEs that
> start with your USERID.
>
> I'm sure I can use the ZENUK routine to get what I need.
>
> Thanx to all
>
> bobh
>
>
>
----------------------------------------------------------------------
> For TSO-REXX subscribe / signoff / archive access instructions, send
> email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
>
>
>
>
> **************Get trade secrets for amazing burgers.
> Watch "Cooking with
> Tyler Florence" on AOL Food.
>
(http://food.aol.com/tyler-florence?video=4&?NCID=aolfod00030000000002)
>
>
----------------------------------------------------------------------
> 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
> --------------------------------------------------------
>
> The information contained in this message is intended
> only for the recipient, and may be a confidential
> attorney-client communication or may otherwise be
> privileged and confidential and protected from
> disclosure. If the reader of this message is not the
> intended recipient, or an employee or agent responsible
> for delivering this message to the intended recipient,
> please be aware that any dissemination or copying of this
> communication is strictly prohibited. If you have
> received this communication in error, please immediately
> notify us by replying to the message and deleting it from
> your computer. The McGraw-Hill Companies, Inc. reserves
> the right, subject to applicable local law, to monitor
> and review the content of any electronic message or
> information sent to or from McGraw-Hill employee e-mail
> addresses without informing the sender or recipient of
> the message.
> --------------------------------------------------------
>
>
----------------------------------------------------------------------
> 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
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX