4.10.3 Using a Process or Function from Your Own Application
This section has so far described how to use a process from within LANSA. However, it is possible to use a process or function directly from your own application program or from command entry.
The direct use of a process is achieved by specifying parameters on the LANSA command or when calling the LANSA program.
Accessing LANSA described how LANSA can be invoked by executing the command:
LANSA
or by calling LANSA:
CALL LANSA
To use a process called ORDERS directly from your own application, without going though the normal LANSA menus, the following command could be used:
LANSA RUN ORDERS
or by calling LANSA:
CALL LANSA ('RUN' 'ORDERS')
To use a function called ADDCUST (which is part of process ORDERS) directly from your own application, without going though the normal LANSA menus, or even the process main menu, the following command could be used:
LANSA RUN ORDERS ADDCUST
or by calling LANSA:
CALL LANSA ('RUN' 'ORDERS' 'ADDCUST')
Either the LANSA command or the CALL command can of course be compiled into your own application programs and the name of the process and optional function to be run can be passed as a variable instead of a literal.
The LANSA or CALL commands can be executed from an interactive application or from a batch application.
Additional parameters on the LANSA command and the LANSA program allow the passing of parameters from your application program into the process and/or the nomination of the system partition to be used.
The LANSA Command Parameters
The LANSA command has the following command parameters - all of which are optional:
Keyword
|
Description / Comments
|
REQUEST
|
Request made to LANSA. Must be either RUN or SUBMIT
|
PROCESS
|
Name of process to RUN or SUBMIT.
|
FUNCTION
|
Name of function to RUN.
|
PARM01
|
User parameter 1. Must exactly match parameters defined for the process in type and length. Note that numeric process parameters are always "packed" numeric variables.
|
PARM02 - PARM10
|
User parameters 2 through 10. A process can have at most 10 associated parameters defined. The type and length rules as for PARM01 apply.
|
PARTITION
|
Name of the system partition that is to be used. If not specified or passed as blanks, the major application partition "SYS" will be assumed.
|
LANGUAGE
|
Language that the system is to use. If not specified or passed as blanks the partition default language will be assumed.
|
TASK ID
|
Task Id that is to be used. This should normally be passed as blanks.
|
PC_TYPE
|
This parameter is used internally by LANSA and is not usable in a normal LANSA invocation. This is 1 character in length and should be passed as N.
|
DEVELOPER
|
Used to specify whether LANSA presents a command line and work with interface. It is up to 9 characters in length and should be passed as N.
For further information, refer to the LANSA Command.
|
ALLOW_MSGS
|
Specifies whether or not access is given to developer services. It is up to 4 characters in length and should be passed as N.
For further information, refer to the LANSA Command.
|
DATE_SRCE
|
Specifies where the date and date format is retrieved from. It is up to 7 characters in length.
*SYSTEM, S: Specifies that the date and date format are to be retrieved from the system values. This is the default.
*JOB, J: Specifies that the date and date format are to be retrieved from the job attributes.
|
BDEBUG
|
Specifies that batch debug of LANSA RDML functions is required. This is used internally by LANSA and is not useable in a normal LANSA invocation. It should be passed as blanks.
|
BDEBUG_DEV
|
Name of the display device to be used for debugging batch RDML functions. This is used internally by LANSA and is not useable in a normal LANSA invocation. It should be passed as blanks.
|
BDEBUG_MSG
|
Name of the message queue when using batch debugging. This is used internally by LANSA and is not useable in a normal LANSA invocation. It should be passed as blanks.
|
X_RUNADPRM
|
Additional parameters for an X_RUN request in up to 512 characters. These additional parameters must be specified in the X_RUN format, e.g. PRTR=*PATH. Refer to Standard X_RUN Parameters in the Technical Reference Guide for details of X_RUN parameters.
|
|
The LANSA Program Parameters
The LANSA program has the following parameter specifications. It is not necessary to pass all the parameters to the LANSA program, only those up to and including the last one that you wish to use:
Number
|
Type
|
Length
|
Description / Comments
|
1
|
A
|
10
|
Request made to LANSA. Must be either MENU or RUN
|
2
|
A
|
10
|
Name of process to RUN or SUBMIT.
|
3
|
A
|
10
|
Name of function to RUN.
|
4
|
any
|
256(max)
|
User parameter 1. Must exactly match parameters defined for the process in type and length. Note that numeric process parameters are always "packed" numeric variables.
|
5 - 13
|
any
|
256(max)
|
User parameters 2 through 10. A process can have at most 10 associated parameters defined. The same type and length rules as for PARM01 apply.
|
14
|
A
|
3
|
Name of the system partition that is to be used. If not specified or passed as blanks the major application partition "SYS" will be assumed.
|
15
|
A
|
4
|
Language that system is to use. If not specified or passed as blanks the partition default language will be assumed.
|
16
|
A
|
8
|
Task Id that is to be used. This should normally be passed as blanks.
|
17
|
A
|
1
|
The PC_TYPE parameter is used internally by LANSA and is not usable in a normal LANSA invocation. It should be passed as N.
|
18
|
A
|
1
|
This parameter is used to specify whether LANSA presents a command line and work with interface. Should be passed as N.
For further information, refer to the LANSA Command.
|
19
|
A
|
1
|
This ALLOW_MSGS parameter is used to specify whether or not access is given to developer services. It is not usable in a normal LANSA invocation and should be passed as N.
For further information, refer to the LANSA Command.
|
20
|
A
|
10
|
This PC_NAME parameter is used internally by LANSA and is not usable in a normal LANSA invocation. It should be set to blanks.
|
21
|
A
|
1
|
This parameter is used to specify where the date and date format is retrieved from.
S specifies that the date and date format are to be retrieved from the system values. This is the default.
J specifies that the date and date format are to be retrieved from the job attributes.
|
22
|
A
|
1
|
This parameter is used to specify that batch debug of LANSA RDML functions is required. It is used internally by LANSA and is not useable in a normal LANSA invocation. It should be passed as blanks.
|
23
|
A
|
10
|
This parameter is used to specify the name of the display device to be used for debugging batch RDML functions. It is used internally by LANSA and is not useable in a normal LANSA invocation. It should be passed as blanks.
|
24
|
A
|
10
|
This parameter is used to specify the name of the message queue when using batch debugging. This is used internally by LANSA and is not useable in a normal LANSA invocation.
|
25
|
A
|
512
|
Specify additional parameters for an X_RUN request. These additional parameters must be specified in the X_RUN format, e.g. PRTR=*PATH. Refer to Standard X_RUN Parameters in the Technical Reference Guide for details of X_RUN parameters.
|
|
Error Messages for LANSA
Refer to Escape messages