IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Replacing date value < current date with current date (so


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 1436
Location: Bangalore,India

PostPosted: Thu Sep 20, 2007 3:03 pm
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: 355
Location: New York

PostPosted: Thu Sep 20, 2007 3:06 pm
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Changeman - how can we know the curr... Compuware & Other Tools 2
Search our Forums:

Back to Top