Topic
6 replies Latest Post - ‏2012-12-18T16:27:41Z by JustAFreeName
JustAFreeName
JustAFreeName
10 Posts
ACCEPTED ANSWER

Pinned topic PL/I function like unix strerror() to get a ONCODE text?

‏2012-12-16T08:31:45Z |
 Hi all!
 
I have to write a PL/1 programm on z/OS. Having a Unix/C background this task has some challenges.
 
With PL/1 error conditions are signalled with ONCODES. 
What I really would like to have is a PL/1 function which hands back an ONCODE-text for a ONCODE number.
This function should work like strerror() under unix.
I checked the documentation, but I was unable to find such a function.
 
Being a newbie in this universe,  maybe I overlooked the matching part of the PL/1 documentation.
 
Thx for any feedback.
JustAFreeName
 
 
 
 
Updated on 2012-12-18T16:27:41Z at 2012-12-18T16:27:41Z by JustAFreeName
  • Robin400
    Robin400
    29 Posts
    ACCEPTED ANSWER

    Re: PL/I function like unix strerror() to get a ONCODE text?

    ‏2012-12-16T11:12:38Z  in response to JustAFreeName
     The SNAP option on the ON statement provides an English-language explanation of
    the error when the error occurs.
    • JustAFreeName
      JustAFreeName
      10 Posts
      ACCEPTED ANSWER

      Re: PL/I function like unix strerror() to get a ONCODE text?

      ‏2012-12-17T09:06:08Z  in response to Robin400
       Dear Robin400.
       
      Thx for your   advice. As far as I understand the PL1 manual, the SNAP information is written to sysout. I would like to get the error text in my program and do the error handling on my own (which is to setup an error message and store it in a log database).     Is this somehow possible? JustAFreeName
      • Robin400
        Robin400
        29 Posts
        ACCEPTED ANSWER

        Re: PL/I function like unix strerror() to get a ONCODE text?

        ‏2012-12-17T12:39:47Z  in response to JustAFreeName
         You can append the file of error messages to your log file when the job finishes.
        • JustAFreeName
          JustAFreeName
          10 Posts
          ACCEPTED ANSWER

          Re: PL/I function like unix strerror() to get a ONCODE text?

          ‏2012-12-17T16:48:53Z  in response to Robin400
           Dear Robin400.
           
          I'll work with this information.  Thx for the guideline. 
           
          By the way: Before open the next Post, is there a similar mechanism for PLISAXA()?
           
          PLISAXA throws events.
          There is a special event, E24 TYPE EVENT_EXCEPTION INIT( EXCEPTION ) 
          One Parameter is the ERRORID. The values are explained in the Programmer's Guide,
          but it would be more handy to provide a readable information instead of an error number.
           
          Example : 
          ERRORID = 1 has the meaning
          "The parser found an invalid character while scanning white space outside element content." 
           
          Do you have an adive for this as well? 
           
          Thx JustAFreeName 
           
           
             
          • Robin400
            Robin400
            29 Posts
            ACCEPTED ANSWER

            Re: PL/I function like unix strerror() to get a ONCODE text?

            ‏2012-12-18T11:45:36Z  in response to JustAFreeName
              PLISAXA etc are built-in subroutines, and as such deal with events in their own
            way.  It's not part of the exception mechanism of the language.
            • JustAFreeName
              JustAFreeName
              10 Posts
              ACCEPTED ANSWER

              Re: PL/I function like unix strerror() to get a ONCODE text?

              ‏2012-12-18T16:27:41Z  in response to Robin400
               Hi Robin400.
               
              Thx. I'll goon with this information and try to do my very best. 
               
              Over and Out.
              JustAFreeName