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
 
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Mainframe scheduling tool ddhar Compuware & Other Tools 2 Wed Sep 27, 2017 12:48 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

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