Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Extracting records from tape GDG based upon creation date

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
ashok4u_it

New User


Joined: 12 Mar 2008
Posts: 53
Location: Chennai

PostPosted: Mon Mar 17, 2008 7:52 pm    Post subject: Extracting records from tape GDG based upon creation date
Reply with quote

I have one GDG generation in a Tape dataset. This GDG gets updated daily with 4 or 3 or 2 or 1 tapes based upon its input. I just want to extract these Tapes based upon the latest creation date. This GDG can have 1 or 2 or 3 or 4 Tape datasets with same creation date.

Can anyone please help me to handle this scenario.

K.Ashok Kumar.
Back to top
View user's profile Send private message

Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Tue Mar 18, 2008 2:40 am    Post subject:
Reply with quote

Can you uncatalog the tapes after daily processing so you only need to call in all cataloged generations each day?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Mar 18, 2008 5:03 am    Post subject: Reply to: Extracting records from tape GDG based upon creati
Reply with quote

ashok4u_it,

The following DFSORT/ICETOOL jcl will give you the desired results. We extract the listcat info and build a dynamic JCL to pick the latest GDG version and submit the job via INTRDR

Code:

//STEP0100 EXEC PGM=IKJEFT01                               
//*                                                         
//SYSTSPRT DD DSN=&&L,                                     
//            DISP=(,PASS),                                 
//            SPACE=(CYL,(1,1),RLSE),                       
//            DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)             
//SYSTSIN  DD *                                             
  LISTCAT ENT('YOUR GDG BASE NAME') ALL                       
//*                                                         
//STEP0200 EXEC PGM=ICEMAN                                 
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN=&&L,DISP=(OLD,PASS)                       
//T1       DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE) 
//T2       DD DSN=&&T2,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE) 
//SYSIN    DD *                 
 INCLUDE COND=(4,7,CH,EQ,C'NONVSAM',OR,                 
               37,8,CH,EQ,C'CREATION')                 
                                                       
  INREC IFTHEN=(WHEN=INIT,                             
       OVERLAY=(81:SEQNUM,8,ZD)),                       
        IFTHEN=(WHEN=(4,7,CH,EQ,C'NONVSAM'),           
       OVERLAY=(81:SEQNUM,8,ZD)),                       
        IFTHEN=(WHEN=NONE,                             
       OVERLAY=(89:SEQNUM,8,ZD,                         
                81:81,8,ZD,SUB,89,8,ZD,M11,LENGTH=8))   
                                                       
  SORT FIELDS=(81,8,CH,D,53,8,CH,A)                     
  OPTION EQUALS                 
                       
  OUTREC IFTHEN=(WHEN=(37,8,CH,EQ,C'CREATION'),         
        BUILD=(49X,53,8,80:X,81,8)),                   
        IFTHEN=(WHEN=NONE,                             
        BUILD=(17,44,80:X,81,8))                       
                                                       
  OUTFIL FNAMES=T1                                     
  OUTFIL FNAMES=T2,STARTREC=2,ENDREC=2,                 
  BUILD=(C'GDGDATE,C',C'''',50,8,C'''',80:X)           
/*                                                     
//STEP0300 EXEC PGM=ICETOOL                               
//TOOLMSG  DD SYSOUT=*                                   
//DFSMSG   DD SYSOUT=*                                   
//SYMNAMES DD DSN=&&T2,DISP=SHR                           
//IN       DD DSN=&&T1,DISP=SHR                           
//OUT      DD DSN=&&T3,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)
//TOOLIN   DD *                                           
  SPLICE FROM(IN) TO(OUT) WITHALL KEEPNODUPS -           
      ON(81,8,CH) WITH(50,08)  USING(CTL1)               
//CTL1CNTL DD *                                           
  SORT FIELDS=COPY                                       
  OUTFIL FNAMES=OUT,IFOUTLEN=80,                         
  INCLUDE=(50,08,CH,EQ,GDGDATE,AND,                       
           01,44,CH,NE,C' '),                             
  IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),           
  IFTHEN=(WHEN=(81,8,ZD,EQ,1),                           
  BUILD=(C'//SORTIN   DD DISP=SHR,DSN=',1,44,80:X)),     
  IFTHEN=(WHEN=NONE,                                     
  BUILD=(C'//         DD DISP=SHR,DSN=',1,44,80:X))       
/*
//STEP0400 EXEC  PGM=ICEMAN             
//SYSOUT   DD SYSOUT=*                 
//SYSIN    DD *                         
   OPTION COPY                         
/*                                     
//SORTOUT  DD SYSOUT=*                 
//SORTIN   DD DATA,DLM=$$               
//TIDXXXXA JOB 'COPY',                 
//             CLASS=A,                 
//             MSGCLASS=Y,             
//             MSGLEVEL=(1,1),         
//             NOTIFY=TID               
//*                                     
//STEP0100 EXEC PGM=ICEMAN             
//SYSOUT   DD SYSOUT=*                 
//SORTOUT  DD DSN=OUTPUT OF LATEST GDG,
//            DISP=(NEW,CATLG,DELETE), 
//            UNIT=SYSDA,               
//            SPACE=(CYL,(X,Y),RLSE)   
//SYSIN    DD *                         
  SORT FIELDS=COPY                     
$$                                     
//         DD DSN=&&T3,DISP=(OLD,PASS)


Once you have verified the output from step0400 has generated the right JCl , change the sortout statement in step0400 to the following which will submit the dynamic JCL via INTRDR which will actually do the copy of the latest GDG

Code:

//SORTOUT  DD SYSOUT=(*,INTRDR)


Hope this helps...

Cheers
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us