11.12.4 Some Programming Considerations

Use *DEFERWRITE in all functions.

Use *NOMESSAGES whenever the function is not required to (re)route messages.

Use *HEAVYUSAGE when the function is used constantly.

Use *DBOPTIMIZE when the function is used constantly, or is a batch job that processes a large number of database records.

When using *DBOPTIMIZE ensure all files have SHARE(*YES).

Understand the difference between causing the file to be opened for shared access, and having the file defined for shared access.

Understand the difference between a shared open data path and a shared access path.

Use OPTION(*BLOCKnnn) on full file SELECT commands in batch.

Use KEEP_LAST(n) on all repetitive FETCH commands.

Use compiled processes at all times in production systems. Watch for programs called DC@P5001nn (where nn is the range 01 - 09) in the invocation stack. This indicates an interpretive mode process is running.

Use FUNCTION OPTIONS(*DIRECT) in all functions.

Use CALL PROCESS(*DIRECT) FUNCTION(ffff) whenever possible.

Use process name *DIRECT when nominating prompting programs in the Repository.

Check open files in job stacks for same file open multiple times for same use (e.g.: input). This may indicate share(*yes) is not being used or has not been implemented correctly. The same file open for different uses is acceptable.

Use the LANSA supplied menu system whenever practical. Avoid the constant in and out from user defined menu systems or CL menus.

Keep invocation stacks simple. Program A calls B calls C calls D calls E calls F type of logic is not good for performance on the IBM i, no matter what development tool is used.

Avoid using OPNQRYF on large files in online programs.

Avoid using more than 20 files in any one program. Avoid having more than 40 - 50 files open at any one time in a job.

Run batch jobs in overnight mode unless actually required. Do not run too many batch jobs concurrently. Batch job I/O requests will always impact online job performance, no matter what scheduling and priority options are used for the CPU cycles.