Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups 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
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
References
Skolusu

DFSORT Developer


Joined: 07 Dec 2007
Posts: 399
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1