Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Migrated dataset deletion
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
trilokdewangan

New User


Joined: 19 Jun 2008
Posts: 39
Location: USA

PostPosted: Mon Aug 18, 2008 3:54 pm    Post subject: Migrated dataset deletion
Reply with quote

Hello,

I have some datasets like given below...and all are migrated in tape. I want to delete those dataset and count of same are more than 25,000.

Dataset are like

XXX.YYY.ZZZ.ABC
XXX.YYY.ZZZ.ASD
XXX.YYY.ZZZ.AFD
...
...
...
and so on. In summary I want to delete all detaset starts with XXX.YYY.ZZZ.*. And all are migrated in tape.

Thanks,
Trilok
Back to top
View user's profile Send private message

krithikaj

New User


Joined: 10 Aug 2008
Posts: 45
Location: India

PostPosted: Mon Aug 18, 2008 3:57 pm    Post subject:
Reply with quote

Try using IDCAMS and delete.

Regards,
KJ
Back to top
View user's profile Send private message
krithikaj

New User


Joined: 10 Aug 2008
Posts: 45
Location: India

PostPosted: Mon Aug 18, 2008 4:07 pm    Post subject:
Reply with quote

Use this JCL and check out if it helps out. I could execute it successfully.

//STEP010 EXEC PGM=IEFBR14
//DD1 DD DSN=<DATASET>,
// DISP=(MOD,DELETE,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(30,10),RLSE)
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSABOUT DD SYSOUT=*

Regards,
KJ
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Aug 18, 2008 4:22 pm    Post subject:
Reply with quote

krithikaj wrote:
Use this JCL and check out if it helps out. I could execute it successfully.

//STEP010 EXEC PGM=IEFBR14
//DD1 DD DSN=<DATASET>,
// DISP=(MOD,DELETE,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(30,10),RLSE)


Using IEFBR14 will cause the dataset to be recalled from tape before deleting it. Why waste the time and resource to physically recall the dataset when all you want to do is to delete it.

The IDCAMS solution is OK, but is limited to the use of wildcards.

CSI is a much more flexible way of using REXX, and I might have one somewhere. Will post it if I already have it.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Aug 18, 2008 4:39 pm    Post subject:
Reply with quote

The JCL - uses PARM values to select (a) What you want to do and (b) on which types of datasets.

For your first run use PARM='CSIUTIL SCAN MIGR' to get a listing of datasets that would have been deleted.

For the real run use PARM='CSIUTIL RUN MIGR' to delete the migrated datasets.

You can probably see what else it can do by reading the comments in the JCL.

EXCLUDE DD will exclude datasets from procesing, but I can not remember if it can use a prefix follwowed by * i.e. ABC.NODEL.*, but you definitely use the fully qualified DSN. Should be easy enough for you to work that one out.
Code:

//STEP0020 EXEC PGM=IKJEFT01,DYNAMNBR=256,                   
//           PARM='CSIUTIL SCAN DASD TAPE MIGR'               
//*   PARM VALUES - SCAN    - LIST ONLY                       
//*               - RUN     - PROCESS REQUESTS - DELETE OR HSM
//*               - DASD    - LIST/DELETE DASD DATASETS           
//*               - MIGR    - LIST/DELETE MIGRATED DATASETS       
//*               - TAPE    - LIST/DELETE TAPE DATASETS           
//*               - RCALL   - LIST/RECALL SELECTED DATASETS       
//*               - ARCH    - LIST/MIGRATE SELECTED DATASETS TO ML1
//*               - ARCH2   - LIST/MIGRATE SELECTED DATASETS TO ML2
//SYSEXEC  DD DSN=MY.REXX,DISP=SHR                           
//SYSOUT   DD SYSOUT=*                                       
//SYSTSPRT DD SYSOUT=*                                       
//SYSTSIN  DD DUMMY                                           
//DATASETS DD *                                               
HLQ.**
/*                                                           
//EXCLUDE  DD *                                               
HLQ.DATASET.ONE
HLQ.DATASET.NINE
/*                                                           


The REXX code - called CSIUTIL in MY.REXX
Code:

/* REXX ** INVOKE CSI VIA BATCH REXX PROCESS
        ** LIST OR DELETE ALL ENTRIES FOR GIVEN DSN PATTERNS
           ALSO TO FILTER BY DASD TAPE OR MIGR                       */
