試試這個:
//SORTSTEP EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=YourInputDataset,DISP=SHR
//SORTOUT DD DSN=YourOutputDataset,
// DISP=(NEW,CATLG,DELETE)
//SYSIN DD *
SORT FIELDS=(1,4,BI,A)
INREC BUILD=(1,4,BI,TO=ZD,LENGTH=6,5,4,9,4,13,32)
OUTFIL REMOVECC,
SECTIONS=(1,6,
HEADER3=(1:C'LIST OF BANK BY BRANCH',/,X,/,
1:C'SORTCODE: ',1,6,/,X,/,
1:C'ACCOUNT',10:C'BALANCE',20:C'OWNER NAME',/,
1:C'-------',10:C'-------',20:C'----------'),
TRAILER3=(X,/,
1:C'BRANCH TOTAL: ',16:TOT=(11,4,BI,EDIT=(SIIIITTT),SIGNS=(,-)))),
TRAILER1=(X,/,1:C'GRAND TOTAL: ',TOT=(11,4,BI,
EDIT=(SIIIITTT),SIGNS=(,-))),
OUTREC=(1:7,4,BI,TO=ZD,LENGTH=8,10:11,4,BI,EDIT=(SIIIITTT),
SIGNS=(,-),20:15,32)
/*
您可以通過以下鏈接找到更多有關的部分,HEADER3和TRAILER3:https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.iceg200/ice2cg_Sections.htm
NVM,整理出來。非常感謝。 –