ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Detecting Program Receiving SQL0204 (File Not Found) In Web Job

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Detecting Program Receiving SQL0204 (File Not Found) In Web Job

    I am monitoring some of our Apache server jobs for messages related to some programming changes I made. However, I am seeing a lot of SQL0204 (file not found) messages that do not tell me which program was attempting to query the file. Here is the message in it's entirety:

    Code:
    Message ID . . . . . . :   SQL0204                                            
    Date sent  . . . . . . :   07/23/19      Time sent  . . . . . . :   10:56:51  
    
    Message . . . . :   MYFILE in *LIBL type *FILE not found.                    
    
    Cause . . . . . :   MYFILE in *LIBL type *FILE was not found. If the member  
      name is *ALL, the table is not partitioned. If this is an ALTER TABLE       
      statement and the type is *N, a constraint or partition was not found. If   
      this is not an ALTER TABLE statement and the type is *N, a function,        
      procedure, trigger or sequence object was not found.                        
        If a function was not found, MYFILE is the service program that contains 
      the function.  The function will not be found unless the external name and  
      usage name match exactly.  Examine the job log for a message that gives more
      details on which function name is being searched for and the name that did  
      not match.
    When I view message details, the from and to programs are QSQRUN2, procedure CK_DEBUG.

    Is there a way to determine which program caused this error without scanning all source for missing table? To be clear, this file does exist, but somehow the library list is not being set properly (or is corrupted). We do not use *JOBD's to drive library lists (unfortunately).

  • #2
    If these are active jobs, you can view the call stack to see what is calling QSQRUN2.

    Comment


    • #3
      Originally posted by Scott Klement View Post
      If these are active jobs, you can view the call stack to see what is calling QSQRUN2.
      It would be over 50+ programs that do that. Most of our "RPG" programs using "exec sql" in some form or fashion. Unless there is some sort of way to get the job to auto-dump the call stack each time it's active...
      ?

      Comment


      • #4
        I'm not sure that I understand. Are you saying that your programs are getting the error, but ignoring it and not halting, not asking the user for help, or anything else that would pause the program so you could stop an look at the call stack to see which program is active?

        If so, that's a bad situation, and the programming style and standards should be improved. You should never just ignore errors and keep running.

        But, assuming that is the situation, here's something you could try (I haven't tried it myself), Set a watch (STRWCH) on that message id, and when it happens have a little program that runs DSPJOB to dump the call stack, then send it (or send a message, etc) to someone who could look into the problem.

        Comment


        • #5
          As long as we are clear that these programs are not "mine" and were not created by me. I'm only detecting these errors in the job logs of the web instance because i'm debugging one of my programs.

          Comment

          Working...
          X