ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Embedded SQL and the Joblog

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

  • Embedded SQL and the Joblog

    Hi All,

    I have an SQLRPGLE program that uses embedded SQL to loop through a file. All works fine except that when the job is submitted it creates masses of joblogs.

    Yes, multiple logs because they keep filling up, therefore creating a new one.

    My questions are:
    1) How can I prevent the messages "ODP not deleted." and "Embedded SELECT completed." etc. from appearing in the joblog?

    2) If the messages can't be stopped, how do I remove them from the joblog?

    I have found no other specific references to this problem - surely someone out there has encounter the same thing?

    For info: free-form ILE on V5R4 OS

    Many thanks for any help you can provide.

  • #2
    Re: Embedded SQL and the Joblog

    This is a function of job logging, not sql. Change the job description (or just the job) to not log this info.

    These are the parameters that you want to play with;

    PHP Code:
                                   Change Job (CHGJOB)
                                                      
     
    Type choicespress Enter.                       
                                                      
     
    Message logging:                                 
       
    Level  . . . . . . . . . . . .   4             
       Severity 
    . . . . . . . . . . .   99            
       Text 
    . . . . . . . . . . . . .   *MSG          
     Log CL program commands  
    . . . .   *YES 
    This logs everything i do.
    Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

    Comment


    • #3
      Re: Embedded SQL and the Joblog

      Thanks DMW. I changed the job and there is now no joblog. But as a result I lose all messages. There could be important audit stuff lost.

      I am looking to understand why I get the messages in the first place and then how I could remove only certain messages from the log.

      Comment


      • #4
        Re: Embedded SQL and the Joblog

        you could use the QMHRCVPM API to remove the messages as they occur and that should get rid of the offending messages while preserving the messages that you wish to keep.
        I'm not anti-social, I just don't like people -Tommy Holden

        Comment


        • #5
          Re: Embedded SQL and the Joblog

          Thanks for the assistance.

          The issue is now resolved: I actually had an error in the SQL statements I am performing. Hence the joblog [stands to reason, eh?!]

          But, it is one of those errors that isn't really an error, more informational. Basically there was a type mismatch between the SQL column and the i host variable.

          A detailed debug of every SQL statement highlighted this. The fix was straightforward and now there are no joblogs.

          I found it intriguing that the SQL errors were logged and creating physical joblogs but that they are reported as level 00. A different level may have led to my resovling this issue a lot faster.

          But hey, nothing ventured, nothing gained. Suffice to say I will review my SQL more intensely next time

          Comment


          • #6
            Re: Embedded SQL and the Joblog

            Thx for the feedback
            Regards

            Kit
            http://www.ecofitonline.com
            DeskfIT - ChangefIT - XrefIT
            ___________________________________
            There are only 3 kinds of people -
            Those that can count and those that can't.

            Comment


            • #7
              Originally posted by tomholden View Post
              Re: Embedded SQL and the Joblog

              you could use the QMHRCVPM API to remove the messages as they occur and that should get rid of the offending messages while preserving the messages that you wish to keep.
              Any Example code for it??.

              I am using below code to clear the sql error but it doesnot work?
              I created a procedure with below code and calling it from a program but it is not working. Any suggestions??

              QMHRCVPM( MsgInfo
              : %size(MsgInfo)
              : 'RCVM0100'
              : '*'
              : 1
              : '*PRV'
              : MsgKey
              : 0
              : '*REMOVE'
              : ErrCode );
              Thanks
              Venkat

              Comment


              • #8
                Can you provide an example of code that generates the types of messages you want to remove? Its difficult to answer without being able to see the messages.

                Comment

                Working...
                X