Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Rexx Tool Needed to delete N number of dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
shrivatsa

Active User


Joined: 17 Mar 2006
Posts: 159
Location: Pune

PostPosted: Fri Mar 24, 2006 10:39 pm    Post subject: Rexx Tool Needed to delete N number of dataset
Reply with quote

Hi All,

Can anyone give me a rexx tool to delete N number of dataset of type in a single shot.

abc122b.xyzt.a765
abc122b.xyzt.b765
abc122b.xyzt.c765

abc122b.xyzt.a785
abc122b.xyzt.b785
abc122b.xyzt.c785

abc122b.xyzt.a795
abc122b.xyzt.b795
abc122b.xyzt.c795

Thanks

Shri
Back to top
View user's profile Send private message
References
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 3316
Location: Charlotte,NC USA

PostPosted: Fri Mar 24, 2006 10:47 pm    Post subject: Re: Rexx Tool Needed to delete N number of dataset
Reply with quote

Where will the list of dataset names come from? Are you just looking to process the results of a LISCAT command?
Back to top
View user's profile Send private message
shrivatsa

Active User


Joined: 17 Mar 2006
Posts: 159
Location: Pune

PostPosted: Fri Mar 24, 2006 10:50 pm    Post subject:
Reply with quote

Hi,

I am just doing testing of some programs.
It will create these dataset. when i am doing testing each time I have to do delete these dataset for the next time of testing.

So I need one rexx tool to delete these dataset in a single shot.

can you please give me.

Thanks
Shri
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 3316
Location: Charlotte,NC USA

PostPosted: Sat Mar 25, 2006 2:02 am    Post subject: Re: Rexx Tool Needed to delete N number of dataset
Reply with quote

Please answer my question. I'm trying to figure out why you'd want this in REXX.
Back to top
View user's profile Send private message
shrivatsa

Active User


Joined: 17 Mar 2006
Posts: 159
Location: Pune

PostPosted: Sat Mar 25, 2006 2:02 pm    Post subject: Re: Rexx Tool Needed to delete N number of dataset
Reply with quote

Hi,

I am doing testing of a Program. Each time I am running the program it will create these dataset. If my test fails, each time I am deleting these dataset by issuing D.

Not only It will create 9 dataset. it will create more. So if you give me a code sample so It will be very helpful to me.

Thanks
Shri
Back to top
View user's profile Send private message
shrivatsa

Active User


Joined: 17 Mar 2006
Posts: 159
Location: Pune

PostPosted: Sat Mar 25, 2006 2:06 pm    Post subject: Re: Rexx Tool Needed to delete N number of dataset
Reply with quote

Hi,

Yes it is the dataset when I give LISTCAT command.

Can you please give me the REXX code to delete these dataset?



Thanks
Shri
Back to top
View user's profile Send private message
mainframesguru

New User


Joined: 24 Jun 2005
Posts: 38
Location: Hyderabad

PostPosted: Mon Mar 27, 2006 3:03 pm    Post subject: Rexx Program for Deleting List of PS
Reply with quote

Hi,

This Code will do your work.....

Replace Flat File with your Flat file that have list of Datasets to be deleted.....


/* Rexx */
LINECOUNT = 0
PSDSN = "'Flat File Name'" /*Flat file has list of datasets to be deleted*/
LINE = " "
PSLIST. = " "

/*-----------------------------------*/
ADDRESS TSO "PROF NOPREF"
"ALLOCATE DDN(INPUT) DSN("PSDSN") SHR REUSE"

DO FOREVER
"EXECIO 1 DISKR INPUT"
IF RC = 02 THEN /* UNTIL END OF FILE */
DO
"EXECIO 0 DISKR INPUT(FINIS)"
"FREE F(INPUT)"
LEAVE
END
IF RC <> 0 THEN
DO
SAY "ERROR READING PSDSN FILE.RETUTN CODE: " RC
EXIT
END
PULL LINE
LINECOUNT = LINECOUNT + 1
PSLIST.LINECOUNT = STRIP(SUBWORD(LINE,1,1))
END
MAXCOUNT = LINECOUNT

/*------------------------------------*/

DO LINECOUNT = 1 TO MAXCOUNT
/*CHECK FOR VALID MEMBER NAME */
IF DATATYPE(PSLIST.LINECOUNT,SYMBOL) = 1 THEN
DO
IF SYSDSN(PSLIST.LINECOUNT) = 'OK' THEN
DO
ADDRESS TSO "DELETE "PSLIST.LINECOUNT""
END
END
END
EXIT


Regards,
Vamshi Krishna Indla
Kanbay
Back to top
View user's profile Send private message
shrivatsa

Active User


Joined: 17 Mar 2006
Posts: 159
Location: Pune

PostPosted: Mon Mar 27, 2006 4:46 pm    Post subject: Re: Rexx Tool Needed to delete N number of dataset
Reply with quote

Hi Vamshi,

Thanks for your effort its working fine.

Now I can do testing of programs without much effort.

Thanks
Shri
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1