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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm


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