Please enable JavaScript to view this site.

ESL Documentation

Field Types

Sends data to a partner. The sender can request that data be sent immediately, can request a confirmation, and can indicate that a reply from the partner is expected before more data can be sent.

Note:        An APPC_ConfirmRequest event notification is signalled to your ESL program when the partner program requests confirmation. Your ESL program must respond by either calling APPCSendConfirmed or APPCSendError. If your program calls APPCSendConfirmed, it generates a confirmed notification to the partner program. When the partner is an ESL program, this triggers its response to stimulus ... APPC_Confirmed response statement. If your program calls APPCSendError, it generates an error notification to the partner program. When the partner is an ESL program, this triggers response to stimulus ... APPC_ReceiveError.

Declaration:

subroutine APPCSendString(        integer:CONVERSATION_ID,

                          string: STRING_VAR,

                          integer:AUTO_CONVERT,

                          integer:SEND_IND,

                          integer:MORE_TO_SEND)

                 library "eslappc" 

Arguments:

CONVERSATION_ID is an integer variable containing the conversation identifier (handle) for the APPC conversation returned by either APPCStart or APPCAcceptStart.

STRING_VAR is a string variable that specifies the data to send to the partner.

AUTO_CONVERT is an integer variable that indicates whether automatic conversion from ASCII to EBCDIC of the contents of STRING_VAR should be performed. This conversion uses the code page tables specified in the ESL APPC profile. Data from a host computer may be in EBCDIC; data on the workstation is in ASCII. If APPC_Default is specified, no conversion occurs. Valid constants are:

APPC_NoConvert

(Default) Requests that conversion not be done.

APPC_Convert

Requests that the string be converted from ASCII to EBCDIC.

SEND_IND is an integer variable used to specify control over when data is actually sent to the partner. Valid constants are:

APPC_None

(Default) Data is accumulated in a buffer to be sent when the buffer is full, or when another request causes the data to be sent.

APPC_Flush

The data is sent immediately.

APPC_Confirm

The data is sent immediately and a confirm notification is requested.

APPC_SyncLevel

The data is sent based upon the synchronization level of the conversation, established when it was started. If the synchronization level was specified as APPC_None, the data is sent immediately. If the synchronization level was specified as APPC_Confirm, the data is sent immediately and a confirm notification is requested.

Note:        A response to stimulus ... APPC_ConfirmRequest response definition MUST be included in your ESL program if confirmation will be requested by its partner. Otherwise, the conversation will not proceed. The response to stimulus ... APPC_Confirmed response definition is activated when the partner program sends your program a confirmation in response to your confirmation request.

MORE_TO_SEND is an integer constant that indicates whether your program has more data to send following the string being sent with this call. Valid constants are:

APPC_MoreData

(Default) Indicates that this application has more data to send before it expects a response.

APPC_ReadyToReceive

Indicates that the application expects to receive data from its partner before it has more data to send

.Errors:

APPC_NORMAL_COMPLETION

Normal completion.

APPC_ERR_OUT_OF_MEMORY

Out of memory.

APPC_ERR_CONVERSION_ERROR

Error on character conversion.

APPC_ERR_INV_CONV_ID

Invalid argument: CONVERSATION_ID

APPC_ERR_INV_AUTO_CONVERT

Invalid argument: AUTO_CONVERT

APPC_ERR_INV_SEND_IND

Invalid argument: SEND_IND

APPC_ERR_INV_MORE_TO_SEND

Invalid argument: MORE_TO_SEND

APPC_ERR_INV_STRING_VAR

Invalid string variable.

APPC_ERR_LGTH_EXCDS_PRF_BUFSIZE

Invalid argument: BUFFER_LENGTH String length exceeds buffer size specified in profile.

APPC_ERR_UNEXPECTED_EASEL_ERROR

Unexpected error on call to ESL routine.

APPC_ERR_UNEXPECTED_ERROR

Unexpected error encountered.

APPC_ERR_UNEXPECTED_DOS_ERROR

Unexpected operating system error encountered.

Example:

# Response to data from partner

 

response to stimulus APPC_EVENT APPC_Data ConvID

  call APPCGetString(ConvID,    # Handle from Start/AcceptStart
                     GetMove,   # String to hold partner's move
                     NoConvert )# Do not convert data
 

   if (...) then
      copy "YES" to OK
      ...

   else
      copy "NO" to OK
 end if
 

# Response to request for confirmation
 

response to stimulus APPC_EVENT APPC_ConfirmRequest ConvID

   if (OK = "YES") then # If understood move
      call APPCSendConfirmed(ConvID)   # Say everything OK
      call APPCSendString(ConvID,      # Handle from Start/AcceptStart
                          ResponseMove,#String containing next move
                          NoConvert,   # Do not convert data
                          Confirm,     # Confirm receipt
                          RdytoRecv )  # This send expects reply

   else # Otherwise, indicate a problem
      call APPCSendError(ConvID,
                         ErrorOrigin ) # APPC_BadGet
   end if
 

# Resend last data
 

respond to stimulus APPC_EVENT APPC_ReceiveError ConvID

   ...
   # Reconstruct last response
   call APPCSendString(ConvID       # Handle from Start/AcceptStart
                       ResponseMove,#String containing last move
                       NoConvert,   # Do not perform conversion
                       Confirm,     # Confirm receipt
                       RdytoRecv )  # This send expects reply