Welcome to my DFSORT post…
DFSORT is not so complex, if you learn step by step way..
Here it is my example that if you want to include matching timestamp records into your output file, then, the below sort card is really useful.
INCLUDE Example with DATE4
| INCLUDE COND=(1,19,CH,GT,DATE4) |
This example illustrates how to include only those records with a C’yyyy-mm-dd-hh.mm.ss’ date value in positions 1-19 greater than the DATE4 character string for the run.
Note: When a field is shorter than the DATE4 character string it’s compared to, DFSORT truncates the DATE4 string on the right. You can take advantage of this to compare a field to only part of the DATE4 timestamp when
would compare the field in positions 1-13 to the truncated DATE4 constant C’yyyy-mm-dd-hh’.
The other uses of DATE4 are you can insert timestamp or you can compare records with current timestamp