View previous topic :: View next topic
|
Author |
Message |
satishstar Currently Banned New User
Joined: 14 Mar 2005 Posts: 15
|
|
|
|
Hi,
Plz help me how to delete a member in a PDS using REXX.
Thx,
satish |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
there are many alternatives !
but if You post a bit more You might get better answers
quick and dirty "Address TSO DELETE 'pds_name(member)'
but probably thats not what You want |
|
Back to top |
|
|
satishstar Currently Banned New User
Joined: 14 Mar 2005 Posts: 15
|
|
|
|
Code for copying from one member to other n deleting the first PDS member :-
/*REXX*/
Z = 1
TRACE R
ADDRESS TSO
SAY 'ENTER THE INPUT PDS NAME'
PULL INPDS
"ALLOC DA('"INPDS"') F(INDD4) SHR REUSE"
"EXECIO * DISKR INDD4 (STEM IFILE."
SAY 'ENTER THE OUTPUT PDS NAME'
PULL OUTPDS
"ALLOC DA('"OUTPDS"') F(OUTDD4) SHR REUSE"
"EXECIO * DISKW OUTDD4 (STEM OUT. FINIS"
DO I = 1 TO IFILE.0
OUT.Z = IFILE.I
Z = Z+1
ADDRESS TSO DELETE INPDS
EXIT
Input and Ouput given as :-
INPDS :- ATID.DSXK.MEM.TEST1(member1)
OUTPDS :- ATID.DSXK.MEM.TEST2(member1)
Error :-
21 *-* ADDRESS TSO DELETE INPDS
>>> "DELETE ATID.DSXK.MEM.TEST1(MEMBER1)"
IDC3901I ERROR QUALIFYING SXK0000.ATID.DSXK.MEM.TEST1
IDC3902I ** DEFAULT SERVICE ROUTINE ERROR CODE 20, LOCATE ERROR CODE 8
IDC0548I ** MEMBER MEMBER1 NOT DELETED
IDC0014I LASTCC=8
+++ RC(8) +++
23 *-* EXIT
The problem here is when deleting its taking my ID as prefix n not able to find the PDS for the same like :- SXK0000.ATID.DSXK.MEM.TEST1
But the actual PDS member name to be deleted is :-
ATID.DSXK.MEM.TEST1 .
Since my id is :- SXK0000
its taking prefix as :- SXK0000.ATID.DSXK.MEM.TEST1
Plz help me out in this.
Thx,
satish |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
sathish,
Quote: |
IDC3901I ERROR QUALIFYING SXK0000.ATID.DSXK.MEM.TEST1
|
One way to fix this is while inputing data, give the input pds name in quotes. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
sathish,
By quotes i meant "single quotes" |
|
Back to top |
|
|
satishstar Currently Banned New User
Joined: 14 Mar 2005 Posts: 15
|
|
|
|
Thx Aaru its working,.....
Thx,
satish |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
sathish,
You are welcome :D |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
sathish,
What is the need for the below statements when Your reqt is for deleting a member ina PDS
Code: |
SAY 'ENTER THE OUTPUT PDS NAME'
PULL OUTPDS
"ALLOC DA('"OUTPDS"') F(OUTDD4) SHR REUSE"
"EXECIO * DISKW OUTDD4 (STEM OUT. FINIS"
DO I = 1 TO IFILE.0
OUT.Z = IFILE.I
Z = Z+1 |
I don't think it is needed. |
|
Back to top |
|
|
satishstar Currently Banned New User
Joined: 14 Mar 2005 Posts: 15
|
|
|
|
its for copying from one member to other n then deleting it....
Thx,
satish |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2546 Location: Silicon Valley
|
|
|
|
FYI. your original program is messed up.
It will notcopy then delete. I believe your OUTPDS will be empty becuase the OUT. stem is no data at the time you do your EXECIO. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
sathish,
Quote: |
its for copying from one member to other n then deleting it.... |
Nope, you are wrong. You have used the execio write command before populating the stem variable. So your output file would be empty.
For your reqt you can use the TSO copy command. |
|
Back to top |
|
|
satishstar Currently Banned New User
Joined: 14 Mar 2005 Posts: 15
|
|
|
|
Thx for the same, i changed it at that time... anyways thx for ur support...
Bye,
satish |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
sathish,
Good that you changed it. |
|
Back to top |
|
|
nirmalya sengupta
New User
Joined: 28 May 2007 Posts: 5 Location: kolkata
|
|
|
|
But if i am not wrong, I think the best way to perform this operation, the best way should be use the same stem variable. That will reduce the requirement of copy the data and will minimize the CPU time.
The code may be like ...
Code: |
/**rexx**/
address tso
say 'Enter input dataset'
pull indsn
say 'Enter output dataset'
pull outdsn
"ALLOC DA('"indsn"') F(INDD) SHR REUSE"
"EXECIO * DISKR INDD (STEM LINE. FINIS"
"ALLOC DA('"outdsn"') F(OUTDD) SHR REUSE"
"EXECIO * DISKW OUTDD (STEM LINE. FINIS"
ADDRESS TSO DELETE indsn
EXIT |
Please correct if i am wrong. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
nirmalya,
As mentioned in my previous post, if TSO COPY command can be used to copy members from one pds to another then there wont be a need to read from input using stem and write to an output. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
LMCOPY / LMMOVE are good tools for this type of operation |
|
Back to top |
|
|
satishstar Currently Banned New User
Joined: 14 Mar 2005 Posts: 15
|
|
|
|
Hi Aaru,
Plz show me with an example of how to use TSO COPY .... to copy from one PDS to another....
Thx,
satish |
|
Back to top |
|
|
satishstar Currently Banned New User
Joined: 14 Mar 2005 Posts: 15
|
|
|
|
Plz show me with an example of how to use TSO COPY |
|
Back to top |
|
|
satishstar Currently Banned New User
Joined: 14 Mar 2005 Posts: 15
|
|
|
|
Hi expat
plz show me with some examples of how to use LMCOPY and LMMOVE |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
satishstar wrote: |
Hi expat
plz show me with some examples of how to use LMCOPY and LMMOVE |
Unfortunately I do not yet have an email at my new job, so can not cut and paste an example until I can mail it to myself here, so I guess that you will have to do the same thing that I done to get this working, and that is RTFM. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2546 Location: Silicon Valley
|
|
|
|
Please read the ISPF Services Guide for details of the LMCOPY, LMINIT and LMFREE services. LMMOVE is similar.
Code: |
/* REXX */
Address ISPEXEC
"LMINIT DATAID(from1) DATASET(temp.load) ENQ(SHR)"
"LMINIT DATAID(to1) DATASET(LOAD.LIST) ENQ(SHR)"
"LMCOPY FROMID("from1") FROMMEM(mymembr) TODATAID("to1") REPLACE"
"LMFREE DATAID("from1")"
"LMFREE DATAID("to1")" |
|
|
Back to top |
|
|
|