SORT card to add header and trailer with date & Counts

This SORT example is to add Header and Trailer to the sorted file along with the total number of records.
Header –> A Name along with the current System date
Trailer–> A static message along with number of input records count

Example Sort Card:

Header1 –> It has a Static message which start from 1st position followed by a date and Time. Here given ‘@’ just to separate date and time. You can give anything here.
Trailer1–> Count gives the records count excluding Header and Trailer with length of 4.
MD4/ –> is a Date format with ‘/’ as a separator. There are few other date formats as well that can be used here.
M11 –> this is an Edit mask pattern which gives the numbers in 0005 format if the value is 5. Means it shows the leading zeroes as well. There are many other Patterns which we can use here, but as an example I have used M11.
REMOVECC–> It removes the ANSI carriage control character from the Output file.

 

Output:

 

Leave a Reply

Your email address will not be published. Required fields are marked *