7 91 2 SUBMIT Comments Warnings

LANSA Technical

7.91.2 SUBMIT Comments / Warnings

Using Fields (i.e: Variables) in the Submit Command

The SUBMIT command parameters PGM, PROCESS, FUNCTION, JOB, JOBD, JOBQ and OUTQ can all be specified as either alphanumeric literals (for example, GLR001) or as LANSA field names (for example, #PGMNAME).

This allows a great deal of flexibility to be coded into one SUBMIT command. Consider the following RDML program:

REQUEST FIELDS(#OPTION)
 
CASE OF_FIELD(#OPTION)
    WHEN VALUE_IS('= 1')
         CHANGE FIELD(#FUNCTION) TO(PRINT)
    WHEN VALUE_IS('= 2')
         CHANGE FIELD(#FUNCTION) TO(BATCH)
    WHEN VALUE_IS('= 3')
         CHANGE FIELD(#FUNCTION) TO(PURGE)
    WHEN VALUE_IS('= 4')
         CHANGE FIELD(#FUNCTION) TO(BACKUP)
ENDCASE
 
SUBMIT PROCESS(ORDERS) FUNCTION(#FUNCTION) JOB(#FUNCTION)
 

This program allows the user to nominate an option of 1,2,3 or 4 and submit functions PRINT, BATCH, PURGE or BACKUP respectively (all of which belong to process ORDERS). The name of the job submitted will be the same as the function.

Submitting a Process or Function

  • When submitting a process/function the parameters must exactly match those required by the process in number passed and type (ie: numeric or alpha).
  • The parameters passed to the batch process or function can be a field name, an alphanumeric literal, a numeric literal, a system variable or a process parameter.
  • Note that when numeric parameters are defined for a process they are always packed decimal. Thus any numeric parameters passed to LANSA processes should also be packed decimal with the same length and number of decimal positions. Failure to observe this rule may result in unpredictable results.

Calling a User Program

  • The parameters passed to the batch program can be a field name, an alphanumeric literal, a numeric literal, a system variable or a process parameter.
  • If special value *LIBL was nominated as the library containing the program to be invoked in batch then the program should be in one of the libraries specified in the INLLIBL (initial library list) parameter of the job description nominated in the JOBD (job description) parameter of this command.

Submitting a Form

  • When sugmitting a form, the value *FORM must be supplied to the SUBMIT command's FUNCTION parameter in a field. For example,

    CHANGE FIELD(#FORM) TO ('''*FORM''')
    SUBMIT PROCESS(ORDERFRM) FUNCTION (#FORM)