Building the Argument Attribute String (Magic xpi 3.x)
This topic explains how to configure a System i connector to call an IBM i program with the following two parameters:
-
UserID (Alpha 10)
-
MESSAGE (Alpha 100)
You should first build an attribute string of parameters, and then call the IBM i program as described below:
-
From the Project menu, select Resources. The Resource Repository dialog box opens.
-
In the Resource Repository dialog box, click New. The New Resource dialog box opens.
-
Select System i from the drop-down list, and give your new System i resource an appropriate name.
-
Enter the following required information:
-
Create a new flow.
-
Place a System i connector in the flow area. The Component Properties dialog box opens.
-
In the Component Properties dialog box, click Configure. The Direct Access Method System i dialog box opens.
-
In the Direct Access Method System i dialog box, click New and select the Build Attribute String method.
-
Set the first parameter, UserID, with the following attributes:
-
When this method is executed, the C.UserString variable is modified according to the attributes of the UserID parameter.
-
In the Direct Access Method System i dialog box, click New to insert another Build Attribute String method.
-
Set the second parameter, MESSAGE, with the following attributes:
-
When this method is executed, the C.UserString variable is modified according to the attributes of the UserID and MESSAGE parameters.
Note:
|
After the execution of each Build Attribute String method, the C.UserString variable is appended with the information of the new parameter.
|
|
-
In the Direct Access Method System i dialog box, click New to add the Program Call method, and enter the following required information:
-
-
Specify the UserID and MESSAGE variables for the Arg1 and Arg2 parameter fields respectively.
-
Click OK to close all of the opened windows until you are back in the Flow Editor.
-
Execute the flow with the Magic xpi Debugger. The following process is executed.
As the first two methods (the Build Attribute String methods for two arguments) are executed, the Argument Attribute String is built and stored in the C.UserString variable.
In the third method (Program Call), the C.UserString, which has the complete Argument Attribute String, is passed. In this example, its value would be: A10,O:A100
Where:
-
A10 means that the first parameter is of type Alpha, length 10, and its direction is IN.
-
O:A100 means that the second parameter is of type Alpha, length 100, and its direction is OUT.
Note:
|
The UserID and MESSAGE variables are supplied as an actual argument for the Program Call method.
|
|
-
A message is sent to an IBM i user. On IBM i, use the DSPMSG <username> command to view the message.