Program to accept data and split it.
IDENTIFICATION
DIVISION.
PROGRAM-ID. ACPTDISP.
AUTHOR. KK.
DATE-WRITTEN. 11-11-1111.
SECURITY.
A SAMPLE PROGRAM TO ACCEPT AND DISPLAY.
DATA
DIVISION.
WORKING-STORAGE
SECTION.
01 STUDREC.
02 STUDRLNO
PIC 9(6).
02 STUDNAME
PIC A(10).
02
SUBJ.
05 SUB01
PIC 9(4).
05 SUB02
PIC 9(4).
05 SUB03
PIC 9(4).
PROCEDURE
DIVISION.
0000-MAIN
SECTION.
1000-ACCEPT-PARA.
ACCEPT
STUDREC.
DISPLAY
"ROLL NUMBER IS " STUDRLNO.
DISPLAY "NAME IS " STUDNAME.
DISPLAY "SUB01 IS" SUB01.
DISPLAY "SUB02 IS" SUB02.
DISPLAY "SUB03 IS" SUB03.
2000-EXIT-PARA.
STOP
RUN. STOP RUN.
//* Compile the cobol code
//usernm JOB 'Training','KK',NOTIFY=&SYSUID,
// MSGCLASS=X,MSGLEVEL=(2,0)
//STEP1 EXEC PROC=IGYWCL
//COBOL.SYSIN DD DSN=usernm.JAN.COBOLPGM(studrecd),DISP=SHR
//LKED.SYSLMOD DD
// DSN=usernm.JAN.COBOLPGM.LOADLIB(studrecd),
// DISP=SHR
//* Run the code
//usernm JOB 'Training','KK',NOTIFY=&SYSUID
//JOBLIB DD
DSN=usernm.JAN.COBOLPGM.LOADLIB,DISP=SHR
//STEP1 EXEC PGM=STUDRECD
//SYSIN DD *
123456KATRINA
1076 35 56
/*
//
Output seen in SPOOL is ( TSO SDSF ST)
Output seen in SPOOL is ( TSO SDSF ST)
ROLL NUMBER IS 123456
NAME IS KATRINA
SUB01 IS1076
SUB02 IS 35
SUB03 IS 56
No comments:
Post a Comment