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 IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am


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