As a matter of principle, avoid hard coding the work management parameters in your own programs, as this makes it hard to alter them without reprogramming.
For instance, if you needed to produce two copies of a report in a program you could either:
Note: The latter solution is preferable, as it does not require a programming change to revise the number of copies produced. (It does require that there be a separate print file for the report.) Alternatively, you could make the number of copies a run time parameter when executing the report. For example, use the OS/400 Override print file (OVRPRTF) command with COPIES(&COPIES) specified.
Likewise, if you have a program that submits a job, do not hard code the job attributes (such as the job priority) on the ‘submit job’ statement. Instead, create a job description that has the desired attributes, and submit the job using the job description. The job attributes for new jobs may then be changed at any time, simply by altering the job description.
Another technique that can be used is to store a command that may need to be changed as a message on a message file, and to retrieve it at execution time for execution with the OS/400 execution program QCMDEXC. The message description can then be modified at any time using the OS/400 Change message description (CHGMSGD) command. This technique is used to implement the CA 2E EXCMSG function.
|
Copyright © 2014 CA.
All rights reserved.
|
|