PL/I for AIX

 View Only
  • 1.  PL/I function like unix strerror() to get a ONCODE text?

    Posted Sun December 16, 2012 03:32 AM

    Originally posted by: JustAFreeName


     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
     
     
     
     


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

    Posted Sun December 16, 2012 06:13 AM

    Originally posted by: Robin400


     The SNAP option on the ON statement provides an English-language explanation of
    the error when the error occurs.


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

    Posted Mon December 17, 2012 04:06 AM

    Originally posted by: JustAFreeName


     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


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

    Posted Mon December 17, 2012 07:40 AM

    Originally posted by: Robin400


     You can append the file of error messages to your log file when the job finishes.


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

    Posted Mon December 17, 2012 11:49 AM

    Originally posted by: JustAFreeName


     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 
     
     
       


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

    Posted Tue December 18, 2012 06:46 AM

    Originally posted by: Robin400


      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.


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

    Posted Tue December 18, 2012 11:28 AM

    Originally posted by: JustAFreeName


     Hi Robin400.
     
    Thx. I'll goon with this information and try to do my very best. 
     
    Over and Out.
    JustAFreeName