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

Copy gdgs of previous month


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rocky_balboa

New User


Joined: 24 Mar 2010
Posts: 61
Location: Cape of Good Hope

PostPosted: Sat Jan 29, 2011 1:17 pm
Reply with quote

Hi
I need to copy data for a gdg for all the generations in the previous month to a new file.

I am not implementing a regular process(through date routines or transaction timestamps) but an ad-hoc for some reporting purposes. I was able to it for current day. The challenge I am facing is that LISTCAT does not produce the date but day of the year.

//S1 EXEC PGM=IKJEFT01
//SYSTSPRT DD DSN=YYYYYYYYYYYY,
// DISP=(OLD,CATLG,CATLG),SPACE=(CYL,(1,1),RLSE),
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)
//SYSOUT DD SYSOUT=*
//SYSTSIN DD *
LISTCAT ENT('XX.YY.GDG') ALL
/*
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
CURRDATE,S'&LYR4..&LJDAY'
/*
//SORTIN DD DSN=YYYYYYYYYYYYYYY,DISP=SHR
//SORTOUT DD DSN=XXXXXXXXXXXX,
// DISP=(OLD,CATLG,CATLG),SPACE=(CYL,(1,2),RLSE),UNIT=SYSDA,
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=8000)
//SYSIN DD *
OPTION COPY
INCLUDE COND=(4,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))
OUTFIL IFOUTLEN=80,NULLOFL=RC4,
INCLUDE=(53,8,CH,EQ,CURRDATE),
IFTHEN=(WHEN=(125,3,ZD,EQ,1),
BUILD=(C'//SYSUT1 DD DISP=SHR,DSN=',81,44,80:X)),
IFTHEN=(WHEN=NONE,
BUILD=(C'// DD DISP=SHR,DSN=',81,44,80:X))
/*
//SUBJCL EXEC PGM=ICEMAN,COND=(4,EQ,S2)
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=(A,INTRDR)
//SORTIN DD DATA,DLM=$$
//aaaaaa@ JOB ('0000,0000,0000,T'),
// 'xxxx',CLASS=A,MSGCLASS=P,NOTIFY=&SYSUID,REGION=6M
/*JOBPARM S=TSYS
//GDGCUR EXEC PGM=ICEGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT2 DD DSN=xxxxxxxxxxxxx,DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(5,5),RLSE)
$$
// DD DSN=xxxxxxxxxxxxxx,DISP=SHR
//SYSIN DD *
OPTION COPY
/*
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sat Jan 29, 2011 5:16 pm
Reply with quote

If you parse LISTCAT through REXX you can use the date routines of REXX to get the correct date ranges.

You can also use IGGCSIRX (after some tinkering) from SYS1.SAMPLIB to get creation dates.

Also using REXX you can invoke ISPF file tailoring services to generate and submit the JCL all from within one single REXX EXEC.
Back to top
View user's profile Send private message
rocky_balboa

New User


Joined: 24 Mar 2010
Posts: 61
Location: Cape of Good Hope

PostPosted: Sat Jan 29, 2011 9:55 pm
Reply with quote

Thanks expat. But I do not know REXX as of now. I am looking for a DFSORT/ICEMAN/ICETOOL date function. Please move my post to DFSORT if that is where I could receive some guidance.

I initially posted it in JCL as it was related to gdgs...
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Jan 30, 2011 4:25 am
Reply with quote

Hello,

As your system uses Syncsort, this JCL part of the forum is the proper place for your topic.

You need to look at the Syncsort documentation. You could als look thru previous Syncsort topics that discuss something similar.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Feb 01, 2011 6:03 am
Reply with quote

rocky_balboa wrote:
The challenge I am facing is that LISTCAT does not produce the date but day of the year.


With PTF UK90025 for z/OS DFSORT V1R10 and PTF UK90026 for z/OS DFSORT V1R12(Oct, 2010), DFSORT now supports date arithmetic which can add/subtract days, months or years to a given date like shown below.

Code:

//STEP0100 EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD *                                             
A                                                           
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *                                                   
  SORT FIELDS=COPY                                               
  INREC IFTHEN=(WHEN=INIT,                                       
  OVERLAY=(DATE1,10:01,8,Y4T,SUBDAYS,07,2,ZD,TOGREG=Y4T,         
           20:10,8,Y4T,SUBDAYS,16,2,ZD,TOGREG=Y4T))               
                                                                 
  OUTFIL BUILD=(C'LMLDATE,C''',20,8,Y4T,TOJUL=Y4T(.),C'''',/,     
                C'LMHDATE,C''',10,8,Y4T,TOJUL=Y4T(.),C'''',80:X) 
/*


This will generate 2 symbols as follows
Code:

LMLDATE,C'2010.334'
LMHDATE,C'2010.365'


Now you can use them as symbols to filter out the file names from LISTCAT output using the following condition

Code:

 OUTFIL IFOUTLEN=80,NULLOFL=RC4,
 INCLUDE=((53,8,CH,GT,LMLDATE,AND,53,8,CH,LE,LMHDATE).
  ..



For complete details of date arithmetic functions and other new functions see "User Guide for DFSORT PTFs UK90025 and UK90026" paper (sortugph.pdf) at:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000242
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts replace word 'MONTH' with current mon... SYNCSORT 11
No new posts Need COBOL COPY Help in MVS Environment COBOL Programming 4
Search our Forums:

Back to Top