MAINFRAME - TIP OF THE DAY :
When you specified V for RECFM parameter, LRECL value is largest record in the file plus 4 bytes. These four bytes contain the actual length of each variable length record in the file

Well, you'll need to SORT on branch, so that leaves SUM as an easy option, but I think still better to use OUTFIL reporting features, REMOVECC,NODETAIL and SECTIONS with TRAILER3. SORT will take care of the field-sizes, with SUM you have to do that yourself (extending the fields in INREC if they may be going to overflow).