IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

HOW to copy GDG generations depending on Current date


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
lohithegde

New User


Joined: 18 May 2008
Posts: 31
Location: Chennai

PostPosted: Wed Oct 01, 2008 8:16 pm
Reply with quote

I want to Extract the GDG's which were created ON current date

GDG LIMIT= 255

LRECL = 80

Type = FB

Req: I have to copy all of the generations which were created on current date to a single QSAM dataset.
Back to top
View user's profile Send private message
hchinnam

New User


Joined: 18 Oct 2006
Posts: 73

PostPosted: Wed Oct 01, 2008 8:19 pm
Reply with quote

I don't think it can be done using DFSORT. You need some programing language to do this.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8569
Location: Dubuque, Iowa, USA

PostPosted: Wed Oct 01, 2008 8:35 pm
Reply with quote

The easiest way to do this is to copy using the GDG base to the QSAM dataset, then have an IDCAMS step that removes all generations from the GDG. Each day you start with no generations.

If there is some reason you cannot delete the generations, you have a major problem since there's no easy automated way to tell which generations of a GDG were created on the current date.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed Oct 01, 2008 11:33 pm
Reply with quote

lohithegde,

The following DFSORT JCL will copy only the current day gdg's into a single file. If there are no generations created today the jobs ends with a return code of 4.The job uses DFSORT's new WHEN=GROUP functions available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008).

If you don't have z/OS DFSORT PTF UK90013, ask your System Programmer to install it (it's free).

For complete details on the new functions available with PTF UK90013, see:

Use [URL] BBCode for External Links


step0100 gets the listcat info for the GDG base in question
step0200 builds the sortin dd names based on the creation date from the list cat info.

the sample output from this step would be

Code:

//SORTIN   DD DISP=SHR,DSN=TIDXXX.GDG.TEST.G0006V00
//         DD DISP=SHR,DSN=TIDXXX.GDG.TEST.G0007V00


Step0300 submits the job via intrdr to copy the current day generations

Look at the sysout from step0300 and see if the generated JCL is good and then change the following statement in step0300
Code:

//SORTOUT  DD SYSOUT=*                         


to
Code:

//SORTOUT  DD SYSOUT=(*,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') ALL                           
//*                                                           
//STEP0200 EXEC PGM=ICEMAN                                     
//SYSOUT   DD SYSOUT=*                                         
//SYMNAMES DD *                                               
CURRDATE,S'&LYR4..&LJDAY'                                     
//SORTIN   DD DSN=&&L,DISP=(OLD,PASS)                         
//SORTOUT  DD DSN=&&T,DISP=(,PASS),SPACE=(CYL,(1,2),RLSE)     
//SYSIN    DD *                                               
  INCLUDE COND=(04,7,CH,EQ,C'NONVSAM',OR,                     
                37,8,CH,EQ,C'CREATION')                       
                                                               
  INREC IFTHEN=(WHEN=GROUP,RECORDS=2,                         
        BEGIN=(4,7,CH,EQ,C'NONVSAM'),PUSH=(81:17,44)),         
  IFTHEN=(WHEN=(53,8,CH,EQ,CURRDATE),OVERLAY=(125:SEQNUM,3,ZD))
  SORT FIELDS=COPY                                             
                                                               
  OUTFIL IFOUTLEN=80,NULLOFL=RC4,                             
  INCLUDE=(53,8,CH,EQ,CURRDATE),                               
  IFTHEN=(WHEN=(125,3,ZD,EQ,1),                               
  BUILD=(C'//SORTIN   DD DISP=SHR,DSN=',81,44,80:X)),         
  IFTHEN=(WHEN=NONE,                                           
  BUILD=(C'//         DD DISP=SHR,DSN=',81,44,80:X))           
/*                                                             
//STEP0300 EXEC PGM=ICEMAN,COND=(4,EQ,STEP0200)
//SYSOUT   DD SYSOUT=*                         
//SYSIN    DD *                                 
  SORT FIELDS=COPY                             
//SORTOUT  DD SYSOUT=*                         
//SORTIN   DD DATA,DLM=$$                       
//TIDXXXA  JOB 'COPY',     
//             CLASS=A,                         
//             MSGCLASS=H,                     
//             MSGLEVEL=(1,1),                 
//             NOTIFY=TIDXXX                   
//*                                             
//STEP0100 EXEC PGM=ICEMAN                     
//SYSOUT   DD SYSOUT=*                         
//SORTOUT  DD DSN=TIDXXX.CURRDATE.GDGCOPY,           
//            DISP=(NEW,CATLG,DELETE),         
//            UNIT=SYSDA,                       
//            SPACE=(CYL,(X,Y),RLSE)           
//SYSIN    DD *                                 
  SORT FIELDS=COPY                             
$$                                             
//         DD DSN=&&T,DISP=(OLD,PASS)
/*
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. A Rexx who changes date into a JCL?Po... CLIST & REXX 9
This topic is locked: you cannot edit posts or make replies. include and copy COBOL Programming 4
No new posts DFDSS COPY using Filter REFDT statement JCL & VSAM 2
No new posts tso copy in the foreground TSO/ISPF 12
No new posts Date conversion using SORT SYNCSORT 4
Search our Forums:

Back to Top