Working in z/os mainframe, I have the following situation. I can't record a transaction. here is my code, it is written for transaction using jcl. Bur something goes wrong.
/* Include standard C header files */
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* Include WebSphere MQ API header file */
#include <cmqc.h>
/* Boolean constants */
#define TRUE 1
#define FALSE 0
/* Function prototypes */
void displayUsage (char *programName);
void displayMQError (char *message, MQLONG compCode, MQLONG reason);
double parseAmount (char *amountString);
/* Main Program */
int main (int argc, char *argv[])
{
/* Variable definitions */
double paymentAmount; /* Payment amount */
MQBYTE msgBuffer[1024]; /* Buffer for messages */
MQCHAR* qmgrName; /* Queue manager name */
MQCHAR* requestQueueName; /* Request queue name */
MQCHAR* replyQueueName; /* Reply queue name */
MQCHAR* userID; /* Contestant user ID */
MQCHAR* paymentDescription; /* Payment description */
MQGMO getMsgOptions = {MQGMO_DEFAULT}; /* Get options */
MQHCONN hConn = MQHC_UNUSABLE_HCONN; /* Connection handle */
MQHOBJ requestHObj = MQHO_UNUSABLE_HOBJ; /* Request queue handle */
MQHOBJ replyHObj = MQHO_UNUSABLE_HOBJ; /* Reply queue handle */
MQLONG compCode; /* API completion code */
MQLONG openOptions; /* Open queue options */
MQLONG reason; /* API reason code */
MQLONG replyMsgLength = 0; /* Reply msg length */
MQMD requestMsgDesc = {MQMD_DEFAULT}; /* Message descriptor */
MQMD replyMsgDesc = {MQMD_DEFAULT}; /* Message descriptor */
MQOD requestQueueDesc = {MQOD_DEFAULT}; /* Object descriptor */
MQOD replyQueueDesc = {MQOD_DEFAULT}; /* Object descriptor */
MQPMO putMsgOptions = {MQPMO_DEFAULT}; /* Put options */
/*****************************************/
/* Initialisation and parameter checking */
/*****************************************/
printf ("********************************************************\n");
printf ("Credit card payment unit test tool\n");
printf ("********************************************************\n");
printf (" \n");
switch (argc)
{
case 7 : qmgrName = argv[1];
requestQueueName = argv[2];
replyQueueName = argv[3];
userID = argv[4];
paymentAmount = parseAmount (argv[5]);
if ( ( paymentAmount < 0.01 )
|| ( paymentAmount > 9999.99 ) )
{
printf ("The payment amount must be a valid numeric " \
"within the range 0.01 to 9999.99\n");
displayUsage (argv[0]);
return (1);
}
paymentDescription = argv[6];
if ( ( strlen (paymentDescription) < 1 )
|| ( strlen (paymentDescription) > 35 ) )
{
printf ("The payment description must be 1-35 " \
"characters\n");
displayUsage (argv[0]);
return (1);
}
break;
default : printf ("Incorrect usage!\n");
displayUsage (argv[0]);
return (1);
}
printf ("You have requested a payment of %.2f with description " \
"'%s' for contestant %s\n", paymentAmount,
paymentDescription, userID);
printf (" \n");
Can you help me? I don't know how to write my Parm parameters...