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 Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm


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