Page 1 of 2

Getting abend ABENDU0476 in COBOL-IMS DB program

PostPosted: Wed May 09, 2012 5:18 pm
by jithinraghavan
Hi,

I am getting ABENDU0476 for a job which using COBOL-IMS program.
It contains the following statement in the COBOL program

PROCEDURE DIVISION.
ENTRY 'DLITCBL' USING IO-PCB,
IO-PCB2,
MED-PCB.

When I changed this into
PROCEDURE DIVISION USING IO-PCB
IO-PCB2
MED-PCB.

Then the job went fine. Could you please tell me the issue in the first statement?

Re: Getting abend ABENDU0476 in COBOL-IMS DB program

PostPosted: Wed May 09, 2012 6:23 pm
by Akatsukami
Why did you think that the ENTRY statement would be necessary?

Re: Getting abend ABENDU0476 in COBOL-IMS DB program

PostPosted: Wed May 09, 2012 7:33 pm
by jithinraghavan
I don't think ENTRY statement is necessary. But My question is why the abend is coming when I put the ENTRY statement?

Re: Getting abend ABENDU0476 in COBOL-IMS DB program

PostPosted: Wed May 09, 2012 7:42 pm
by Akatsukami
jithinraghavan wrote:I don't think ENTRY statement is necessary. But My question is why the abend is coming when I put the ENTRY statement?

Simply, because the parameters (USING...) applied to the alternate and incorrect entry point, not to the application program. When the program was called, it did not receive the PCB address; this caused the abend.

Re: Getting abend ABENDU0476 in COBOL-IMS DB program

PostPosted: Wed May 09, 2012 8:12 pm
by jithinraghavan
Second time I just removed ENTRY 'DLITCBL' and the job works fine. So you mean to say we are not supposed to code ENTRY 'DLITCBL' USING after PROCEDURE DIVISION for an COBOL-IMS program?Instead use only USING?

Re: Getting abend ABENDU0476 in COBOL-IMS DB program

PostPosted: Wed May 09, 2012 8:16 pm
by BillyBoyo
If you put all the same parameters on the ENTRY USING and PROCEDURE DIVISION USING then the program will work (as far as getting the linkage, anyway) whether called as the main program or called as the entry. If you don't have anything on the PROCEDURE DIVISION USING then if you call it as the prorgam name, no linkage will be established. The ENTRY statement is not executable, the compiler generates code to avoid it unless the ENTRY is used in a CALL.

If the ENTRY is not needed, get rid of it.

Re: Getting abend ABENDU0476 in COBOL-IMS DB program

PostPosted: Wed May 09, 2012 8:25 pm
by Akatsukami
jithinraghavan wrote:Second time I just removed ENTRY 'DLITCBL' and the job works fine. So you mean to say we are not supposed to code ENTRY 'DLITCBL' USING after PROCEDURE DIVISION for an COBOL-IMS program?Instead use only USING?

That is correct.

Re: Getting abend ABENDU0476 in COBOL-IMS DB program

PostPosted: Wed May 09, 2012 9:04 pm
by jithinraghavan
Thanks for your replies...

Re: Getting abend ABENDU0476 in COBOL-IMS DB program

PostPosted: Thu May 10, 2012 12:34 am
by Ed Goodman
You guys just blew my mind. Every IMS program I've ever used/written has the ENTRY format. I didn't even know that it was optional.

When we get U0476 around here, it's because the link-edit step did not have the
LIBRARY SDFSRESL(CBLTDLI) or
ENTRY DLITCBL
entries from the IMS PROCLIB(CBLTDLI) member.

Re: Getting abend ABENDU0476 in COBOL-IMS DB program

PostPosted: Thu May 10, 2012 12:49 am
by Akatsukami
Ed Goodman wrote:You guys just blew my mind. Every IMS program I've ever used/written has the ENTRY format. I didn't even know that it was optional.

I've never seen one that did use it. In fact, local standards forbid the use of alternate entry points (not that my shop actually enforces standards or anything like that, but no one has seen a need to break that one).