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
 

 

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 How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm


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