ABEND U4038, Status code was 90



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

ABEND U4038, Status code was 90

Postby vivek naik » Tue Mar 06, 2012 6:44 pm

I wrote a cobol program which reads an input file and displays the result.
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.     


Why it is abending? Please suggest the solution.

Thanks
Working On A Dream
vivek naik
 
Posts: 6
Joined: Wed Jan 18, 2012 11:24 am
Has thanked: 0 time
Been thanked: 0 time

Re: ABENDU4038 IN READING A FILE

Postby MrSpock » Tue Mar 06, 2012 7:12 pm

I'm not a COBOL guy, but I don't think:

ORGANIZATION IS LINE SEQUENTIAL.

belongs there. I'd think it would just be:

FILE-CONTROL.                           
    SELECT STUDENTFILE ASSIGN TO SFILE .
User avatar
MrSpock
Global moderator
 
Posts: 807
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: ABENDU4038 IN READING A FILE

Postby Robert Sample » Tue Mar 06, 2012 7:13 pm

1. Add a file status clause to your file SELECT stateement.
2. Query the file status when you do the open. You will find the file status is not zero, which means your file cannot be read.
3. Why are you using LINE SEQUENTIAL organization instead of SEQUENTIAL?
4. Why it is abending is explained -- CLEARLY -- in the error message:
There was an unsuccessful OPEN or CLOSE of file SFILE in program TSTF01
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: ABENDU4038 IN READING A FILE

Postby BillyBoyo » Tue Mar 06, 2012 7:42 pm

The "90" in the error messages indicates you have a VSAM file. Getting rid of the "LINE SEQUENTIAL" and using what VSAM wants will help you out.

As well as coding the FILE-STATUS as Robert has suggested, there is an extended file-status for VSAM which you should look up in the manual and code in your program.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: ABENDU4038 IN READING A FILE

Postby vivek naik » Wed Mar 07, 2012 11:39 am

@Robert : Thank you!! I worked on every suggestion you made and it worked perfectly.

@MrSpock & @BilyBoyo : Thank you!!
Working On A Dream
vivek naik
 
Posts: 6
Joined: Wed Jan 18, 2012 11:24 am
Has thanked: 0 time
Been thanked: 0 time

Re: ABENDU4038 IN READING A FILE

Postby Monitor » Thu Mar 08, 2012 2:08 pm

Comment: Organization is Line Sequential is used when your COBOL program runs in e.g. Windows, where there is nothing like logical record length and record format, records are separated by the New Line (NL) ascii character. If you still use Line Sequential in z/OS, you get File Status 90.
Monitor
 
Posts: 98
Joined: Wed Jan 18, 2012 8:59 pm
Has thanked: 0 time
Been thanked: 7 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post