MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Delete Multiple datasets

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
psridhar
Beginner


Joined: 16 May 2004
Posts: 68
Topics: 26

PostPosted: Tue Apr 12, 2005 7:44 am    Post subject: Delete Multiple datasets Reply with quote

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


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Tue Apr 12, 2005 7:59 am    Post subject: Reply with quote

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 - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
psridhar
Beginner


Joined: 16 May 2004
Posts: 68
Topics: 26

PostPosted: Tue Apr 12, 2005 8:14 am    Post subject: Reply with quote

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


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Tue Apr 12, 2005 8:19 am    Post subject: Reply with quote

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


Joined: 16 May 2004
Posts: 68
Topics: 26

PostPosted: Tue Apr 12, 2005 8:24 am    Post subject: Reply with quote

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


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Tue Apr 12, 2005 8:28 am    Post subject: Reply with quote

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 - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
psridhar
Beginner


Joined: 16 May 2004
Posts: 68
Topics: 26

PostPosted: Tue Apr 12, 2005 8:39 am    Post subject: Reply with quote

Hi kolusu,

Sorry for the mistake. It works fine.

Thank you very much

Sridhar P
Back to top
View user's profile Send private message
vvallaturu
Beginner


Joined: 28 Feb 2005
Posts: 8
Topics: 2
Location: Hyderabad

PostPosted: Tue Apr 19, 2005 9:27 pm    Post subject: One more REXX code to serve your purpose. Reply with quote

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
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
mkelley7
Beginner


Joined: 21 Sep 2005
Posts: 13
Topics: 1

PostPosted: Tue Jan 31, 2006 10:06 pm    Post subject: Reply with quote

Sorry, I meant thousands of datasets in the above post.
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Tue Jan 31, 2006 10:24 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group