View previous topic :: View next topic
|
Author |
Message |
thunderstorm
New User
Joined: 23 Mar 2007 Posts: 35 Location: pune
|
|
|
|
I have requirement to get records which are greater than a certain date which is in the format of mm/dd/yyyy
For e.g first 10 bytes corresponds to date and next transaction , i want to get the rows have date greater than 01/01/2006
10/01/200599923
09/22/200797861
09/22/200720324
Please let me know |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
thunderstorm,
Try this . I assumed that your input is FB recfm and 80 bytes in length
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
10/01/200599923 - DROP
09/22/200797861 - PICK
09/22/200720324 - PICK
02/01/2006 - PICK
01/01/2006 - DROP
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC OVERLAY=(81:7,4,1,2,4,2)
OUTFIL INCLUDE=(81,8,CH,GT,C'20060101'),BUILD=(1,80)
//* |
|
|
Back to top |
|
|
thunderstorm
New User
Joined: 23 Mar 2007 Posts: 35 Location: pune
|
|
|
|
is to possible to use any DATE1 function to do it ? |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
what do you mean by
Quote: |
is to possible to use any DATE1 function to do it ? |
Do you mean instead of coding 20060101 ?
Gerry |
|
Back to top |
|
|
thunderstorm
New User
Joined: 23 Mar 2007 Posts: 35 Location: pune
|
|
|
|
I meant we have functions like DATE1, Y2W etc. for manipulations on date formats. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
what's wrong with the manipulation that has been provided ?
Gerry |
|
Back to top |
|
|
thunderstorm
New User
Joined: 23 Mar 2007 Posts: 35 Location: pune
|
|
|
|
i just wanted to know if there is a way we can do using DATE1 function.
There is nothing wrong in the original solution..but wanted to know if its possible via functions. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Did you bother to look up the DATE1 function. It's for the current date. If you want to compare a date based on the current date, you can use DATEn, DATEn+d or DATEn-d. But you asked how to compare to a specific date so that's the solution you were given. Please read the DFSORT books to find out what specific functions do. You can find all of the DFSORT books at:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080 |
|
Back to top |
|
|
|