How to: fromdsn question about //DD: and the DSN.

Discussion of Dovetailed Technologies Dataset Pipes tools
Post Reply
john.mckown
Posts: 48
Joined: Tue Jun 12, 2007 2:46 pm

How to: fromdsn question about //DD: and the DSN.

Post by john.mckown » Tue Jul 03, 2012 12:53 pm

I've got a weird sort of need. At present, on Mondays, I take the weekly RACF IRRAUD00 (RACF audit information) and use ftp to download it to my Linux/Intel box. Once there, I use bzip2 to __greatly__ compress it (like 1000:1 compression!). I then do a binary ftp back to z/OS for long term storage on a virtual tape. This leave the compressed data on my desktop in case I want to use it again. I rather like that. So, instead of doing this "by hand", I would like to do it with a z/OS batch job. What I have come up with is:

Code: Select all

// SET GEN=G1109V00
//BZIP2    EXEC   PROC=COZPROC,ARGS='myid@desktop''
//IRRADU00 DD     DISP=OLD,DSN=hlq1.RACF.IRRADU00.&GEN
//BZIP2OUT DD     DSN=hlq2.RACF.IRRADU00.&GEN..BZ2,
//         UNIT=VTS2,
//         RECFM=U,LRECL=27998,BLKSIZE=27998,DSORG=PS,
//         LABEL=EXPDT=99000
//STDOUT   DD     SYSOUT=*
//STDERR   DD     SYSOUT=*
//CEEDUMP  DD     SYSOUT=*
//SYSOUT   DD     SYSOUT=*
//STDIN    DD     *
fromdsn //DD:IRRADU00 | \
bzip2 -v | \
todsn -b //DD:BZIP2OUT
exit
/*
What I would like to do is insert a "tee" command betwee the bzip2 and the todsn like:

Code: Select all

bzip2 -v |\
tee irradu00.&GEN..bz2 |\
todsn -b //DD:BZIP2OUT
The problem is that there is not a __simple__ way to get the &GEN in the JCL into the input stream. z/OS doesn't support expanding JCL symbols in in-stream data. What might be helpful would be some way for todsn to write the DSN of the dataset allocated to the DD: into the stderr. I would redirect todsn's stderr to a file, then parse the file to get the DSN. The "tee" command would output to a fixed file name, which I would later "mv" to the proper name after parsing the DSN from fromdsn's DD.

Is this even a possibility? Is there any way for the part of todsn which is running on the z/OS system to return the DSN? If not, I'll figure out some other way to do it. Or maybe not even keep the data on my Linux desktop, but just retrieve it if needed with a fromdsn as needed when I use it in a command on my desktop.

dovetail
Site Admin
Posts: 1848
Joined: Thu Jul 29, 2004 12:12 pm

Re: How to: fromdsn question about //DD: and the DSN.

Post by dovetail » Tue Jul 03, 2012 1:37 pm

It seems like a possibility to enhance fromdsn to write the actual DSN to stderr.

In the mean time, here is a relatively simple way to do what you want:

Code: Select all

// SET GEN=G1109V00
//SETGEN   EXEC  PGM=COZBATCH,PARM='/GEN=&GEN'
//SAVEARGS DD  DSN=&&SAVEARGS,DISP=(NEW,PASS),
//         DCB=(LRECL=80,RECFM=FB),SPACE=(TRK,(1,1))
//*
//BZIP2    EXEC   PROC=COZPROC,ARGS='myid@desktop''
//IRRADU00 DD     DISP=OLD,DSN=hlq1.RACF.IRRADU00.&GEN
//BZIP2OUT DD     DSN=hlq2.RACF.IRRADU00.&GEN..BZ2,
//         UNIT=VTS2,
//         RECFM=U,LRECL=27998,BLKSIZE=27998,DSORG=PS,
//         LABEL=EXPDT=99000
//STDOUT   DD     SYSOUT=*
//STDERR   DD     SYSOUT=*
//CEEDUMP  DD     SYSOUT=*
//SYSOUT   DD     SYSOUT=*
//STDIN    DD     DSN=&&SAVEARGS,DISP=(OLD,DELETE)
//         DD    *
fromdsn //DD:IRRADU00 | \
bzip2 -v | \
tee irradu00.$GEN.bz2 | \
todsn -b //DD:BZIP2OUT
exit
/*
(for details on how the COZBATCH SAVEARGS DD works, see: http://dovetail.com/docs/cozbatch/ref.html )

JohnMcKown
Posts: 39
Joined: Sat Nov 21, 2009 2:59 pm

Re: How to: fromdsn question about //DD: and the DSN.

Post by JohnMcKown » Tue Jul 03, 2012 7:37 pm

Many thanks! I can pass the &GEN JCL variable in via the PARM= with PARM='GEN=&GEN' and then, as you have shown, use ${GEN} in my script. Wonderful!

Post Reply