Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: REXX pgm for reading VSAM files...

50 views
Skip to first unread message

Robert Zenuk

unread,
Jul 3, 2004, 11:43:17 AM7/3/04
to
In a message dated 7/2/2004 1:37:29 PM US Mountain Standard Time,
JSchwa...@UNITRIN.COM writes:
Just think about how you would copy the records to a flat file in
a batch JCL stream; you can allocate any needed support files, write
your control records to a temporary SYSIN file and execute
the utility with: ADDRESS LINKMVS "IDCAMS".
If it is just a single REPRO statement, you can execute it inline (but you
might want to outtrap the SYSPRINT messages).

<snipet>
address TSO "ALLOC F(IN) DA('MY.VSAM.CLUSTER') SHR"
address TSO "ALLOC F(OUT) DA('MY.SEQ.OUTPUT') NEW CATALOG ....
call outtrap 'sysprint.'
address TSO "REPRO INFILE(IN) OUTFILE(OUT) FROMKEY(AAA) TOKEY(BBB)"
call outtrap 'off'
</snipet>

All IDCAMS commands are valid TSO commands. If you need multiple
noncontiguous keyranges, you would need the SYSIN approach.

<snipet>
address TSO "ALLOC F(SYSIN) .....
address TSO "ALLOC F(SYSPRINT) ...
address TSO "ALLOC F(IN) DA('MY.VSAM.CLUSTER') SHR"
address TSO "ALLOC F(OUT) DA('MY.SEQ.OUTPUT') NEW CATALOG ....
sysin.1 = "REPRO INFILE(IN) OUTFILE(OUT) FROMKEY(AAA) TOKEY(AZZ)"
sysin.2 = "REPRO INFILE(IN) OUTFILE(OUT) FROMKEY(FAA) TOKEY(FZZ)"
sysin.3 = "REPRO INFILE(IN) OUTFILE(OUT) FROMKEY(KAA) TOKEY(KZZ)"
address TSO "EXECIO * DISKW SYSIN (STEM SYSIN. FINIS"
address ATTCHMVS "IDCAMS"
if RC <> 0 then say 'IDCAMS Error, RC='RC
</snipet>

My personal preference is ATTCHMVS over LINKMVS (but both work). I once had
a bad experience with abends using LINKMVS with SDSF (it was maintenance
related), but ATTCHMVS seems to cushion you from some of those things.

Hope This Helps,

Rob

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

0 new messages