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

To get previous month first day whener i run the job


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

New User


Joined: 28 Aug 2008
Posts: 2
Location: Chennai

PostPosted: Wed Oct 22, 2008 2:46 pm
Reply with quote

I have a situation like whenever i run a job, i should generate a dataset which will contain the first of the previous month in the format 'ccyymmdd'.

e.g. If i run the job today(20081022) it should generate the dataset with the value(20080901)

Please help me out. Thanks in advance.
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 22, 2008 8:51 pm
Reply with quote

The following JCL will create 1 record with previous months first day. The output lrecl is FB and 80 bytes. Change the 80:x to your desired length

Code:

//STEP0100 EXEC PGM=ICEMAN       
//SYSOUT   DD SYSOUT=*           
//SORTIN   DD *                   
DUMMY RECORD                     
//SORTOUT  DD SYSOUT=*           
//SYSIN    DD *                   
  SORT FIELDS=COPY               
  INREC BUILD=(DATE2-1,C'01',80:X)
/*
Back to top
View user's profile Send private message
aravindhsankar

New User


Joined: 28 Aug 2008
Posts: 2
Location: Chennai

PostPosted: Thu Oct 23, 2008 10:23 pm
Reply with quote

Thanks Kolusu.
So nice of you. Hats off for your speedy response.!!!
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
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 replace word 'MONTH' with current mon... SYNCSORT 11
No new posts How to extract the data for current y... DFSORT/ICETOOL 8
No new posts Help, trying to use OVERLAY to get a ... DFSORT/ICETOOL 3
Search our Forums:

Back to Top