View previous topic :: View next topic
|
Author |
Message |
Aneesh
New User
Joined: 30 Sep 2006 Posts: 60
|
|
|
|
Hi,
I am trying to extract all records from a file where a date field is less than current date - 90 days.
The following sort card works fine.
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(105,8,CH,LT,DATE1-90)
When i am trying to use the number of days through a symbol file, i am getting a syntax error.
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(105,8,CH,LT,DATE1-CUTOFF)
The symnames dataset has:
CUTOFF,90
Can symbols be used with DATE1 calculations?
Thanks,
Aneesh. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
No, for DATE1-d, you cannot use a symbol for d.
However, if you use a symbol with +d like this:
CUTOFF,+90
you can use a DFSORT job like the following to do what you want:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
CUTOFF,+90
/*
//SORTIN DD *
DUMMY
/*
//SORTOUT DD DSN=&&C1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
OUTFIL BUILD=(C' SORT FIELDS=COPY',80:X,/,
C' OUTFIL FILES=01,INCLUDE=(105,8,CH,LT,DATE1-',
CUTOFF,TO=ZD,LENGTH=3,C')')
/*
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOF01 DD DSN=... output file
//SYSIN DD DSN=&&C1,DISP=(OLD,PASS)
|
|
|
Back to top |
|
|
Aneesh
New User
Joined: 30 Sep 2006 Posts: 60
|
|
|
|
Thanks a lot, Frank. |
|
Back to top |
|
|
|
|