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
 

 

HOW to copy GDG generations depending on Current date

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: HOW to copy GDG generations depending on Current date
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    Post subject:
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: 7995
Location: Bellevue, IA

PostPosted: Wed Oct 01, 2008 8:35 pm    Post subject:
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    Post subject: Reply to: HOW to copy GDG generations depending on Current d
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:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/


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    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 Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Overlay the system date Danielle.Filteau SYNCSORT 4 Fri Mar 03, 2017 1:16 am
No new posts Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am
No new posts Checking Current date vickey_dw DFSORT/ICETOOL 1 Wed Feb 08, 2017 11:14 pm


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