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
 

 

Copy gdgs of previous month

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Copy gdgs of previous month
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: 8593
Location: Back in jolly old England

PostPosted: Sat Jan 29, 2011 5:16 pm    Post subject:
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    Post subject: Reply to: Copy gdgs of previous month
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

Site Director


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

PostPosted: Sun Jan 30, 2011 4:25 am    Post subject:
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    Post subject:
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:

http://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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am


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