Purpose
Use ReceiveData
to parse data obtained using a 3270 server or a custom server into
individual items.
Description
ReceiveData
assigns each discrete data item to a variable.
Note that SendData
and ReceiveData actions must be alternated in the state table. You
cannot execute multiple SendData actions without intervening ReceiveData
actions.
Every SendData action must have a matching ReceiveData
action unless a server returns a void response, in which case SendData
should have a Host Response Time Limit of 0, and there should be no
corresponding ReceiveData action.
Parameters
The parameters
for ReceiveData identify the server from which the information is
received and the variables to which the individual items are assigned.
The parameters also define a time limit.
- Server Type. Defines whether the server
is a 3270 server or a custom server.
- Server Name. Identifies the server from
which the information is received.
- Server Command. Identifies the 3270
server script or custom server user function that contains the command
that retrieves the information.
- Parameters. Identifies the variable
to which each item of information requested by the custom server is
assigned. The combined size of all the parameters must not exceed
3800 bytes.
- Timeout. Specifies the number of seconds
that ReceiveData waits for a response to the request for information.
For example, you could specify a low timeout value to determine if
the data is available. If the data does not arrive in this time (the
action returns the Timeout result), the application can play a prompt
and then try again, continuing until the result does arrive. A Timeout
value of 0 is valid. In this case the action will return immediately
with a Timeout result if the data has not yet arrived.
Possible results
ReceiveData
can have one of the following results:
- Succeeded
- The information has been received, parsed, and assigned to the
designated variables.
- No More Data
- There is no more data to parse. ReceiveData has parsed the last
record.
- Data Not Found
- The server did not find any information.
- Host Problem
- A problem with the computer on which the information is located
prevented the information from being available. The application knows
that the other computer is there, but GetFindData cannot retrieve
the information at this time. This can occur, for example, if the
time limit for the request, as specified in the SendData action, expires.
- Host Not Open
- This can occur for a number of different reasons, as identified
by the System: Action additional information (SV180)
system variable. Possible values are:
- 1
- The computer on which the information is located could not be
contacted. There is no open link to the host computer.
- 2
- This means one of the following:
- SendData had a timeout of zero, which meant that no answer from
the host was expected or no corresponding SendData had been executed.
- The ReceiveData followed a PlayVoiceFromHost or RecordVoiceToHost
before the caller hung up, so the internally-generated SendData action
was not executed.
- The internally-generated SendData action in PlayVoiceFromHost
or RecordVoiceToHost was not executed because no voice data was played
or recorded.
Note: If you want to use the information in SV180, you must
check it immediately after a state table action because it is reset
by other actions.
- Timeout
- The action did not receive any information in the amount of time
defined by the Timeout parameter.
ASCII syntax
When using an ASCII editor, code this action with these parameters in the following order:
- Server Type "CUSTOM_SERVER"
- Server Name
- Timeout
- Server Command
- ... Parameters
For example:
label: "Check Edges"
ReceiveData("SERVER_3270", SrvrSample_3270, 20, abrw_query, in1_n, in2_n)
edge EDGE_RECEIVE_DATA_COMPLETED: completed
edge EDGE_RECEIVE_DATA_NO_MORE_DATA: no_more_data
edge EDGE_RECEIVE_DATA_NOT_FOUND: not_found
edge EDGE_RECEIVE_DATA_HOST_PROB: host_prob
edge EDGE_RECEIVE_DATA_HOST_NOT_OPEN: host_not_open
edge EDGE_TIMEOUT: timeout
;
ReceiveData("CUSTOM_SERVER", CS_Request_Call, 20,
read_rec, in1_n, in2_n, in3_s, loc1_n);
The
parameters and edges are described above under "Parameters" and "Possible
results". For more information, see Testing a state table using the debugger.