ARG RUNTYP UNIT
IF RUNTYP <> "RUN" THEN RUNTYP = "SCAN"
IF POS('MIGR',UNIT) > 0 & POS('RCALL',UNIT) > 0 THEN DO
   SAY " "
   SAY "RECALL AND HDELETE BOTH SPECIFIED FOR MIGRATED DATASETS"
   SAY "EXIT REURN CODE 16 *** EXIT RETURN CODE 16 "
   EXIT(16)
END
 "EXECIO * DISKR EXCLUDE ( STEM EXC. FINIS"
 DO A = 1 TO EXC.0
   IF POS('*',EXC.A) > 0 THEN DO
     EXCLDIT.A = STRIP(SUBSTR(EXC.A,1,POS('*',EXC.A)-1))
     GEN.A = "Y"
   END
   ELSE DO
     EXCLDIT.A = STRIP(EXC.A)
     GEN.A = "N"
   END
 END
 "EXECIO * DISKR DATASETS ( STEM CAT. FINIS"
 DO KCNT = 1 TO CAT.0               
 KEY = SUBSTR(CAT.KCNT,1,44)     
MODRSNRC = SUBSTR(' ',1,4)         
CSIFILTK = SUBSTR(KEY,1,44)   
CSICATNM = SUBSTR(' ',1,44)   
CSIRESNM = SUBSTR(' ',1,44)   
CSIDTYPS = SUBSTR(' ',1,16)
CSICLDI  = SUBSTR('Y',1,1) 
CSIRESUM = SUBSTR(' ',1,1) 
CSIS1CAT = SUBSTR(' ',1,1)
CSIRESRV = SUBSTR(' ',1,1) 
CSINUMEN = '0002'X         
CSIFLD1  = 'VOLSER  '   
CSIFLD2  = 'DEVTYP  '   
CSIOPTS  = CSICLDI !! CSIRESUM !! CSIS1CAT !! CSIRESRV
CSIFIELD = CSIFILTK !! CSICATNM !! CSIRESNM !! CSIDTYPS !! CSIOPTS
CSIFIELD = CSIFIELD !! CSINUMEN !! CSIFLD1 !! CSIFLD2
WORKLEN = 4096
DWORK = '00001000'X !! COPIES('00'X,WORKLEN-4)
RESUME = 'Y'
CATNAMET = SUBSTR(' ',1,44)
DNAMET = SUBSTR(' ',1,44)
DO WHILE RESUME = 'Y'
 ADDRESS LINKPGM 'IGGCSI00  MODRSNRC  CSIFIELD  DWORK'
 RESUME = SUBSTR(CSIFIELD,150,1)   
 USEDLEN = C2D(SUBSTR(DWORK,9,4))   
 POS1=15                           
 DO WHILE POS1 < USEDLEN           
   IF SUBSTR(DWORK,POS1+1,1) = '0' 
    THEN DO
         CATNAME=SUBSTR(DWORK,POS1+2,44)
         IF CATNAME <> CATNAMET THEN
          DO                       
           CATNAMET = CATNAME
          END
         POS1 = POS1 + 50
         END
   DNAME = SUBSTR(DWORK,POS1+2,44) 
   PRO = "Y"
   DO ZZ = 1 TO EXC.0
     EXCLDLN = LENGTH(EXCLDIT.ZZ)
     IF GEN.ZZ = "N" THEN DO
       IF STRIP(DNAME) = STRIP(EXCLDIT.ZZ) THEN PRO = "N"
     END
     ELSE DO
       IF STRIP(LEFT(DNAME,EXCLDLN)) = STRIP(EXCLDIT.ZZ) THEN PRO = "N"
     END
   END
   IF SUBSTR(DWORK,POS1+1,1) = 'C' THEN DTYPE = 'CLUSTER '
    ELSE
      IF SUBSTR(DWORK,POS1+1,1) = 'D' THEN DTYPE = 'DATA    '
     ELSE
      IF SUBSTR(DWORK,POS1+1,1) = 'I' THEN DTYPE = 'INDEX   '
     ELSE
      IF SUBSTR(DWORK,POS1+1,1) = 'A' THEN DTYPE = 'NONVSAM '
     ELSE
      IF SUBSTR(DWORK,POS1+1,1) = 'H' THEN DTYPE = 'GDS     '
     ELSE
      IF SUBSTR(DWORK,POS1+1,1) = 'B' THEN DTYPE = 'GDG     '
     ELSE
      IF SUBSTR(DWORK,POS1+1,1) = 'R' THEN DTYPE = 'PATH    '
     ELSE
      IF SUBSTR(DWORK,POS1+1,1) = 'G' THEN DTYPE = 'AIX     '
     ELSE
      IF SUBSTR(DWORK,POS1+1,1) = 'X' THEN DTYPE = 'ALIAS   '
     ELSE
      IF SUBSTR(DWORK,POS1+1,1) = 'U' THEN DTYPE = 'UCAT    '
     ELSE
      DTYPE = '        '
    POS1 = POS1 + 46
    NUMVOL = C2D(SUBSTR(DWORK,POS1+4,2))/6
    POS2 = POS1+8                   
    DO I=1 TO NUMVOL               
      VOLSER.I = SUBSTR(' ',1,6)
    END
    DO I = 1 TO NUMVOL             
      VOLSER.I = SUBSTR(DWORK,POS2,6)
      POS2 = POS2 + 6
    END
    IF NUMVOL > 1 THEN MVL = '+'
      ELSE
        MVL = ' '
    DEVTY1 = SUBSTR(DWORK,POS2,4)
    DEVTY2 = C2X(DEVTY1)
    IF SUBSTR(DEVTY2,5,2) = '20' THEN DELDEV = 'DASD'
      ELSE
        IF SUBSTR(DEVTY2,5,2) = '80' THEN DELDEV = 'TAPE'
          ELSE
            DELDEV = 'XXXX'
    IF DELDEV = 'DASD' THEN MIGLEV = ' ML1'
      ELSE
        MIGLEV = ' ML2'
    IF DNAMET <> DNAME THEN   
    DO                           
     DNAMET=DNAME
     DNAM2 = STRIP(DNAME)
     IF DTYPE = 'GDG' ! DELDEV = 'XXXX' THEN PRO = 'N'
     IF PRO = "Y" THEN DO
       IF VOLSER.1 = 'MIGRAT' THEN
         DO
          IF POS('MIGR',UNIT) > 0 ! POS('RCALL',UNIT) > 0 THEN DO
            IF RUNTYP = "RUN" THEN
            DO
              IF POS('MIGR',UNIT) > 0 THEN DO
                SAY "          HDEL FOR "DNAM2
                " HDELETE '"DNAM2"'"
              END
              ELSE IF POS('RCALL',UNIT) > 0 THEN DO
                SAY "          HRECALL FOR "DNAM2
                " HRECALL '"DNAM2"'"
              END
            END
            ELSE
              SAY COPIES(' ',8) DTYPE DNAME VOLSER.1 MVL MIGLEV
          END
         END
       ELSE IF VOLSER.1 <> 'MIGRAT' THEN
         DO
          IF DTYPE = 'CLUSTER' & POS('DASD',UNIT) > 0 THEN DO
             IF RUNTYP = "RUN" THEN DO
               " DELETE '"DNAM2"'"
             END
             ELSE
               SAY COPIES(' ',8) DTYPE DNAME VOLSER.1 MVL DELDEV
          END
          ELSE DO
          IF DELDEV = 'TAPE' & POS('TAPE',UNIT) > 0
           THEN
             DO
               IF RUNTYP = "RUN" THEN
                 DO
                    " DELETE '"DNAM2"' NOSCRATCH "
                 END
               ELSE
                 SAY COPIES(' ',8) DTYPE DNAME VOLSER.1 MVL DELDEV
            END
          IF DELDEV = 'DASD' & POS('DASD',UNIT) > 0 ,
           & VOLSER.1 <> 'MIGRAT' THEN
            DO
               IF RUNTYP = "RUN" THEN
                 DO
                    " DELETE '"DNAM2"'"
                 END
                 ELSE
                   SAY COPIES(' ',8) DTYPE DNAME VOLSER.1 MVL DELDEV
            END
          IF DELDEV = 'DASD' & POS('ARCH',UNIT) > 0 ,
           & VOLSER.1 <> 'MIGRAT' THEN
            DO
               IF SUBSTR(UNIT,POS('ARCH',UNIT)+4,1) = '2'
                 THEN ML = "ML2"
                 ELSE ML = ""
               IF RUNTYP = "RUN" THEN
                 DO
                    SAY COPIES(' ',8) DTYPE DNAME VOLSER.1 MVL DELDEV
                    " HMIG '"DNAM2"'" ML
                 END
                 ELSE
                   SAY COPIES(' ',8) DTYPE DNAME VOLSER.1 MVL DELDEV
            END
         END
       END
    END
    POS1 = POS1 + C2D(SUBSTR(DWORK,POS1,2))
  END
