Page 1 of 2

copy of PDS member to user PDS libary

PostPosted: Thu Jun 04, 2009 1:20 am
by JRIVERA
Im new to REXX and from what i have read I can OPEN, COPY and EDIT A PDS member but to my libary. What im trying to do is have a user click pick a option in ISPF panel and have it copy a pds member to there personal pds libary this is the code i have

/*REXX*/
ADDRESS ISPEXEC
"LMINIT DATAID(INDD1) DATASET('CRM.CRM1JAR.PDSTEST')"
SAY INDD1
"LMINIT DATAID(OUTDD1) DATASET('CRM.CRM1JAR.PDSTEST')"
SAY OUTDD1

"LMCOPY FROMID("INDD1") TODATAID("OUTDD1")
FROMMEM(ASYSNEWK) TOMEM(ASYSNEW1) REPLACE PACK"
SAY COPIED

"LMFREE DATAID("INDD1")"
SAY FREE INDD1
"LMFREE DATAID("OUTDD1")"
SAY FREE OUTDD1

ADDRESS ISPEXEC
"EDIT DATASET('CRM.CRM1JAR.PDSTEST(ASYSNEW1)')"

Re: copy of PDS member to user PDS libary using REXX

PostPosted: Thu Jun 04, 2009 1:31 am
by dick scherrer
Hello and welcome to the forum,

What happens when you run this?

Re: copy of PDS member to user PDS libary using REXX

PostPosted: Thu Jun 04, 2009 1:37 am
by JRIVERA
thank you

when i run this it makes a copy of a pds member, renames the member and opens it in edit mode

Re: copy of PDS member to user PDS libary using REXX

PostPosted: Thu Jun 04, 2009 2:02 am
by JRIVERA
want i want to do is when the user picks that option to copy the pds to there personal libary

Re: copy of PDS member to user PDS libary using REXX

PostPosted: Thu Jun 04, 2009 2:26 am
by dick scherrer
Hello,

want i want to do is when the user picks that option to copy the pds to there personal libary
The entire pds or just some member(s)?

If you want to copy the entire pds, suggest you dynamically create the jcl and copy in batch.

Re: copy of PDS member to user PDS libary using REXX

PostPosted: Thu Jun 04, 2009 2:36 am
by JRIVERA
no i just want to copy a member which i can do now in REXX but how can I copy the member to user's personal libary. I was reading something about ZUSER to identify the user and then maybe put it in there libary.

thanks for your sugestions

Re: copy of PDS member to user PDS libary using REXX

PostPosted: Thu Jun 04, 2009 2:50 am
by dick scherrer
Hello,

What happens if you point the outdd1 at some "other" pds - try hard-coding one of your own test datasets.

One thing that would make this difficult on some of the systems i've supported is that personal datasets might not start with the userid. . . Site naming conventions often dictate "standard" dataset names. System generated datasets (i.e. userid.SRCHFOR.LIST) might have userid as the first node, but not others.

You can get the userid using VUSER, but what if not all users have the same-style named pds?

Re: copy of PDS member to user PDS libary using REXX

PostPosted: Thu Jun 04, 2009 3:08 am
by JRIVERA
ok im going to read up om VUSER

when i hard code it works just fine. doenst really matter what the naming convention will be just need it created on there id. the user will not even know its in there libary and once they are done editing the data and it is saved back to original member i will delete it.

Re: copy of PDS member to user PDS libary using REXX

PostPosted: Thu Jun 04, 2009 3:14 am
by JRIVERA
we have strick naming conventions but how about creating another copy in the original libary but have the rexx code dynamically create mutiple copies with diffrent names. like newwkld1, newwkld2, newwkld3 how would i go about doing that.

Re: copy of PDS member to user PDS libary

PostPosted: Thu Jun 04, 2009 5:45 am
by dick scherrer
Hello,

I don't believe you want multiple "shadow" copies for different users in the original library. Managing these could be quite problematic.

I'm not really clear on why duplicate members are needed only to be discarded later. The editor already works on a copy and if the changes aren't wanted, one can simply CANCEL out of editing. What purpose does another copy serve?