callAS400Program()
Calls an AS400 program.
The login to host a is executed with user b and password c. After successful authentication, program d is called using the parameters that have been added to the list f.
Parameter e must contain a sequence of positive integers (separated by pipe |), specifying the character lengths in the list object in their sequence.
Parameter h defines the types of the given parameters in f, separated by commas. Allowed values are: bin2, bin4, float4, float8, array:<encoding>, text, unsignedbin2, unsignedbin4, zoned and packed. zoned or packed types must define the number of digits (without blanks), e.g. use packed12 for a number with 12 digits like 100.123456789012. Type array may have an optional encoding like array:UTF16.
If parameter i is set to true, the session will be kept until the end of the mapping (cached) - useful if the function is called several times.
If the value -1 is specified in parameter g, the function will return true on success or false in the case of an unsuccessful call of the AS400 program. If a number between 0 and the <number of parameters-1> is specified in parameter g, the corresponding input parameter is overwritten by the result of the AS400 program, which then will be returned as string as the result of the function call. If the AS400 call fails, the function is aborted with an error.
Parameters
Parameter |
Description |
a |
Host name or IP address. |
b |
User name. |
c |
Password. |
d |
Program name. |
e |
Length for each input parameter, separated by |. |
f |
Name of the list in which parameters are stored. |
g |
Output parameter index. |
h |
(optional) Types of given parameters in f, separated by commas. Default: text . |
i |
true to re-use connection in further mapping. |
Examples
Parameter a |
192.168.0.123 |
Parameter b |
opuser1234 |
Parameter c |
secretpass |
Parameter d |
/QSYS.LIB/FUXX4TRADE.LIB/WEBVKR6B.PGM |
Parameter e |
124|7 |
Parameter f |
partList |
Parameter g |
0 |
Parameter h |
bin4,array:UTF16 |
Parameter i |
true |
Result |
Result of the first output value of the program. |