--- title: "callAS400Program()" slug: "basic-call-as-400" updated: 2026-08-10T09:08:56Z published: 2026-08-10T09:08:56Z canonical: "docs.lobstersoftware.com/basic-call-as-400" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # 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:*, *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 ** 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. **NOTE:** Use the prefix *secure:* for TLS-based AS400 connections. | | b | User name. | | c | Password. | | d | Program name. The library must also be specified, see examples. | | 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. | | j | (optional) Trim mode. Default: *none*. | | k | (optional) If the name of a list is specified here, the names of the output variables are inserted into it. | ## 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 | | **Parameter j** | | | **Parameter k** | | | **Result** | Result of the first output value of the program. | The core task of Phase 3. Mapping transfers data from the source structure to the target structure according to defined rules. In the process, fields can be transformed, functions can be called, and values can be calculated.