View Full Version: Scheduling Deljobhst

LawsonTalk > System Admin > Scheduling Deljobhst



Title: Scheduling Deljobhst
Description: Automated System Cleanup


LawsonsNbr1Fan - May 1, 2006 07:09 PM (GMT)
I attended a job scheduler session this year at CUE and someone mentioned that you could set up deljobhst in recdef. I have been playing around with this idea but have been unable to bring it to light. Has anyone done this before? If so, how did you set it up? Did you use jobdef first?

mthedford - May 1, 2006 07:24 PM (GMT)
Use tokendef to create a token that processed deljobhst with the param's that you need. Then use jobdef to create a job that runs that token. Use recdef to shecule the job to run when you need it to. I've been running it this way since '98 without issues. Currently, I have it only keep 180 days worth of info on the system and it runs weekly.

LawsonsNbr1Fan - May 16, 2006 03:25 PM (GMT)
How do you DELJOBHIST to TOKENDEF?

LawsonsNbr1Fan - May 16, 2006 03:34 PM (GMT)
That's supposed to say: how do you set up DELJOBHST in TOKENDEF? I'm not too familar with using tokendef and I have tried a few things, but don't know where to start. Is it under application, environment, menu?

mthedford - May 16, 2006 04:36 PM (GMT)
From laenv (LID Menu's) under System Administration, choose Form Definition, OR from LID command prompt run the utility: tokendef. This will open the Form ID Definition screen. Be logged in as a Lawson Admin account if you are going to run it for all users.

1. Choose: User Form ID
2. I prefer to seperate the user tokens into categories - such as DBA, production, PR, HR, etc... so that security can be placed on the categories instead of each token. In the category field enter the name of the category you want defined, then enter a description, then tab down to the Form ID line. I use descriptive token names such as dbmgtxx for dba tokens, lautxx for Lawson utilities, where xx is a number like laut01. Enter the token/form id.
3. Enter the description such as: DELJOBHST for 90 days.
4. F6 for Define - in the command line enter the complete deljobhst utility command THAT YOU HAVE TESTED - for this example to remove all reports and batch jobs prior to 90 days you would enter: deljobhst -cr curdate - 90.
If you are running it in a Korn shell script, then you would enter: sh path_to_script/script_name.
5. keep hitting enter util it is saved.
6. In jobdef, create a new job, and in the form ID field enter the new token or hit F4 to select, F4 to select on Type and select User, tab to data area/id and F4 to select the category that you just created, then select the token you just defined.

Save the job and run. I have mine setup as a recuring job to run weekly to remove anything older than 90 days from current date.

LawsonsNbr1Fan - May 16, 2006 06:17 PM (GMT)
Thanks for the information. It works!!!

Milo - May 16, 2006 08:31 PM (GMT)
User Tokens can also access custom scripts. We do that on our system. The flexibility is awesome. It does require understanding UNIX shell scripting. There are plenty of books available to help learn.




Hosted for free by InvisionFree