Sort Steps
SORT FIELDS=COPY
INREC FINDREP=(INOUT=(C'-',C' '))
INCLUDE COND=(38,08,CH,EQ,C'CREATION',
OR,09,10,CH,EQ,C'SPACE-TYPE',
OR,09,09,CH,EQ,C'SPACE-SEC',
OR,09,09,CH,EQ,C'SPACE-PRI',
OR,09,08,CH,EQ,C'LOW-CCHH',
OR,02,07,CH,EQ,C'CLUSTER',
OR,09,09,CH,EQ,C'REC-TOTAL',
OR,09,11,CH,EQ,C'REC-DELETED',
OR,11,17,CH,EQ,C'IDCAMS PROCESSING')
*---------------------------------------------------------------------*
* CALCULATE THE CREATION DATE *
*---------------------------------------------------------------------*
IF I-DATE-L = 'CREATION'
O-DATE-V = I-DATE-V
W-COUNT-7 = W-COUNT-7 + 1
END-IF
*---------------------------------------------------------------------*
* CALCULATE TOTAL RECORDS *
*---------------------------------------------------------------------*
IF I-REC-TOTAL-L = 'REC TOTAL'
IF W-COUNT-5 = 1
O-REC-TOTAL-V = I-REC-TOTAL-V
W-COUNT-5 = W-COUNT-5 + 1
END-IF
END-IF
*---------------------------------------------------------------------
* CALCULATE PRIMARY SPACE IN TRKS AND CYCL
*---------------------------------------------------------------------
IF I-SPACE-PRIM-L = 'SPACE PRI'
* IF W-LABEL-MAIN = 'CYLINDER'
* O-DATA-PRIM-L = 'CYL'
* O-INDEX-PRIM-L = 'CYL'
* END-IF
* IF W-LABEL-MAIN = ' TRACK'
* O-DATA-PRIM-L = 'TRK'
* O-INDEX-PRIM-L = 'TRK'
* END-IF
IF W-COUNT = 1
O-SPACE-PRIM-TRK-V = I-SPACE-PRIM-V
ELSE
O-SPACE-PRIM-CYL-V = I-SPACE-PRIM-V
W-COUNT = W-COUNT + 1
END-IF
END-IF
*---------------------------------------------------------------------*
* CALCULATE TOTAL NO OF EXTENTS *
*---------------------------------------------------------------------*
IF I-EXTENT-L = 'EXTENTS'
O-EXTENT-V = I-EXTENT-V
END-IF
*---------------------------------------------------------------------*
* CALCULATE THE USED SPACE BY ADDING THE TOTAL NO OF TRACKS *
*---------------------------------------------------------------------*
IF I-TRACKS-L = 'TRACKS'
IF W-COUNT-7 = 3
W-TRACKS = W-TRACKS + I-TRACKS-V
O-H-SPACE-V = W-TRACKS
END-IF
END-IF
*---------------------------------------------------------------------*
* CALCULATE USED % BY DIVIDING U-RBA BY A-RBA *
*---------------------------------------------------------------------*
IF I-H-A-RBA-L = 'HI A RBA'
IF W-COUNT-1 LT 1
W-H-A-RBA-V = I-H-A-RBA-V
W-COUNT-1 = W-COUNT-1 + 1
END-IF
END-IF
IF I-H-U-RBA-L = 'HI U RBA'
IF W-COUNT-2 LT 1
W-H-U-RBA-V = I-H-U-RBA-V
END-IF
W-COUNT-2 = W-COUNT-2 + 1
END-IF
O-H-RBA-V = (W-H-U-RBA-V / W-H-A-RBA-V) * 100
O-H-RBA-P-V = W-H-RBA-P-V
O-TRACKS-V = (W-H-U-RBA-V / W-H-A-RBA-V) * W-TRACKS
END-IF
IF I-LAST-RECORD = 'IDCAMS PROCESSING'
PUT VSAMOUT
O-TOTAL-SPACE-L1 = W-TOTAL-SPACE-L1
O-TOTAL-SPACE-V = W-COUNT-8
O-TOTAL-SPACE-L2 = W-TOTAL-SPACE-L2
O-SPACES1 = W-SPACES1
O-SPACES2 = W-SPACES2
O-SPACES3 = W-SPACES3
O-SPACES4 = W-SPACES4
O-SPACES5 = W-SPACES5
PUT VSAMOUT
STOP
END-IF
Please remember that i have not put in any variables that i have used in the logic. u will have to fiure that out according to ur need.
Let me know if you need more help, and i am sorry for being too late... on this