IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

U0476 abend when writing output file


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
harithb

New User


Joined: 08 Jun 2009
Posts: 15
Location: Bangalore

PostPosted: Thu Aug 18, 2011 11:32 am
Reply with quote

Hi,

I have a PL/I program which has one input file and one output file. Initially this program had logic to query DB2 table and based on the results from the query an output file had to be created.

Now we have a new requirement where we need to update an IMS database also in the same program. I included the steps for the same but when running the program it is abending with U0476.

I have put the PUT SKIP LIST statements in all the procs and see that everything related to IMS proc is working fine and is updating the IMS database correctly.

The abend is occurring when the trailer record of the file is being written. This is the last proc which is being executed in the program.

WRITE_SP_RECORD: PROC REORDER;
/**********************************************************/
/* WRITE A CFRF01O_RECORD_SP */
/**********************************************************/

PUT SKIP LIST ('INSIDE WRITE_SP ');
WRITE FILE(CFRF01O) FROM (CFRF01O_RECORD_SP);
OUTPUT_COUNTER = OUTPUT_COUNTER + 1;
PUT SKIP LIST ('AFTER WRITE_SP ');

END WRITE_SP_RECORD;

It is displaying the message INSIDE WRITE_SP but not displaying the message after the write statement. Also, I checked the output file but it doesn't have the trailer record.

Please let me know what might be the possible reason for this. Thank you!
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu Aug 18, 2011 12:04 pm
Reply with quote

The fact that you can't see either the PUT SKIP after the write or the record in the file is probably because both are still in buffers at the time of the abend. The abend is likely happening some time after this section of code.

U0476 is a programmed user abend. There is an IMS U0476 documented and the fact that you have added IMS processing would suggest that this additional processing is causing the abend. Have you some IMS processing after WRITE_SP_RECORD: ?

Code:
0476                                                                         
                                                                             
Explanation:  A DL/I call does not include a valid PCB address. The PCB     
address in the DL/I call (second parameter or third, if count is the first   
parameter) is not one of the PCB addresses passed to the application         
program at its entry point.                                                 
                                                                             
Some possible causes for this failure are:                                   
                                                                             
o   An address for an AIB was provided but the first eight bytes of the     
    block do not equal 'DFSAIB'.                                             
                                                                             
o   The PSB language specified is not the same as that of the application   
    program.                                                                 
                                                                             
o   The call requires a PCB address, but the function is the last entry in   
    the call list.                                                           
                                                                             
o   The address of the PCB in the call is not one of the PCB addresses       
    passed to the application at its entry point.                           
                                                                             
o   An online program issued an UNLD call. The UNLD call is an internal     
    DL/I call and should never be issued by an application program.         
                                                                             
This abend can be the result of an improperly assembled or generated         
application program.                                                         
                                                                             
System Action:  The application program terminates abnormally.               
                                                                           
 Programmer Response:  Correct the parameter list and resubmit the job.     
                                                                           
 o   Change the PSB language specified to that of the application program. 
                                                                           
 o   Correct the application program DL/I call statements.                 
                                                                           
 Problem Determination:  4, 17d                                             
                                                                             
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Aug 18, 2011 12:08 pm
Reply with quote

Also see my reply to your post in the COBOL section. You did not ned to repost - a moderator would have moved it.
Back to top
View user's profile Send private message
harithb

New User


Joined: 08 Jun 2009
Posts: 15
Location: Bangalore

PostPosted: Thu Aug 18, 2011 12:13 pm
Reply with quote

Hi Garry.
There is no IMS processing after this WRITE_SP_RECORD proc.

Hi Nic,
I didnt know about it. Thats why I reposted it in this forum. Sorry for the trouble.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu Aug 18, 2011 12:20 pm
Reply with quote

If this is a trailer record, you could (for example) close the file after the write to cause the buffer to be flushed. Also, repeat the PUT SKIP that's after the write (as Nic suggested - Hi Nic!) so that at least one gets flushed to output.

What other processing, if any, happens after WRITE_SP_RECORD?

Garry.
Back to top
View user's profile Send private message
harithb

New User


Joined: 08 Jun 2009
Posts: 15
Location: Bangalore

PostPosted: Thu Aug 18, 2011 1:31 pm
Reply with quote

Hi All,

Found out the issue. The problem was coming as we missed initializing some of the fields in the INIT section of the program.

Thanks for all your help.

Regards,
Haritha.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Thu Aug 18, 2011 3:17 pm
Reply with quote

harithb wrote:
Found out the issue. The problem was coming as we missed initializing some of the fields in the INIT section of the program.

Please elaborate on this!
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Aug 18, 2011 6:10 pm
Reply with quote

As far as I am aware PL/1 programs do not have sections - let alone INIT sections. Of course, things may have changed in the last 3 years.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu Aug 18, 2011 6:33 pm
Reply with quote

Nic Clouston wrote:
As far as I am aware PL/1 programs do not have sections - let alone INIT sections. Of course, things may have changed in the last 3 years.


My guess, Nic, is that the TS means "init procedure"....

Garry.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Aug 18, 2011 11:23 pm
Reply with quote

Hi Garry,

That is what I was thinking but, as is often stated here, correct terminology is vital in order to get your message across succinctly.
Back to top
View user's profile Send private message
harithb

New User


Joined: 08 Jun 2009
Posts: 15
Location: Bangalore

PostPosted: Thu Aug 18, 2011 11:59 pm
Reply with quote

What I meant was that we missed initializing some of the fields in the proc where all the initializations were being done. Sorry for the confusion !
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 0
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top