Plex 2E

 View Only
  • 1.  How to crash as400 job session  if a function call fails?

    Posted May 09, 2017 02:23 AM



    We have a Framework shell with allot of WINC functions  for our front end and AS400 and rpg functions for our back end. Using Plex 7.2.


    What I would like to know or what I am experiencing is when I start the framework(exe) a logon screen is presented that will authenticate the user by calling a rpg function that checks if the user is registered on the system.


    If authentication passes we store the remote job session in a sessions table with the field remote job number (the remote job number on the as400) usually a number for example 1003847.


    Now in the session if the user opens  a screen and for example the screen calls a rpg blockfetch to fetch data from the as400 fails(function not found) the session(server side job) crashes and the very next time the user access something that access the as400 using a rpg function it creates a new remote job with a new remote job number.


    What we would like is that the framework should crash as well and not allow another rpg function to create a new session job number. It sounds funny but I want the the current framework session not to be able to call a new rpg function and start a new remote job. 


    If I end the frameworks session on the back end as400 using wrkactjob on the green screen the framework does not even give the user an error it just spawns a new backend job. I want it to crash if I end the backend job.


    Hope its clear what i am trying to explain.

  • 2.  Re: How to crash as400 job session  if a function call fails?

    Posted May 11, 2017 10:30 AM

    If you check the *Call Status after any call to a server function, you should get an error (Not a blank) if the server crashes.  You can program your client to quit if the *Call Status fails.  This does require an if statement (or a common subroutine) after every server call though...

    I have worked at a place where the standard was ANY function call checked the *Call status and *Returned status.  If the call status was in error, it would set the *Returning Status to a specially defined error code, and go sub terminate.  Thus the calling program could check the *Returned Status for this error code, and quit as well.

  • 3.  Re: How to crash as400 job session  if a function call fails?

    Broadcom Employee
    Posted May 30, 2017 08:57 AM


    currently this can not be done via Plex. Please can you raise this as an Idea on the Idea Wall, so that other customers can also look at it and vote on it. Thanks, Thomas