!When I run the job now, I have these control statements:
Code:
SORT FIELDS=COPY
INCLUDE COND=(110,5,PD,LT,20200101,
AND,110,5,PD,GT,20181231)
but I want to dynamically use the system date. No matter when it runs within year NNNN, it should select all records for the preceding year NNNN-1... I see a few posts about using dates and SYMNAMES, but always in Character format...
I don't know how to use that for a compare with Packed Decimal field...
In order to dynamically produce two dates of the required range, several SORT date operations are needed; so, SYMSORT values cannot be used.
You may need to temporary reserve some space with each input record: 10 bytes - to produce two dates in format PD, or 16 bytes - to produce two dates in format ZD.
Joined: 15 Aug 2015 Posts: 1337 Location: Bamberg, Germany
@Flora: You will have a little bit increased runtime depending on the amount of data for both solutions. This is due to the necessity to process data after they have passed the global INCLUDE you had specified.