END
END
END
Back to top
View user's profile Send private message
saroragu

New User


Joined: 12 Nov 2008
Posts: 22
Location: india

PostPosted: Mon Feb 09, 2009 11:38 am    Post subject: Reply to: Migrated dataset deletion
Reply with quote

I have copied the code that you had send. I got an error as
IRX0408E Exec member name must not be specified when exec load DD refers to a sequential data set.
will you please tell me how to give the rexx program?.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Feb 09, 2009 3:25 pm    Post subject:
Reply with quote

Put the code into a PDS member
Back to top
View user's profile Send private message
saroragu

New User


Joined: 12 Nov 2008
Posts: 22
Location: india

PostPosted: Mon Feb 09, 2009 3:35 pm    Post subject:
Reply with quote

I put that in my working PDS its giving the same error.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Feb 09, 2009 3:43 pm    Post subject:
Reply with quote

Post the JCL and the error message(s)
Back to top
View user's profile Send private message
saroragu

New User


Joined: 12 Nov 2008
Posts: 22
Location: india

PostPosted: Mon Feb 09, 2009 3:56 pm    Post subject:
Reply with quote

Code:
//H2567AMB JOB ('DSCACCIA'),MSGCLASS=O,TIME=(,5),NOTIFY=&SYSUID       
//STEP0020 EXEC PGM=IKJEFT01,DYNAMNBR=256,                             
//           PARM='CSIUTIL SCAN DASD TAPE MIGR'                       
//*   PARM VALUES - SCAN    - LIST ONLY                               
//*               - RUN     - PROCESS REQUESTS - DELETE OR HSM         
//*               - DASD    - LIST/DELETE DASD DATASETS               
//*               - MIGR    - LIST/DELETE MIGRATED DATASETS           
//*               - TAPE    - LIST/DELETE TAPE DATASETS               
//*               - RCALL   - LIST/RECALL SELECTED DATASETS           
//*               - ARCH    - LIST/MIGRATE SELECTED DATASETS TO ML1   
//*               - ARCH2   - LIST/MIGRATE SELECTED DATASETS TO ML2   
//SYSEXEC  DD DSN=H2567AM.TEST.PROCS(REXX),DISP=SHR                   
//SYSOUT   DD SYSOUT=*                                                 
//SYSTSPRT DD SYSOUT=*                                                 
//SYSTSIN  DD DUMMY                                                   
//DATASETS DD *                                                       
H2567AM.**                                                             
/*                                                                     
//EXCLUDE  DD *   
H2567AM.BACKUP     
H2567AM.TEST.BACKUP
/* 


Code:
error message
IRX0408E Exec member name must not be specified when exec load DD refers to a sequential data set.
 READY
 END   


This is the error message I got in SYSTSPRT
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Feb 09, 2009 5:01 pm    Post subject:
Reply with quote

The REXX code needs to be in a member CSIUTIL (or the name specified in PARM statement) and do not code a member name in the SYSEXEC statement
Back to top
View user's profile Send private message
saroragu

New User


Joined: 12 Nov 2008
Posts: 22
Location: india

PostPosted: Mon Feb 09, 2009 5:20 pm    Post subject: Reply to: Migrated dataset deletion
Reply with quote

Thanks a lot.Im not aware of REXX how to learn it from the basic.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Feb 09, 2009 5:49 pm    Post subject:
Reply with quote

Hi,

Please check these links from "CLIST & REXX" part of the Forum, they are nothing but "sticky" from there..

http://ibmmainframes.com/viewtopic.php?t=21147
http://ibmmainframes.com/viewtopic.php?t=20367

Please learn to search on these forums, you'll get many more links than expected..
Back to top
View user's profile Send private message
saroragu

New User


Joined: 12 Nov 2008
Posts: 22
Location: india

PostPosted: Mon Feb 09, 2009 5:55 pm    Post subject:
Reply with quote

Thanks for your sugesstions.I once again thank you for helping me in this.....
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Fri Feb 10, 2012 3:16 am    Post subject: Reply to: Migrated dataset deletion
Reply with quote

It is not clear if the solution was mentioned.

But this
Code:
//SYSEXEC  DD DSN=H2567AM.TEST.PROCS(REXX),DISP=SHR


will result in a the situation mentioned in this message:
Code:
IRX0408E Exec member name must not be specified when exec load DD refers to a sequential data set.


The SYSEXEC DD statement should refer to the PDS name, and not to a member of a PDS.

A PDS member appears to applications as a sequential dataset. Whereas, in this situation, you want only to provide the PDS that contains the member.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Feb 10, 2012 3:29 am    Post subject: Reply to: Migrated dataset deletion
Reply with quote

tu quoque Pedro icon_wink.gif


The topic has been resurrected after
Code:
...          3 year(s) - (months difference / 12 )
...          3 year(s) - (difference )
...         36 months
...       1095 days
...      26289 hours
...    1577361 minutes
...   94641660 seconds
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Fri Feb 10, 2012 4:20 am    Post subject: Reply to: Migrated dataset deletion
Reply with quote

Sorry.

It somehow showed up in the list of recently appended threads. (or something like that). I normally do not look at old stuff.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Feb 10, 2012 10:15 am    Post subject: Reply to: Migrated dataset deletion
Reply with quote

Sorry for what ? I was just pulling Your leg icon_biggrin.gif
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 641
Location: Whitby, ON, Canada

PostPosted: Fri Feb 10, 2012 7:24 pm    Post subject:
Reply with quote

I am not sure if this has been mentioned elsewhere on this board (I couldn't find it in a Search), but IEFBR14 no longer has to HRECALL a migrated data set before deleting it.

Apparently, the new behaviour is in z/OS not IEFBR14 itself; the system intercepts HRECALL requests resulting from IEFBR14 and, if the DISP is DELETE,DELETE, it performs an HDELETE instead.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7233

PostPosted: Fri Feb 10, 2012 7:44 pm    Post subject: Reply to: Migrated dataset deletion
Reply with quote

Is that an explicit DELETE,DELETE or does it work with (OLD,DELETE)?

That would make IEFBR14 something "special", like a part of the OS rather than a do-nothing program. Kind of hard to describe. Or have they changed IEFBR14 itself to do that? Interesting.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
No new posts Allocate dataset withour BLKSIZE Susanta CLIST & REXX 2 Thu Sep 22, 2016 11:51 am
No new posts dataset copy question - REPRO or some... atulxp TSO/ISPF 2 Wed Aug 03, 2016 10:56 pm
No new posts FTOPEN TEMP is failing due to dataset... mbenaud TSO/ISPF 7 Thu Jul 28, 2016 4:28 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us