Include COND: Matching TimeStamp Example

Welcome to my DFSORT post. DFSORT is not so complex, if you learn step by step way..


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


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

Bonus: How to Use Overlay in Sort Best JCL Example that helps you how to overlay input and sort the dataset.

For example:


It 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.

Related Posts

Author: Srini

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