PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 06/19/2014 11:23 PM by  ArthurThum
Forcing ERROR from User Exit
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages
ArthurThum
Private
Independent Consultant
Advanced Member
(59 points)
Advanced Member
Posts:25


Send Message:

--
09/12/2013 9:04 AM
    I have an error condition that I would like the beginning USER EXIT to pass back to PA52. I am Setting CRT-ERROR-NBR = 106, CRT-ERROR-CAT ="PA52B", CRT-ERR-VAR1, CRT-ERR-VAR2

    When I animate the program, as soon as the user exit exits and returns to PA52, the error variables are reset and the error is not passed along.
    What do I need to code to force ANY error to appear?
    Tags: 4GL DEVELOPMENT USER EXIT
    ArthurThum
    Private
    Independent Consultant
    Advanced Member
    (59 points)
    Advanced Member
    Posts:25


    Send Message:

    --
    06/19/2014 11:23 PM
    OK This post was out here for awhile and it was finally identified that that there was an error and this is what is happening.
    If you call a user exit you need to make sure that if your user exit contains nested procedures, you need to back out of all nested procedures before exiting the user exit.. What happened was this was not being done. When the code tried to exit, the user exit abended thereby wiping out all error messages and returns that were set up. The linkage section returning from the user exit gets reinitialized but there was no way to tell this is what was happening. so for example:
    ENTER USER EXIT ----PERFORM PROCEDURE A through A-END, this procedure PERFORM PROCEDURE B through B-END, this procedure PERFORM PROCEDURE C through C-END. You desire to exit because of some issue but instead of exiting immediately from within PROCEDURE C, you need to set a flag exit the PROCEDURE at C-END, then B-END and finally A-END which allows a smooth exit of the user exit back to the main procedure.
    Took awhile to find this one!
    You are not authorized to post a reply.