Are you wondering how send the arguments for CICS Transactions. There will be many cases when user wants to call specific logic in the application code based on particular condition. Writing separate programs for each condition and defining separate transaction for each such program will be difficult for an application programmer. Using the power CICS APIs, CICS application programmer can send arguments for a transaction.
TXSeries for Multi-platforms provides wide verity of CICS APIs. Using EXEC CICS RECEIVE API, user can read the data from terminal. As most of the terminals uses 24x80 screens, each line can have a maximum of 80 characters. Using EXEC CICS RECEIVE API, user can read the 80 characters as described in pseudo code. After reading, user needs to parse the character string based on requirement. The first four characters contains the transaction name. User can use the remaining 75 characters to pass the character arguments for the transaction.
void main (void)
cics_char_t TextBuffer ;
cics_sshort_t TextLength = 80;
memset(TextBuffer, ' ', 79);
TextBuffer  = '\0';
EXEC CICS RECEIVE
/* Read the Trasaction character arguments */
/* 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 */
/* SAMP 1*/ /* SAMP is the transaction and '1' is the argument */
/* SAMP 2*/ /* SAMP is the transaction and '2' is the argument */
/* SAMP 3*/ /* SAMP is the transaction and '3' is the argument */
/* SAMP 111 2 33*/
if (Text_Buffer  != ' ')
case '1' : Business Logic 1;
case '2' : Business Logic 2;
case '3' : Business Logic 3;
Default : Business Logic ;
// Business Logic //
User can also pass multiple arguments to the transaction using some delimiter. But in application program it needs to be parsed based on the delimiter or by using some tokenizing techniques.