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
 
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: 355
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 Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm
No new posts Comparision with current time arunsoods DFSORT/ICETOOL 5 Thu Nov 09, 2017 10:37 am
This topic is locked: you cannot edit posts or make replies. Comparing current time with the time ... arunsoods SYNCSORT 1 Mon Oct 30, 2017 4:07 pm
This topic is locked: you cannot edit posts or make replies. Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm

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