View previous topic :: View next topic
|
Author |
Message |
Anand78
New User
Joined: 06 Mar 2006 Posts: 50 Location: PUNE
|
|
|
|
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 |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Anand,
Post your date format (like yyyymmdd .....). |
|
Back to top |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
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 |
|
|
Anand78
New User
Joined: 06 Mar 2006 Posts: 50 Location: PUNE
|
|
|
|
Date format is YYYY-MM-DD |
|
Back to top |
|
|
shankar.v
Active User
Joined: 25 Jun 2007 Posts: 196 Location: Bangalore
|
|
|
|
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 |
|
|
Anand78
New User
Joined: 06 Mar 2006 Posts: 50 Location: PUNE
|
|
|
|
Hi Shankar,
Thanks for ur help, its working.
Anand |
|
Back to top |
|
|
|