You can use channels and containers when you connect to CICS® using the IPIC protocol. You must create a channel before it can be used in an ECI request.
ECI_ChannelToken_t chanToken;
createChannel(&chanToken);
int custNumber = 12345;
rc = ECI_createContainer(chanToken, "CUSTNO", ECI_BIT, 0, &custNumber, sizeof(custNumber));
Here is a sample CHAR container that
uses the CCSID of the channel: char * company = "IBM";
rc = ECI_createContainer(chanToken, "COMPANY", ECI_CHAR, 0, company, strlen(company));
CTG_ECI_PARMS eciParms = {0};
eciParms.eci_version = ECI_VERSION_2A;
eciParms.eci_call_type = ECI_SYNC;
strncpy(eciParms.eci_system_name, "CICSA", ECI_SYSTEM_NAME_LENGTH);
eciParms.eci_userid_ptr = "USERNAME";
eciParms.eci_password_ptr = "PASSWORD";
strncpy(eciParms.eci_program_name, "CHANPROG", ECI_PROGRAM_NAME_LENGTH);
eciParms.eci_extend_mode = ECI_NO_EXTEND;
eciParms.channel = chanToken;
ECI_CONTAINER_INFO contInfo;
rc = ECI_getFirstContainer(chanToken, &contInfo);
while (rc == ECI_NO_ERROR) {
printf("Container %s\n", contInfo.name);
if (contInfo.type == ECI_BIT) {
printf("Type BIT\n");
} else {
printf("Type CHAR\n");
}
/* Read block of data into buffer */
ECI_getContainerData(channelToken, contInfo.name, dataBuff,
sizeof(dataBuff), offset, &bytesRead);
rc = ECI_getNextContainer(chanToken, &contInfo);
}