|
|
| Author |
Message |
shrivatsa
Active User
Joined: 17 Mar 2006 Posts: 159 Location: Pune
|
|
|
|
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 |
|
 |
References
|
|
 |
superk
Moderator Team Head
Joined: 26 Apr 2004 Posts: 3303 Location: Charlotte,NC USA
|
|
|
|
| Where will the list of dataset names come from? Are you just looking to process the results of a LISCAT command? |
|
| Back to top |
|
 |
shrivatsa
Active User
Joined: 17 Mar 2006 Posts: 159 Location: Pune
|
|
|
|
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 |
|
 |
superk
Moderator Team Head
Joined: 26 Apr 2004 Posts: 3303 Location: Charlotte,NC USA
|
|
|
|
| Please answer my question. I'm trying to figure out why you'd want this in REXX. |
|
| Back to top |
|
 |
shrivatsa
Active User
Joined: 17 Mar 2006 Posts: 159 Location: Pune
|
|
|
|
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 |
|
 |
shrivatsa
Active User
Joined: 17 Mar 2006 Posts: 159 Location: Pune
|
|
|
|
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 |
|
 |
mainframesguru
New User
Joined: 24 Jun 2005 Posts: 38 Location: Hyderabad
|
|
|
|
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 |
|
 |
shrivatsa
Active User
Joined: 17 Mar 2006 Posts: 159 Location: Pune
|
|
|
|
Hi Vamshi,
Thanks for your effort its working fine.
Now I can do testing of programs without much effort.
Thanks
Shri |
|
| Back to top |
|
 |
|
|