ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Generate a report out of the CL errors

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

  • Generate a report out of the CL errors

    I have a CL program which does the basic setup when a new client enters the system, like creating the libraries, subsystem, jobD etc. I want to generate a report when the CL throws errors. For example Library xxxx is not created and the possible reason for that error. How do I achieve this?

  • #2
    One way could be to create a RPG program that writes to an IFS file.
    Then in the CL program you could add a MONMSG DO/ENDDO after the relevant instructions and
    if an error happens you call the RPG program with the message you want to be written in the IFS file.
    Finally you attach the IFS file to a mail eventually with a copy of the joblog.

    Comment


    • #3
      Why not simply save the joblog (or specific messages from within the joblog)?
      IBM provides an SQL Service for accessing the joblog QSYS2.JOBLOG_INFO.
      With an SQL INSERT command you can save those information in your own table, may be with a few more information (for example Qualified Job, User ...)
      Save the timestamp when you start the program.
      At the end of the program you insert the Joblog Entries (after the starting timestamp) into your table.
      With RUNSQL you can easily run SQL INSERT statements.

      Comment

      Working...
      X