<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