Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

U0476 abend when writing output file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: U0476 abend when writing output file
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

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Aug 18, 2011 12:04 pm    Post subject:
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: 1715
Location: UK

PostPosted: Thu Aug 18, 2011 12:08 pm    Post subject:
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    Post subject:
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

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Aug 18, 2011 12:20 pm    Post subject:
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    Post subject:
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

Active Member


Joined: 07 Feb 2009
Posts: 984
Location: Oostende, Belgium

PostPosted: Thu Aug 18, 2011 3:17 pm    Post subject:
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: 1715
Location: UK

PostPosted: Thu Aug 18, 2011 6:10 pm    Post subject:
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

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Aug 18, 2011 6:33 pm    Post subject:
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: 1715
Location: UK

PostPosted: Thu Aug 18, 2011 11:23 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us