The record key is defined in the "SETKEY" block. The SETKEY function requires two parameters (offset and length) for each segment of the key. In this case, the key has only one segment: the 5 columns starting in column 19.
Each field to be totaled is defined in the "SUM" block. The SUM function requires three parameters (offset, length, field type) for each field being totaled. In this example, only one field is being totaled: a packed decimal value in the seven columns starting in column 35.
The BUNPK process converts numbers (without decimals) and the BUNPKn process converts numbers (with n decimals) from packed format to standard decimal character format. The DO SET following this DO EXTRACT eliminates any leading zeros resulting from this conversion.