User Reports/Joblist Cleanup

 7 Replies
 0 Subscribed to this topic
 27 Subscribed to this forum
Sort:
Author
Messages
TBonney
Veteran Member
Posts: 281
Veteran Member
    Does anyone know of the table names that list all reports/jobs created by each user, and whether or not they include a "last submit" date?

    I know there are some users who create new jobs all the time, who have 4-5 year old jobs that have not been used in 3-4 years. I would like to maintain these user joblists & remove these obsolete or unused jobs from them, so that when they drill, the list displays quicker.

    Has anyone ever done any joblist maintenance like this who might like to share their approach?

    Thank you.
    John Henley
    Posts: 3353
      I won't give you all the answers :)
      But you should be able to find what you're looking for in the GEN database in the JOB/JOBSTEP/QUEUEDJOB tables.

      You can also get some information from the JobServer servlet.

      http://lawson.example.com...STATUS=completedjobs
      Thanks for using the LawsonGuru.com forums!
      John
      TBonney
      Veteran Member
      Posts: 281
      Veteran Member
        Thanks John...I'll take a look!
        JimY
        Veteran Member
        Posts: 510
        Veteran Member
          Hi John,
               Your link is not working.  I took a look at those tables because I am also interested in doing some cleanup, but they do not have any date to indicate how old they are.  Is there a way to determine this?  Thank you.
          TBonney
          Veteran Member
          Posts: 281
          Veteran Member
            JimY,
            The link John provided works once you modify it to use your own sever info. However, it looks like this servlet only actually proviodes the last 30 days worth of data. Therefore, I am now working on querying the table names John also provided.
            TBonney
            Veteran Member
            Posts: 281
            Veteran Member
              John,

              If a job exists on the JOB table, but that same job is not found on the QUEUEDJOB table, does that mean that the job has never been run (and therefore, can be deleted)? Also, does the QUEUEDJOB table only retain records within a certain date range (like one year)?

              Thank you!
              Jeff White
              Veteran Member
              Posts: 83
              Veteran Member
                What I would do, is create a shell script that finds .prt files in the print directory older than a certain date.

                ex. (Jobs that haven't run in over a year)

                find /law90/lawson/print/*/*/*/*.prt -mtime +365 -exec ls -l {} \; > output.txt

                /law90/lawson/print/lawson/ap150-10/1/AP150.prt
                /law90/lawson/print/lawson/ap150-1000/1/AP150.prt

                I would then use awk to get the values that I needed (username, jobname), and write that to a file. Then create a very simple cobol program to read in that file using the BATCH PROCESSING API's and delete the job(s). All automatic and running out of recdef.

                Jeff
                Venkat
                Advanced Member
                Posts: 22
                Advanced Member
                  To answer TBonney's questions:

                  QUEUEDJOB gets cleared if one runs deljobhst and chooses to delete completed jobs. So unless deleted by the user the records would remain forever. If a job exists in JOB table but not in QUEUEDJOB table you may conclude it was never run if you have not been cleaning the table up frequently. The columns actstartdate, stopdate would indicate when the job was run.