Page 1 of 2

Abend U4038 - How to Fix?

PostPosted: Sun Feb 10, 2008 1:09 am
by anoopm7
I know this issue has been already raised.But to be frank i couldnt get the soloution for error from there.I got an abend U4038 when the job ran.It seems there is some problem with the I/o file.But iam not clear regarding that.
Can anyone help me out to clear of U4038 abend.

thanks in advance.

Re: Abend U4038

PostPosted: Sun Feb 10, 2008 6:32 am
by William Thompson
You will have to look a little deeper into why you got the U4038....
ABENDs in Language Environment OS/390 & VM: An ABEND is still a problem of some type and the application will be notified of such a problem. There have been some changes in the way in which COBOL/MVS programs run. They now run in what is called a common execution environment, the actual name is Language Environment OS/390 & VM or LE for short. LE sets up the environment which includes acquiring memory, handling errors, and other functions. Before OS/VS COBOL did all these functions itself, and if it ran into a problem it simply gave the user a dump. With COBOL/MVS and LE you actually get more explicit information. COBOL/MVS identifies the problem even down to the statement level and notifies LE it found an application error. LE does not ABEND like OS/VS COBOL did, however it passes back to the user a return code indicating the application did not run as designed. In most cases a return code of U4038 will be issued. The U4038 means the application ended with a software raised or user raised condition of severity 2 or greater.

Re: Abend U4038

PostPosted: Mon Feb 11, 2008 2:19 am
by dick scherrer
Hello,

For us to be able to help, you need to provide information for us to use to help you.

Somewhere there is more than the 4038 available. As Bill already mentioned, the 4038 is far too generic to use alone to diagnose a problem.

Posting your jcl, some information about the process, and any diagnostic info from anywhere in the output would be a good start.

Is this a new process or one that has worked successfully before? Was the process recently changed?

Re: Abend U4038

PostPosted: Wed Feb 13, 2008 3:24 pm
by anoopm7
Sorry for the delay in poasting the details.
The program is one successfully running in production and which hasnt been changed for more then 2 years.The abend aid describes as below.

PSTY0040 JSTY0010 - ABEND=S000 U4038 REASON=00000001 701

Some one please pull me out of this.

Thanks in advance.

Re: Abend U4038

PostPosted: Wed Feb 13, 2008 5:33 pm
by anoopm7
to add to the above.There is a sort step above the step which has the program.The output from the sort step does have only one input(seems a header)..I got the below reason for u4038..iam not sure whether this is the reason.

We have a Production job that occasionally abends with U4038 and the LE
messages showing the underlying cause to be a File Status 46. According
to the Enterprise COBOL V3R3 Language Reference, the status 46 means:

"A sequential READ statement was attempted on a file open in the input
or I-O mode and no valid next record had been established because:
° The preceding READ statement was unsuccessful but did not cause an
at-end condition.
° The preceding READ statement caused an at-end condition."

When the abend occurs, the preceding jobstep (DFSORT) created an empty
sequential dataset; i.e., the //SORTOUT DD statement gives a DSN= and a
DISP=(NEW,CATLG), and the //SORTIN dataset contained zero records.

HOWEVER, the abending program is coded to accept an empty input dataset
(the SORTOUT from the preceding jobstep), and usually handles it
gracefully. To make matters worse, we cannot seem to be able to
reproduce the File Status=46 condition, no matter how we define the
empty dataset (in the Production environment it is an SMS-managed
dataset). Every test attempt returns a "normal EOF" (File status = 10)
on first read.


Thanks in advance.

Re: Abend U4038

PostPosted: Wed Feb 13, 2008 11:29 pm
by dick scherrer
Hello,

I'd suggest a long look at the cobol program that abends.

It sounds like there is a way for the code to issue a READ when a READ is not valid.

Is there more than one read for the file in the code? Typically, it is best practice to have only one read statement. Often, where there are multiple READ statements in the code, one is executed when it should not be. . .

Re: Abend U4038

PostPosted: Wed Feb 13, 2008 11:38 pm
by CICS Guy
I'd go with a second read after EOF on the first read.....Check the program logic. Possibly temporarily adding a display of the file status to sysout after each read. Possibly just displaying when the status is non zero.

Re: Abend U4038

PostPosted: Thu Feb 14, 2008 1:29 pm
by anoopm7
guys thanks for the quick response..
The abend was due to the missing of STOPaft statment in the program.Since this was the first time the program was running on this loop it abended.

Thanks for the response :)

Re: Abend U4038

PostPosted: Thu Feb 14, 2008 8:43 pm
by dick scherrer
You're welcome :)

Thank you for posting the resolution.

d

Re: Abend U4038

PostPosted: Wed Jul 09, 2008 2:15 am
by nagamani
i think region size is insuffient to runthe job.job was automatically abend.