Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
To get previous month first day whener i run the job

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: To get previous month first day whener i run the job
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    Post subject: Reply to: To get previous month first day whener i run the j
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    Post subject:
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    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 it is possible output a SET value fro... Martylin JCL & VSAM 5 Fri Sep 22, 2017 7:08 am
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts Reg:Displaying the particular month o... bhavana yalavarthi All Other Mainframe Topics 4 Sat Jul 08, 2017 8:13 pm
No new posts Need DB2 query to fetch previous row ! Chandan1993 DB2 10 Sat Jun 03, 2017 10:43 am
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us