It compiled successfully. While running the program its giving ABEND4038. In output dataset it was mentioned
There was an unsuccessful OPEN or CLOSE of file SFILE in program TSTF01 at relative location x’03DC’. Neither FILE STATUS nor an ERROR declarative were specified. The status code was 90. From compile unit TSTF01 at entry point TSTF01 at compile unit offset +000003DA at entry offset +000003DA at address 14F00EDA.
Here is the source code
FILE-CONTROL.
SELECT STUDENTFILE ASSIGN TO SFILE
ORGANIZATION IS LINE SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD STUDENTFILE
RECORDING MODE IS F
LABEL RECORDS ARE STANDARD.
01 STUDENTDETAILS.
02 STUDENTID PIC 9(7).
02 STUDENTNAME.
03 SURNAME PIC X(8).
03 INITIALS PIC XX.
02 DATEOFBIRTH.
03 YOBIRTH PIC 9(4).
03 MOBIRTH PIC 9(2).
03 DOBIRTH PIC 9(2).
02 COURSECODE PIC X(4).
02 GENDER PIC X.
PROCEDURE DIVISION
OPEN INPUT STUDENTFILE.
READ STUDENTFILE INTO WS-STUDENTDETAILS
AT END MOVE 'Y' TO WS-END-OF-FILE.
PERFORM PARA-DISPLAY THRU PARA-DISPLAY-END
UNTIL WS-END-OF-FILE = 'Y'.
CLOSE STUDENTFILE.
STOP RUN.
PARA-DISPLAY.
DISPLAY STUDENTID SPACE STUDENTNAME SPACE.
DISPLAY COURSECODE SPACE YOBIRTH.
READ STUDENTFILE INTO WS-STUDENTDETAILS
AT END MOVE 'Y' TO WS-END-OF-FILE.
PARA-DISPLAY-END.
EXIT.
SELECT STUDENTFILE ASSIGN TO SFILE
ORGANIZATION IS LINE SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD STUDENTFILE
RECORDING MODE IS F
LABEL RECORDS ARE STANDARD.
01 STUDENTDETAILS.
02 STUDENTID PIC 9(7).
02 STUDENTNAME.
03 SURNAME PIC X(8).
03 INITIALS PIC XX.
02 DATEOFBIRTH.
03 YOBIRTH PIC 9(4).
03 MOBIRTH PIC 9(2).
03 DOBIRTH PIC 9(2).
02 COURSECODE PIC X(4).
02 GENDER PIC X.
PROCEDURE DIVISION
OPEN INPUT STUDENTFILE.
READ STUDENTFILE INTO WS-STUDENTDETAILS
AT END MOVE 'Y' TO WS-END-OF-FILE.
PERFORM PARA-DISPLAY THRU PARA-DISPLAY-END
UNTIL WS-END-OF-FILE = 'Y'.
CLOSE STUDENTFILE.
STOP RUN.
PARA-DISPLAY.
DISPLAY STUDENTID SPACE STUDENTNAME SPACE.
DISPLAY COURSECODE SPACE YOBIRTH.
READ STUDENTFILE INTO WS-STUDENTDETAILS
AT END MOVE 'Y' TO WS-END-OF-FILE.
PARA-DISPLAY-END.
EXIT.
Why it is abending? Please suggest the solution.
Thanks