Compare Packed decimal Julian date with (Packed decimal Current Julian date-7days) using JCL- SYNCSORT?

陌路散爱 提交于 2019-12-08 11:58:41

问题


I have a requirement as below.

In my Input file, I have Packed decimal Julian date[YYYYDDD format] in 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 Out File1.

  2. Else Write the records into Out file2.

Can anybody let me know how to Compare Packed decimal Julian date with (Packed decimal Current Julian date-7days) using JCL- SYNCSORT?


回答1:


You can use this...

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

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



来源:https://stackoverflow.com/questions/7501989/compare-packed-decimal-julian-date-with-packed-decimal-current-julian-date-7day

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!