Welcome to my DFSORT post. DFSORT is not so complex, if you learn step by step way..
How…
Here it is my example (include cond in sort jcl) that if you want to include matching timestamp records into your output file, then, the below sort card is really useful.
INCLUDE COND in Sort JCL 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
appropriate.
Bonus: How to Use Overlay in Sort Best JCL Example that helps you how to overlay input and sort the dataset.
For example:
INCLUDE COND=(1,13,CH,GT,DATE4)
It would compare the field in positions 1-13 to the truncated DATE4 constant C’yyyy-mm-dd-hh’.
DFSORT-DATE4 Uses
The other uses of DATE4 are you can insert timestamp or you can compare records with current timestamp.
Related Posts