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
 

 

Retrieve system date by use of sort tool

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
knobi

New User


Joined: 16 Aug 2005
Posts: 46

PostPosted: Thu Feb 01, 2007 6:24 am    Post subject: Retrieve system date by use of sort tool
Reply with quote

Could someone point me to an example or manual explaining how to retrieve the last and the first day of current month by use of sort tool ?
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Feb 01, 2007 9:36 pm    Post subject:
Reply with quote

Do you mean "day" as in Monday, Tuesday, etc, or do you mean date as in 'yyyymmdd' or some other form? Please be more specific about what you want to do exactly.
Back to top
View user's profile Send private message
knobi

New User


Joined: 16 Aug 2005
Posts: 46

PostPosted: Fri Feb 02, 2007 9:38 pm    Post subject:
Reply with quote

sorry Frank, the date format would be something like mmddyy :

output:
first 010107 last 013107


thank you !
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Feb 02, 2007 10:08 pm    Post subject:
Reply with quote

You could use a DFSORT job like this. It will handle everything except setting the last day of Feb to '29' for a leap year. That would take a bit more work, but could be done.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC IFOUTLEN=30,
   IFTHEN=(WHEN=INIT,BUILD=(31:DATE2)),
   IFTHEN=(WHEN=INIT,
     OVERLAY=(C'First ',35,2,C'01',33,2,
       C' last ',35,2,21:C'xx',33,2)),
   IFTHEN=(WHEN=INIT,
     OVERLAY=(21:35,2,CHANGE=(2,
      C'01',C'31',C'02',C'28',C'03',C'31',C'04',C'30',
      C'05',C'31',C'06',C'30',C'07',C'31',C'08',C'31',
      C'09',C'30',C'10',C'31',C'11',C'30',C'12',C'31')))
/*


I ran this job today and the output was:

Code:

First 020107 last 022807
Back to top
View user's profile Send private message
knobi

New User


Joined: 16 Aug 2005
Posts: 46

PostPosted: Sun Feb 04, 2007 12:21 am    Post subject:
Reply with quote

Thank you very much Frank !
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 Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
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
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us