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
 

 

Replacing date value < current date with current date (so

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

New User


Joined: 06 Mar 2006
Posts: 50
Location: PUNE

PostPosted: Thu Sep 20, 2007 2:57 pm    Post subject: Replacing date value < current date with current date (so
Reply with quote

Hi all,

I have one file say record length 10, it is holding date value.
How to replace date value with current date if it is less than current
date using DFSORT.

Thanks
Anand
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Thu Sep 20, 2007 3:03 pm    Post subject:
Reply with quote

Anand,

Post your date format (like yyyymmdd .....).
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 356
Location: New York

PostPosted: Thu Sep 20, 2007 3:06 pm    Post subject:
Reply with quote

Hi,

If you want to do without DFSORT, you can compare both the dates and if date is lessthan current date replace the date by current date by using Reference Modification.

If you want to do by using DFSORT only, please wait for other answers.
Back to top
View user's profile Send private message
Anand78

New User


Joined: 06 Mar 2006
Posts: 50
Location: PUNE

PostPosted: Thu Sep 20, 2007 5:17 pm    Post subject: Date format
Reply with quote

Date format is YYYY-MM-DD
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Thu Sep 20, 2007 5:47 pm    Post subject:
Reply with quote

Code:
// EXEC PGM=SORT     
//SORTIN DD *       
2007-08-16           
2007-08-17           
2007-08-18           
2007-08-19           
2007-09-20           
2007-09-21           
2007-09-22           
2007-09-23           
2007-09-24           
2007-09-25           
/*                   
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *         
 OPTION COPY         
 INREC IFTHEN=(WHEN=(1,10,CH,LT,DATE1(-)),BUILD=(DATE1(-)))
/*                                                         
//

Output:
Code:
2007-09-20
2007-09-20
2007-09-20
2007-09-20
2007-09-20
2007-09-21
2007-09-22
2007-09-23
2007-09-24
2007-09-25
Back to top
View user's profile Send private message
Anand78

New User


Joined: 06 Mar 2006
Posts: 50
Location: PUNE

PostPosted: Fri Sep 21, 2007 2:25 pm    Post subject: Replacing date value < current date with current date
Reply with quote

Hi Shankar,

Thanks for ur help, its working.


Anand
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 TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts Add system date inside of a PS file a... pramitdas DFSORT/ICETOOL 5 Sun Aug 28, 2016 12:06 am


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