7.120.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

Calling a User Program

Submitting a Form

    CHANGE FIELD(#FORM) TO ('''*FORM''')

    SUBMIT PROCESS(ORDERFRM) FUNCTION (#FORM)