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

How to delete a member in a PDS using REXX


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

New User


Joined: 14 Mar 2005
Posts: 15

PostPosted: Thu Jun 19, 2008 2:33 pm
Reply with quote

Hi,

Plz help me how to delete a member in a PDS using REXX.

Thx,
satish
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Thu Jun 19, 2008 2:39 pm
Reply with quote

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
View user's profile Send private message
satishstar
Currently Banned

New User


Joined: 14 Mar 2005
Posts: 15

PostPosted: Thu Jun 19, 2008 4:47 pm
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Jun 19, 2008 5:00 pm
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Jun 19, 2008 5:04 pm
Reply with quote

sathish,

By quotes i meant "single quotes"
Back to top
View user's profile Send private message
satishstar
Currently Banned

New User


Joined: 14 Mar 2005
Posts: 15

PostPosted: Thu Jun 19, 2008 5:22 pm
Reply with quote

Thx Aaru its working,.....

icon_biggrin.gif


Thx,
satish
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Jun 19, 2008 6:40 pm
Reply with quote

sathish,

You are welcome :D
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Jun 19, 2008 6:42 pm
Reply with quote

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
View user's profile Send private message
satishstar
Currently Banned

New User


Joined: 14 Mar 2005
Posts: 15

PostPosted: Thu Jun 19, 2008 8:38 pm
Reply with quote

its for copying from one member to other n then deleting it....

Thx,
satish
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Thu Jun 19, 2008 9:44 pm
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Jun 20, 2008 12:32 am
Reply with quote

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
View user's profile Send private message
satishstar
Currently Banned

New User


Joined: 14 Mar 2005
Posts: 15

PostPosted: Fri Jun 20, 2008 12:42 pm
Reply with quote

Thx for the same, i changed it at that time... anyways thx for ur support...

Bye,
satish
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Jun 20, 2008 2:58 pm
Reply with quote

sathish,

Good that you changed it.
Back to top
View user's profile Send private message
nirmalya sengupta

New User


Joined: 28 May 2007
Posts: 5
Location: kolkata

PostPosted: Sat Jun 21, 2008 4:13 pm
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Sun Jun 22, 2008 5:47 am
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sun Jun 22, 2008 2:46 pm
Reply with quote

LMCOPY / LMMOVE are good tools for this type of operation
Back to top
View user's profile Send private message
satishstar
Currently Banned

New User


Joined: 14 Mar 2005
Posts: 15

PostPosted: Tue Jun 24, 2008 8:24 pm
Reply with quote

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
View user's profile Send private message
satishstar
Currently Banned

New User


Joined: 14 Mar 2005
Posts: 15

PostPosted: Tue Jun 24, 2008 8:25 pm
Reply with quote

Plz show me with an example of how to use TSO COPY
Back to top
View user's profile Send private message
satishstar
Currently Banned

New User


Joined: 14 Mar 2005
Posts: 15

PostPosted: Tue Jun 24, 2008 8:27 pm
Reply with quote

Hi expat

plz show me with some examples of how to use LMCOPY and LMMOVE
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jun 25, 2008 12:59 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Wed Jun 25, 2008 9:17 pm
Reply with quote

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
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 Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts DELETE SPUFI DB2 1
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts DSNTIAUL driven delete IBM Tools 0
Search our Forums:

Back to Top