Joined: 14 Mar 2008 Posts: 74 Location: India,Chennai
I have a requirement in which i have to find the number of years the records are present in the file(from current date). Each record will have a date in the first 10 bytes (mm/dd/yyyy).This date corresponds to when the record was written in the file.The date might vary for each record. I need to find how many years each record is present in the file.
Length: 58 bytes (50 bytes data + 08 bytes date (difference date)) I have to use system date to find the difference date.
difference date format -- yyyymmdd.
Sample o/p record:
50 bytes i/p record..00071002
here '0007' corresponds to number of years the record was present in file.
'10' corresponds to number of months and '02' corresponds to number of days.
With PTF UK90025 for z/OS DFSORT V1R10 and PTF UK90026 for z/OS DFSORT V1R12(Oct, 2010), DFSORT now supports date arithmetic which can be used to calculate the number of days difference between two dates. The result is an 8-byte value consisting of a sign and 7 digits (sddddddd). If the first date is greater than or equal to the second date, the sign is + (plus). If the first date is less than the second date, the sign is - (minus).