Page 2 of 2

Re: Problem COBOL - CICS Program gives ABEND 4038

PostPosted: Mon Jul 30, 2018 8:46 pm
by enrico-sorichetti
You were already told NOT to use screen shots ...
the clutter the topic and waste space
and to use the code tags to post code :evil:

help people who spend their time helping You

Re: Problem COBOL - CICS Program gives ABEND 4038

PostPosted: Mon Jul 30, 2018 9:45 pm
by rogerb
Good afternoon enrico.
I'm sorry, I'm new here and I'm still learning how to use this.
The code tags you mention are these ?

"[code][/code]"

Thank you,
Roger

Re: Problem COBOL - CICS Program gives ABEND 4038

PostPosted: Mon Jul 30, 2018 10:39 pm
by Terry Heinze
Yes, when you "POSTREPLY", click on BBCode near the right edge of the screen to learn how to use the various formatting options.

Re: Problem COBOL - CICS Program gives ABEND 4038

PostPosted: Mon Jul 30, 2018 10:57 pm
by rogerb
Good afternoon.
Thank you for your answers.
Roger

Re: Problem COBOL - CICS Program gives ABEND 4038

PostPosted: Mon Jul 30, 2018 11:28 pm
by Robert Sample
This is NOT a CICS program -- because CICS COBOL programs NEVER have a FILE-CONTROL, nor a FILE SECTION, nor a SELECT. The fact that you have invalid coding in your program alone explains the U4038 ABEND. CICS handles all allocations / deallocations / opens / closes for the application program. https://www.ibm.com/support/knowledgece ... rview.html is a link to one version of the CICS Application Programming Guide which tells you how to code CICS programs. I recommend you read it very carefully.

Re: Problem COBOL - CICS Program gives ABEND 4038

PostPosted: Mon Jul 30, 2018 11:57 pm
by Robert Sample
Do you mean that application programmers are not usually allowed to look at CEEMSG, or do you mean they do not usually know how to look at it? Anyway, the OP's code mentions Hercules as the source and object computer, so I would assume he should be able to look at CEEMSG.
Many sites restrict access to the CICS region jobs, but also many do not understand how to find and look at LE output. And since it is a violation of IBM's licensing for z/OS and CICS as well as copyright laws to run CICS on Hercules, I would hope the topic starter is not actually doing so. But if Hercules is running CICS, then certainly it should be possible to look at the LE output in the CICS job.

Re: Problem COBOL - CICS Program gives ABEND 4038

PostPosted: Tue Jul 31, 2018 12:59 am
by rogerb
Good afternoon.
When I studied COBOL, all the programs I created to use files always had FILE-CONTROL(with SELECT) and FILE SECTION.
In those programs, I even had to include instructions in the COBOL program to open and close the file.
Those programs weren't created for CICS.
I knew that the CICS controls the opening and closing of the file by itself, but I believed that FILE-CONTROL and FILE SECTION were always needed.
Today, I've seen in a page that a COBOL CICS program should not have ENVIRONMENT DIVISION, so I'm going to remove that entire division.
I'm also going to remove the FILE SECTION.
I hope this solves the problem.
Thank you all,
Roger

Re: Problem COBOL - CICS Program gives ABEND 4038

PostPosted: Tue Jul 31, 2018 10:38 pm
by rogerb
Good afternoon to everybody.
Mr. Robert Sample nailed it.
After removing the ENVIRONMENT DIVISION and the FILE SECTION, the program executes and shows the map.
So the ABEND 4038 is solved.
Unfortunately now I have another problem, but because it is a problem with VSAM, I'm going to ask it in the VSAM section.
However I would like to ask for your advice on the matter of the storage violation.
In your opinion what is the best practice to avoid storage violation ?
I would like to give thanks to everybody.
Roger

Re: Problem COBOL - CICS Program gives ABEND 4038

PostPosted: Tue Jul 31, 2018 11:53 pm
by Robert Sample
In your opinion what is the best practice to avoid storage violation ?
Storage violations can be caused by a number of factors:
- accessing invalid memory
- mismatch between AMODE/RMODE of calling and called program
- table overflows
- DFHCOMMAREA length errors
- using pointers incorrectly

I'm not convinced that all storage violations can be avoided. It is more important to recognize them when they occur and where to look to fix them. And one of the nasty things about storage violations is that when one occurs, innocent programs might be affected and showing the violation when the actual culprit is a different program entirely.