View previous topic :: View next topic
|
Author |
Message |
smilingashutosh
New User
Joined: 08 Jun 2006 Posts: 22
|
|
|
|
Hi all,
i m trying a rexx program which will cut the data form pds1(mem1) and then paste it to another pds2(mem2). mem2 is new member and pds2 is already created.
i m using this, anybody tell what wrong with this?
Code: |
/* REXX */
ADDRESS ISREDIT "MACRO"
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"
X = SYSDSN("'NBK7VYS.MYBACK.FILE'")
IF X = 'OK' THEN
DO
ADDRESS ISREDIT "CUT .ZF .ZL"
ADDRESS ISREDIT "EDIT 'NBK7VYS.MYBACK1.FILE(DD)' "
ADDRESS ISREDIT "PASTE AFTER .ZF"
ADDRESS ISREDIT "SAVE"
EXIT
END
|
|
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
1. ISREDIT "CUT .ZF .ZL".
According to the manual, that should be ISREDIT "CUT .ZFIRST .ZLAST". Of course, you could just use CUT ALL.
2. ISREDIT "EDIT 'NBK7VYS.MYBACK1.FILE(DD)' ".
This is the wrong format of the EDIT command. The format is EDIT member. It cannot be another dataset. I think you want to instead launch an ISPEXEC EDIT ... session for the other dataset. |
|
Back to top |
|
|
smilingashutosh
New User
Joined: 08 Jun 2006 Posts: 22
|
|
|
|
yes i want to do the same ..i m new to rexx..can you suggest the command syntax to do the same |
|
Back to top |
|
|
TizMe
New User
Joined: 05 Jan 2006 Posts: 72
|
|
|
|
Code: |
Address ISPEXEC
'LMINIT DATAID(INDD) DATASET('''dsin''') ENQ(SHR)'
'LMINIT DATAID(OUTDD) DATASET('''dsout''') ENQ(SHRW)'
'LMCOPY FROMID('INDD') TODATAID('OUTDD') FROMMEM('mbrin')
TOMEM('mbrout') REPLACE'
if rc?=0 then do
say 'failed to copy'
leave
end
|
|
|
Back to top |
|
|
|