IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Selected Members from One PDS to Other


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Unique

New User


Joined: 10 Jul 2007
Posts: 24
Location: Blore

PostPosted: Mon Aug 20, 2007 4:12 pm
Reply with quote

Hi,
I am creating a small rexx routine where i am copying selected members and appending few lines at end from one PDS to other. The list of members selected is in a 3rd dataset(seq).

I am able to read the seq file , get the members . But i dont know how to copy to the next PDS. Please suggest. (i tried reading some manual but nothing pointed as i wanted).
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Mon Aug 20, 2007 4:51 pm
Reply with quote

I would go for ISPF services: LMCOPY and LMMOVE.

You can also try IEBCOPY (which should be faster).

O.
Back to top
View user's profile Send private message
Unique

New User


Joined: 10 Jul 2007
Posts: 24
Location: Blore

PostPosted: Wed Aug 22, 2007 10:51 pm
Reply with quote

Hi, This rexx code solved my req :

/*rexx */
ADDRESS TSO
Input_pds = 'xxx.JOBLIST'
"alloc da('"Input_pds"') f(infile) shr "
"execio * diskr infile (stem in. finis"
"free f(infile)"

address ispexec
'control errors return'
DSN1 = 'XXXX.DSN1'
DSN2 = 'XXXX.DSN2'
"lminit dataid(DD1) dataset('&DSN1') enq(shrw) org(po)"
"lminit dataid(DD2) dataset('&DSN2') enq(shrw) org(po)"

do i = 1 to in.0
MBR = strip(word(in.i))
"lmcopy fromid(&DD1) frommem(&MBR)",
"todataid(&DD2) tomem(&MBR) replace"
"EDIT DATAID(&DD2) MEMBER(&MBR) macro(addlst)"
"lmfree dataid(&DD1)"
"lmfree dataid(&DD2)"


ADDLST
/* Rexx */
ADDRESS ISREDIT MACRO
address isredit "COPY COMMENT AFTER .ZLAST"
ADDRESS ISREDIT "END"



Any Suggestions to improve are most welcome

Regards




do i = 1 to in.0
Do j = 2 to WORDS(in.i)
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Aug 22, 2007 11:50 pm
Reply with quote

Thank you for posting your solution icon_smile.gif

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Duplicate several members of/in one l... JCL & VSAM 7
No new posts list pds members name starting with xyz CLIST & REXX 11
No new posts REXX editmacro to compare two members... CLIST & REXX 7
No new posts Easy way to delete selected members f... IBM Tools 12
No new posts To find an array of words (sys-symbol... JCL & VSAM 9
Search our Forums:

Back to Top