View previous topic :: View next topic
|
Author |
Message |
kkxlnc
New User
Joined: 12 Jun 2005 Posts: 44 Location: Boston
|
|
|
|
Can we use a sort to delete records which are 14 months older? This process needs to run on a monthly basis, so we cannot hard-code a date to compare.
Any suggestions are welcome. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Is the date stored in the record, if so, at which location and in which format.
If not, how would you determine the age of a record. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Show us some sample records from the file..
Also RECFM,LRECL of file. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
kkxlnc
New User
Joined: 12 Jun 2005 Posts: 44 Location: Boston
|
|
|
|
The DATE1(-)-56 operand corresponds to a C'yyyy-mm-dd' constant for today's date minus 56 days. So the following
control statement will include only those records with a C'yyyy-mm-dd' date in positions 14-23 greater than
today's date - 56 days.
Code: |
INCLUDE COND=(14,10,CH,GT,DATE1(-)-56)
|
Thank you Frank. That was perfect. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Glad I could help. |
|
Back to top |
|
|
|