Executing Lawson Jobs Through the wtsubmit and jqsubmit Utilities This procedure explains how to execute a Lawson job through a script. To execute a Lawson job through a script If you are submitting a multi-step job, - or - If you are submitting a single-step job and do not want to wait for the job to complete before continuing processing, use the jqsubmit utility to execute the job. At the command line, type the command using the required parameters and any optional parameters as needed. See "jqsubmit-Submit Batch Job" for more information. jqsubmit [-Un] [-jJobQueue] [-dDate] [-tTime] username jobname The jqsubmit utility will submit the job to the Lawson Job Server (lajs) in the background. If you are submitting a single-step job and want to wait until the job finishes processing before continuing, use the wtsubmit utility to execute the job. The wtsubmit utility cannot be used with multi-step jobs. See "wtsubmit-Wait Submission" for more information. wtsubmit [-Un] [-jJobQueue] [-dDate] [-tTime] username jobname The wtsubmit utility will wait until the job finishes processing before returning control to the calling job or script. Executing a Lawson Job Using the lacobrts Utility Jobs created using third-party products can still be executed with lacobrts for clients who prefer to use this utility. If a job has never been run before, you must create the UNIX directory for the output files (formID.prt). For more information on print directories, see Getting Started with the Desktop Client. The permissions on the directory should allow the user to create files in that directory (777). To execute a Lawson job using the lacobrts utility For a Lawson single-step job or for one step in a multiple-step job, at the command line, type the following command. lacobrts $LAWDIR/productline/obj/programcode.gnt productline username jobname step# Example To run the job gl200sjm for user steve, type lacobrts /lawson/dev/obj/gl200.gnt dev steve gl200sjm 1 IMPORTANT When typing programcode.gnt, match case to the program you are running. For example, if your job is from program HR200, you would type "HR200.gnt". To execute multiple steps in a job, repeat the above command (build a UNIX script to save the information for executing at a later time). Fixing Recovery Problems This information pertains only to jobs submitted using the lacobrts utility. The lacobrts process has several return codes that determine if a step was successful. The UNIX shell automatically interprets the return code when lacobrts is run from the command line or from a shell script. Third-party products that start the lacobrts process must obtain and interpret the lacobrts return code. See the manufacturer's documentation for the batch job scheduler you are using to determine how this works. The lacobrts process calls the C-language exit function with the return code parameters listed in the following table. The return values are obtained from the WS-RETURN-CODE working storage section in the application program. IMPORTANT See the UNIX man pages for information about the C-language exit function. For information on how to interpret a UNIX return code, see the UNIX man pages for the C-language wait function. Return Code Interpretation 0 Step Successful 1 - or - Any Signal Needs Recovery 2 Invalid Parameters 3 Process Terminated Due to Deadlock Time-out (SQL Databases Only) If a report fails with a status of 1 or receives a signal, investigate the log to determine the error. For information on troubleshooting Lawson application messages, see "Capturing Lawson Application Messages". Once the error is fixed, re-run the lacobrts command to continue the job. If a report fails with an error of 2, correct the parameter and resubmit the job. IMPORTANT If you choose not to recover the job, you must delete the record that the running job created in the CKPOINT file in the Environment database. This is similar to deleting a Needs Recovery job from the Job Scheduler. Capturing Lawson Application Messages This information pertains only to jobs submitted using the lacobrts utility. When you use the Job Scheduler utility to submit jobs, it creates and maintains a job log ($LAWDIR/system/joblog). This log contains messages from the application that you can use to identify the cause of errors. When you use a third-party job scheduler and submit through the lacobrts utility, you bypass the Job Scheduler utility. Job log files are not automatically created. The batch job scheduler you are using must create and maintain the log files, or, at a minimum, manage display messages coming from the Lawson application programs. Deleting a Needs Recovery Job This information pertains only to jobs submitted using the lacobrts utility. If a job returns with a status of 1 or receives a signal (No disk space), and you want to delete the report, you must remove the record in the CKPOINT file in the Environment database. This record enables the resubmitted file to continue where it left off, rather than returning to the beginning of the job. The Delete CKPOINT Entry utility (delckpoint) removes the record from the Environment database. CAUTION When running a batch update job, use delckpoint with extreme care. Running delckpoint could cause data loss or corruption if not used appropriately. An example of a situation where you should run delckpoint for a batch update job is after the database has been restored, so that the job runs from the beginning, rather than from where it left off. To delete a needs recovery job Users can delete a job that has failed and gone to Needs Recovery status only if their user profile has the Delete Update Jobs field set to Yes. For more information, see "Defining a Lawson User". At the command line, type delckpoint username jobname productline Understanding the CKPOINT File The CKPOINT file provides a location for batch programs to store recovered data. A record is automatically created each time a program is executed, and automatically deleted upon the successful completion of the program. If the program must be restarted, the data stored in the CKPOINT record can be used to determine the point from which the program must resume. The field within the CKPOINT file, named CKP-RESTART-INFO, provides storage for this program-specific data. To limit a user's ability to delete a Needs Recovery status job, see "Defining a Lawson User". Loading Print Files into the Lawson Print Manager This information pertains only to jobs submitted using the lacobrts utility. After a job or job step completes, use the Load Print File utility (loadrpts) to load the print files from the standard print directory into the Print Manager (in the USERRPT file). To load the print files At the command line, type: loadrpts -[dsVU] directory [-u username [jobname]]