View previous topic :: View next topic |
Author |
Message |
shanrice Beginner
Joined: 04 Nov 2006 Posts: 5 Topics: 2
|
Posted: Sat Nov 04, 2006 8:26 pm Post subject: Syncsort - how to get yesterdays date |
|
|
I am currently using &DATE in sort OUTREC for getting the current date. My requirement changed and I would like to write yesterdays date while writing to output.
Is there a way to subtract 1 day and get yesterdays date using sort (OUTREC)?
TIA |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12357 Topics: 75 Location: San Jose
|
Posted: Sun Nov 05, 2006 6:05 pm Post subject: |
|
|
shanrice,
Syncsort does not have the ability to calculate the dates. However if your intention is to pick yesterday's records then you can use the &date1 in the include/omit cond
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
20061103
20061104
20061105
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(1,8,CH,EQ,&DATE1-1)
/*
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
shanrice Beginner
Joined: 04 Nov 2006 Posts: 5 Topics: 2
|
Posted: Sun Nov 05, 2006 7:23 pm Post subject: |
|
|
Thanks for your info. I will get the date from a pgm. |
|
Back to top |
|
|
shanrice Beginner
Joined: 04 Nov 2006 Posts: 5 Topics: 2
|
Posted: Sun Nov 05, 2006 8:28 pm Post subject: |
|
|
I googled again on my original requirement and looks like there is an option to get yesterdays date. I will give it a try tomorrow.
Code: |
INREC OVERLAY=(81:DATE1-1) |
|
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12357 Topics: 75 Location: San Jose
|
Posted: Sun Nov 05, 2006 9:19 pm Post subject: |
|
|
shanrice wrote: | I googled again on my original requirement and looks like there is an option to get yesterdays date. I will give it a try tomorrow.
Code: |
INREC OVERLAY=(81:DATE1-1) |
|
That syntax is only valid with DFSORT. Syncsort Does not support date arthimetic on inrec/outrec
Kolusu _________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
|
|