Include COND matching records with Timestamp

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
This example illustrates how to include only those records with a C’’ 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

For example:
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


Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.