This section contains an example of a program that uses the CICS Universal Client interface.
# include file for ESL CICS Support
include "eslcics.inc"
# integer identifying the CICS program initiated
# by CICSInitiate
integer ProgramID
FailCode
### structure definitions ###
# This structure type must exactly match the input
# and output data format for the CICS transaction.
structure YOUR_COMMAREA is
integer InputData using external size 4
"ESLCOB.COB_COMP5"
string FName using external size 9
"ESLCOB.COB_PICX"
string LName using external size 9
"ESLCOB.COB_PICX"
end structure
# structure variable that holds data returned from
# the CICS transaction
structure YOUR_COMMAREA CommArea
# The structure type ECIPARMS is declared in the
# ESLCICS.INC file. The structure variable
# ECIPARMS is the argument used in the
# CICSInitiate function.
structure ECIPARMS EciParms
response to start
# You must fill this field.
copy "TransName" to EciParms.ProgramName
# You must fill this field.
copy "UserID" to EciParms.UserID
copy "Password" to EciParms.PassWord
copy "TransID" to EciParms.TransID
# Fill this field using the handle of function.
copy handle of CommArea to EciParms.CommArea
# You must fill this field with the length of
# the YOUR_COMMAREA structure type.
copy 22 to EciParms.CommAreaLength
# Argument for CICSInitiate is the structure
# variable you defined as EciParms structure
# type.
copy CICSInitiate (EciParms) to ProgramID
if (ProgramID = 0) then
send "CICSInitiate error occured\n" to errorlog exit
end if
response to stimulus ESLCICS CICSData
if (eventparam = ProgramID) then
# CICSGetData will fill the area in memory
# designated by the pointer in the
# EciParms.CommArea field.
call CICSGetData (EciParms, ProgramID)
if (errorlevel != 0) then
send "CICSGetData error occured\n" to errorlog exit
end if
send "FName is " CommArea.FName "\n" to errorlog
send "LName is " CommArea.LName "\n" to errorlog
end if
response to stimulus ESLCICS CICSError
if (eventparam != 0) then
copy eventparam to ProgramID
copy CICSGetError (EciParms, ProgramID) to FailCode
end if