View previous topic :: View next topic |
Author |
Message |
psridhar Beginner
Joined: 16 May 2004 Posts: 68 Topics: 26
|
Posted: Tue Apr 12, 2005 7:44 am Post subject: Delete Multiple datasets |
|
|
Hi
Can anybody help me in deleting multiple datasets through REXX. My requirement is as follows.
I will be having datasets like
APPCOM.MFA.FILE1
APPCOM.MFA.FILE2
APPCOM.MFA.FILE3
APPCOM.MFA.FILE4 etc...
My input to the REXX tool will be APPCOM.MFA.*
Then it should delete all the above datasets. Is it possible by REXX. If so, please help me.
Thanks in advance
Sridhar P |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
|
Posted: Tue Apr 12, 2005 7:59 am Post subject: |
|
|
Sridhar,
You can use ADRDSSU utility to delete the datasets. Here is a sample JCL.
Code: |
//STEP0100 EXEC PGM=ADRDSSU
//SYSPRINT DD SYSOUT=*
//PSEUDO DD DUMMY
//SYSIN DD *
DUMP /* COMMAND DUMP */ -
DS(INCL(APPCOM.MFA.**)) /* INCLUDE ALL DSN WITH HLQ */ -
OUTDD(PSEUDO) /* OUT DD NAME */ -
DELETE /* DELETE ALL THE DATASETS */
/*
|
Hope this helps...
Cheers
kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
psridhar Beginner
Joined: 16 May 2004 Posts: 68 Topics: 26
|
Posted: Tue Apr 12, 2005 8:14 am Post subject: |
|
|
Hi Kolusu
Thanks for the reply. But I am getting the following dump with return code 8. It it not possible through REXX commands. Just with curiosity, I am asking.
Code: | PAGE 0001 5695-DF175 DFSMSDSS V1R06.0 DATA SET SERVICES 2005.102 15:10
DUMP /* COMMAND DUMP */ -
DS(INCL('UPLSTCS.BPS.**') /* INCLUDE ALL DSN WITH HLQ */ -
OUTDD(PSEUDO) /* OUT DD NAME */ -
DELETE /* DELETE ALL THE DATASETS */
ADR101I (R/I)-RI01 (01), TASKID 001 HAS BEEN ASSIGNED TO COMMAND 'DUMP '
ADR109I (R/I)-RI01 (01), 2005.102 15:10:29 INITIAL SCAN OF USER CONTROL STATEMENTS COMPLETED.
ADR129E (001)-RI01 (01), KEYWORD 'OUTDD ' IS IMPROPER
ADR131E (001)-RI03 (01), ABOVE TEXT BYPASSED UNTIL NEXT COMMAND
ADR017E (001)-CLTSK(01), 2005.102 15:10:29 TASK NOT SCHEDULED DUE TO ERROR. TASK RETURN CODE 0008
ADR012I (SCH)-DSSU (01), 2005.102 15:10:29 DFSMSDSS PROCESSING COMPLETE. HIGHEST RETURN CODE IS 0008 FROM:
SYNTAX |
|
|
Back to top |
|
|
superk Advanced
Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Tue Apr 12, 2005 8:19 am Post subject: |
|
|
Since this was posted to the TSO and ISPF forum, I worked out this solution using ISPF Library Management services:
Code: |
/* REXX */
"ISPEXEC LMDINIT LISTID(listid) LEVEL(APPCOM.MFA.*)"
Do Forever
"ISPEXEC LMDLIST LISTID(&listid) OPTION(LIST) DATASET(dsn)"
If rc <> 0 Then Leave
Else
Do
Say "Erasing:'"dsn"'"
"ISPEXEC LMERASE DATASET('"dsn"')"
End
End
"ISPEXEC LMDFREE LISTID(&listid)"
|
|
|
Back to top |
|
|
psridhar Beginner
Joined: 16 May 2004 Posts: 68 Topics: 26
|
Posted: Tue Apr 12, 2005 8:24 am Post subject: |
|
|
Hi Kolusu,
Thats really great. The REXX code worked fine in my shop. Thank you very much.
I searched for the error code "ADR129E" that my JCL returned but could not able to solve it. Any clue please.........
Regards
Sridhar P |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
|
Posted: Tue Apr 12, 2005 8:28 am Post subject: |
|
|
psridhar,
You are missing a closing parenthsis on the DS control card.
you have
Code: |
DS(INCL('UPLSTCS.BPS.**')
|
it should be
Quote: |
DS(INCL('UPLSTCS.BPS.**'))
|
Note the ) in bold at the end
Correct that and re-run your job. It should run fine.
Hope this helps...
Cheers
kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
psridhar Beginner
Joined: 16 May 2004 Posts: 68 Topics: 26
|
Posted: Tue Apr 12, 2005 8:39 am Post subject: |
|
|
Hi kolusu,
Sorry for the mistake. It works fine.
Thank you very much
Sridhar P |
|
Back to top |
|
|
vvallaturu Beginner
Joined: 28 Feb 2005 Posts: 8 Topics: 2 Location: Hyderabad
|
Posted: Tue Apr 19, 2005 9:27 pm Post subject: One more REXX code to serve your purpose. |
|
|
Code: |
/* Rexx */
Say "This exec deletes the datasets, as required by the user"
Say "Enter the level of the datasets which are to be deleted"
Parse Pull level
X = Outtrap("stem1.")
Address Tso "Listc lvl("level")"
J=0
Do I=1 To Stem1.0
J=J+1
Parse Var Stem1.I First Rest
If First="IN-CAT" Then Do
J=J-1
Iterate
End
Parse Var Rest Rest1 Rest2.J ''
/* Address Tso "Delete" "'"||Rest2||"'" "Scratch" */
End
Say "Following datasets will be deleted. Press 'y' to confirm and",
"any other key to continue"
Do I=1 To J
Say Rest2.I
End
Parse Pull Option
K=0
If option='y' Then
Do I=0 To J
Address Tso "Delete" "'"||Rest2.I||"'" "Scratch"
K=K+1
End
If K=3 Then
Say 'The datasets are deleted'
If K<3 & K>0 Then
Say 'All the datasets in the above list are not deleted'
If K=0 Then
Say 'The datsets are not deleted'
Exit
|
_________________ Thank you.
Venkata Krishna
MVS system programmer |
|
Back to top |
|
|
mkelley7 Beginner
Joined: 21 Sep 2005 Posts: 13 Topics: 1
|
Posted: Tue Jan 31, 2006 10:06 pm Post subject: |
|
|
Sorry, I meant thousands of datasets in the above post. |
|
Back to top |
|
|
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Tue Jan 31, 2006 10:24 pm Post subject: |
|
|
Run hdelete first? Or if these are all dasd data sets run listdsi with norecall and call the appropriate delete routine. (not tested - just posting a thought, really) |
|
Back to top |
|
|
|
|