ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Finding where a batch job gets its report data

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

  • Finding where a batch job gets its report data

    There's a scheduled batch job that runs everyday to print some reports to a specific printer. Is there a way to find out where it is pulling reports for 3 of the forms it generates?

  • #2
    WRKJOB option 14 while it's active?

    Cheers,

    Emmanuel

    Comment


    • #3
      Assuming you're using the default OS job scheduler:
      Code:
      WRKJOBSCDE [B]job_name_here[/B]
      That will give you the program that it runs. If you have the source code, you can check to what it does.

      HTH

      Comment


      • cronot2
        cronot2 commented
        Editing a comment
        I was able to look at the source code, though it's hard to find what I'm looking for. Mainly because they don't have any comments or anything that makes it clear to me that they are sending the reports to the output queue that says it receives them from this job and the files it references don't pull up when I try to view them.

        I'll keep looking in case I missed something, though at least the comments in the source code indicate it was a third party program based on the copyright. So maybe we can get some vendor assistance too.

    • #4
      If the files declared (assuming there are some) in the job scheduler entry don't match the information you are seeing in the reports, my next look would be to see if the initial called program has other calls embedded. A secondary submitted job or call might have the tables/files serve as the data source for your reports.

      Comment


      • #5
        I found the batch job that generates the reports and the files that the other programs it calls gets their input from to create the reports. What I am stuck at now is what jobs use those files as outputs to try and work backwards to what job started from the menu or CL initiates the programs that update the information in those files.

        Any ideas?

        Would the fact that in the source code of the main program that calls the others to create the report, I found a copyright for a third party company mean they might have information or be able to assist?

        Comment


        • #6
          This command will output a program reference listing:
          DSPPGMREF PGM(*ALLUSR/*ALL) OUTPUT(*OUTFILE) OBJTYPE(*ALL) OUTFILE()

          You can take look for the object names that correspond to the tables in question. That will give you the programs that reference those tables. Then take those programs and see what programs call them (e.g. CLLEs that call RPGLE). Once you've worked your way thru that, you should have the top level programs. Then you can check the system job scheduler for any scheduled jobs that call those programs. For menus, I think the best way is to scan your source (RDi makes that easier).

          HTH

          Comment


          • cronot2
            cronot2 commented
            Editing a comment
            I know the scheduled batch job that calls the different programs that use these files as inputs, I'm just having trouble finding the programs that use the files as an output since they aren't a scheduled job and have to be run manually.

            This may be complicated by the fact that some of these programs are RPG ones that don't allow the dubugger to be used on them.

            Still, it may be worth a try if I can find at least one program that uses these as an output.

        • #7
          Is there an SQL command that will let me sort the programs based on that? Or will I need to do it manually?

          Comment


          • jtaylor___
            jtaylor___ commented
            Editing a comment
            Are you asking about DSPPGMREF? That command outputs to a PF. You then have to query that PF using your favorite tool.

        • #8
          This might be where the system audit journal would be helpful. There might be no other good way to find what's using those files.
          Tom

          There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

          Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

          Comment

          Working...
          X