How to Compare PD Julian date with (Current Julian date-7) using JCL- SYNCSORT?

StackOverflow https://stackoverflow.com/questions/7444766

  •  21-01-2021
  •  | 
  •  

문제

I have a requirement as below.

In my input file, I have a packed-decimal Julian date starting in the 23rd position (position 23, length 4).

  1. If my the input Julian date is less than (Current Julian date - 7 days) then write the records into output File1.

  2. Else write the records into outut File2.

Can anybody let me know the solution for this requirement in SyncSort only?

도움이 되었습니까?

해결책

You can use this...

//SYSIN  DD *
 SORT FIELDS=COPY,
 OUTFIL FNAMES=01,
 INCLUDE=(23,4,PD,EQ,DATE3P-7)
 OUTFIL FNAMES=02,SAVE

DATE3P gives the current date in P'YYYYDDD' packed-decimal format.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top