Hi,
Some logic missed in program or some problem.
Please help me to resolve the abend U4038 in my cobol program. Program compilation was successfull but while running the program U4038 abend occured.
Following is the error message displayed in the spool with the compile and offset details.
"The flow of control in program proceeded beyond the last line From compile unit entry point"
Program:
IDENTIFICATION DIVISION.
PROGRAM-ID. EMPPARM.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT EMPLOYEE-FILE ASSIGN TO EMPIN.
SELECT DEPARTMENT-FILE ASSIGN TO DEPTMAST
ORGANIZATION IS INDEXED
ACCESS MODE IS RANDOM
RECORD KEY IS DEPARTMENT-ID.
SELECT OUTPUT-FILE ASSIGN TO OUTFILE.
DATA DIVISION.
FILE SECTION.
FD EMPLOYEE-FILE.
COPY EMPREC.
FD DEPARTMENT-FILE.
COPY DEPTREC.
FD OUTPUT-FILE.
01 OUTPUT-RECORD PIC X(80).
WORKING-STORAGE SECTION.
01 FLAGS-AND-SWITCHES.
05 END-OF-FILE PIC XXX VALUE 'NO'.
88 AT-END-OF-EMPLOYEE-FILE VALUE 'YES'.
88 NOT-AT-END-OF-EMPLOYEE-FILE VALUE 'NO'.
01 WS-PARA-NAME PIC X(20).
LINKAGE SECTION.
*01 JCL-PARM-DATA.
* 05 PARM-LENGTH PIC S9(04) COMP.
PROCEDURE DIVISION.
0000-MAIN.
MOVE "0000-MAIN" TO WS-PARA-NAME
PERFORM 1000-HOUSEKEEPING THRU
1000-HOUSEKEEPING-EXIT
PERFORM 2000-PROCESS-EMPLOYEE THRU
2000-PROCESS-EMPLOYEE-EXIT
UNTIL AT-END-OF-EMPLOYEE-FILE
PERFORM 3000-CLEANUP THRU
3000-CLEANUP-EXIT
STOP RUN.
1000-HOUSEKEEPING.
MOVE '1000-HOUSEKEEPING' TO WS-PARA-NAME
OPEN INPUT EMPLOYEE-FILE
INPUT DEPARTMENT-FILE
OUTPUT OUTPUT-FILE.
1000-HOUSEKEEPING-EXIT. EXIT.
2000-PROCESS-EMPLOYEE.
MOVE '2000-PROCESS-EMPLOYEE' TO WS-PARA-NAME
PERFORM 2300-READ-EMP-REC THRU
2300-READ-EMP-REC-EXIT
PERFORM 2600-LOOKUP-DEPT THRU
2600-LOOKUP-DEPT-EXIT
PERFORM 2800-WRITE-OUTPUT THRU
2800-WRITE-OUTPUT-EXIT.
2000-PROCESS-EMPLOYEE-EXIT. EXIT.
2300-READ-EMP-REC.
MOVE '2300-READ-EMP-REC' TO WS-PARA-NAME
READ EMPLOYEE-FILE
AT END
SET AT-END-OF-EMPLOYEE-FILE TO TRUE
GO TO 2800-WRITE-OUTPUT-EXIT
2300-READ-EMP-REC-EXIT. EXIT.
2600-LOOKUP-DEPT.
MOVE '2600-LOOKUP-DEPT' TO WS-PARA-NAME
MOVE DEPT-ID TO DEPARTMENT-ID
READ DEPARTMENT-FILE
INVALID KEY
DISPLAY 'DEPT NOT FOUND'
GO TO 2800-WRITE-OUTPUT-EXIT EXIT
END-READ
READ EMPLOYEE-FILE NEXT RECORD
AT END
SET AT-END-OF-EMPLOYEE-FILE TO TRUE
END-READ.
2600-LOOKUP-DEPT-EXIT. EXIT.
2800-WRITE-OUTPUT.
MOVE '2800-WRITE-OUTPUT' TO WS-PARA-NAME
STRING
EMPLOYEE-NAME DELIMITED BY SIZE
' ' DELIMITED BY SIZE
DEPARTMENT-NAME DELIMITED BY SIZE
INTO OUTPUT-RECORD
WRITE OUTPUT-RECORD.
2800-WRITE-OUTPUT-EXIT. EXIT.
3000-CLEANUP.
MOVE '2800-WRITE-OUTPUT' TO WS-PARA-NAME
CLOSE EMPLOYEE-FILE
CLOSE DEPARTMENT-FILE
CLOSE OUTPUT-FILE.
3000-CLEANUP-EXIT. EXIT.
JCL:
//MUTHULA JOB (ABCDE),'QUASAR CHUNA',MSGCLASS=Y,
// MSGLEVEL=(1,1),CLASS=A,NOTIFY=&SYSUID,REGION=200M
//*-------------------------------------------------
//JOBLIB DD DSN=MUTHULA.DEMO.LOADLIB,DISP=SHR <== Load Library
//STEP01 EXEC PGM=EMPPARM <== Load Module Name
//EMPIN DD DSN=AGY0157.EMPLOYEE.DATA,DISP=SHR
//DEPTMAST DD DSN=AGY0157.DEPT.MASTER.DATA,DISP=SHR
//OUTFILE DD DSN=MUTHULA.SEQ.EMP.OUT,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(10,10,01)),
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=800),
// UNIT=SYSDA
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//
Let me know if i have done something irrelevant.