IDENTIFICATION DIVISION.
PROGRAM-ID. SMPSORT.
AUTHOR. KK.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT INPFILE ASSIGN TO DD1.
SELECT WRKFILE ASSIGN TO DD2.
SELECT OUTFILE ASSIGN TO DD3.
DATA DIVISION.
FILE SECTION.
FD INPFILE.
01 INP-REC.
05 INP-NO PIC 9(4).
05 INP-NAME PIC X(20).
05 FILLER PIC X(56).
SD WRKFILE.
01 WRK-REC.
05 WRK-NO PIC 9(4).
05 WRK-NAME PIC X(20).
05 FILLER PIC X(56).
FD OUTFILE.
01 OUT-REC.
05 OUT-NO PIC 9(4).
05 OUT-NAME PIC X(20).
05 FILLER PIC X(56).
PROCEDURE DIVISION.
OOO1-MAIN-PARA.
SORT WRKFILE
ON ASCENDING WRK-NO
USING INPFILE
GIVING OUTFILE.
STOP RUN.
//* Compile simple sort
//usermf JOB 'Training','KK',NOTIFY=&SYSUID,
// MSGCLASS=X,MSGLEVEL=(2,0)
//STEP1 EXEC PROC=IGYWCL
//COBOL.SYSIN DD DSN=usermf.JAN.COBOLPG2(COMSORT),DISP=SHR
//LKED.SYSLMOD DD DSN=usermf.JAN.COBOLPGM.LOADLIB(COMSORT),
// DISP=SHR
//* Run simple sort
//STEP1 EXEC PROC=IGYWCL
//COBOL.SYSIN DD DSN=usermf.JAN.COBOLPG2(COMSORT),DISP=SHR
//LKED.SYSLMOD DD DSN=usermf.JAN.COBOLPGM.LOADLIB(COMSORT),
// DISP=SHR
//* Run simple sort
//usermf JOB 'Training','KK',NOTIFY=&SYSUID
//JOBLIB DD DSN=usermf.JAN.COBOLPGM.LOADLIB,DISP=SHR
//STEP1 EXEC PGM=COMSORT
//DD1 DD DSN=usermf.JAN.IMPFILE,DISP=SHR
//DD2 DD DSN=usermf.JAN.DEMO,DISP=SHR
//DD3 DD DSN=usermf.JAN.OUTFILE,DISP=SHR
//*SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//
No comments:
Post a Comment