VSAM

Mainframe - Copy one file to another file with sorted order and summed up the column

Command :
SORT FIELDS=(starting position, length, format of the variable, ascending or descending.
SUM FIELDS=(starting position, length of the variable, format of the variable)
Example :
//DDName EXEC PGM=SORT
//SORTIN DD DSN=XXXXXXXXXXXXXXXXX,
// DISP=SHR
//SORTOUT DD DSN=XXXXXXXXXXXXXXXXXXXX,
// DISP=(NEW,CATLG,DELETE),
// UNIT=XXXXX,SPACE=(XXX,(XX,XX),XXXX),
// DCB=(*.SORTIN) Output file created using properties from input file.

Compare Two VSAM Files

Normal flat file compare option 3.13 can be used to compare 2 VSAM files. Also if the compare needs to be any particular field then needs to use starting position and end position. See the below sample.

In the below sample starting position is 5 and ending position is 60. It will compare the values from position 5 to 60 and provide the result if any difference.

Syndicate content