ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » Mainframe, CICS, TXSeries » Using JCL(COMPSERV) to compile C code

Post new topic  Reply to topic
 Using JCL(COMPSERV) to compile C code « View previous topic :: View next topic » 
Author Message
Jeremy1981
PostPosted: Tue Nov 24, 2009 2:04 pm    Post subject: Using JCL(COMPSERV) to compile C code Reply with quote

Newbie

Joined: 24 Nov 2009
Posts: 3

Hello friends,

Sorry for troubling you all

I have the following MQSERV C code

Code:

/*********************************************************************/         
/* Notes for completion:                                             */         
/* Read the comments provided, and make sure you replace the ????s   */         
/* with the appropriate code!                                        */         
/*********************************************************************/         
                                                                               
#include<stdio.h>                                                               
#include<cmqc.h>                                                               
                                                                               
#define qNameReq  ".MAINFRAME.CONTEST.REQQ"                                     
#define qNameData ".MAINFRAME.CONTEST.DATAQ"                                   
                                                                               
#define BufferLength 1000                                                       
                                                                               
                                                                               
void ProcessMessages(MQHCONN, MQHOBJ, MQHOBJ);                                 

int main(int argc, char** argv)                                                 
{                                                                               
  MQOD reqOD = {MQOD_DEFAULT};                                                 
  MQOD dataOD = {MQOD_DEFAULT};                                                 
  MQHOBJ hObjReq;                                                               
  MQHOBJ hObjData;                                                             
  MQHCONN HConn;                                                               
  MQLONG mqcc, mqrc;                                                           
  char* pUser;                                                                 
                                                                               
  if( argc < 3 )                                                               
  {                                                                             
    printf("Usage: %s <qmgr> <userid>", argv[0]);                               
    exit(1);                                                                   
  }                                                                             
                                                                               
  pUser = argv[2];                                                             
                                                                               
  printf("UserID :%s:\n", argv[2]);                                             
                                                                               
  printf("Connecting to %s\n", argv[1]);                                       
  MQCONN(argv[1], &HConn, &mqcc, &mqrc);                                       
  printf("MQCONN RC: %d\n", mqrc);                                             
                                                                               
  if( mqrc != MQRC_NONE )                                                       
    exit(2);                                                                   
                                                                               
  /*******************************************************************/         
  /* Open the request queue that we will get request from            */         
  /*******************************************************************/         
  reqOD.ObjectType = MQOT_Q;                                                   
  memset(reqOD.ObjectName, 0, MQ_Q_NAME_LENGTH);                               
  strcpy(reqOD.ObjectName, pUser);                                             
  memcpy(reqOD.ObjectName+strlen(pUser), qNameReq, strlen(qNameReq));           
                                                                               
  printf("Opening queue %s\n", reqOD.ObjectName);                           
                                                                               
  MQOPEN(HConn, &reqOD, MQOO_INPUT_SHARED, &hObjReq, &mqcc, &mqrc);             
  printf("MQOPEN RC: %d\n", mqrc);                                             
                                                                               
  if( mqrc != MQRC_NONE )                                                       
    exit(3);                                                                   
                                                                               
                                                                               
  /*******************************************************************/         
  /* Open the data queue, where we find the responses to send back   */         
  /*******************************************************************/         
  memset(dataOD.ObjectName, 0, MQ_Q_NAME_LENGTH);                               
  strcpy(dataOD.ObjectName, pUser);                                             
  memcpy(dataOD.ObjectName+strlen(pUser), qNameData,                           
         strlen(qNameData));                                                   
                                                                               
  printf("Opening queue %s\n", dataOD.ObjectName);                             
                                                                             
  MQOPEN(HConn, &dataOD, MQOO_BROWSE, &hObjData, &mqcc, &mqrc);                 
  printf("MQOPEN RC: %d\n", mqrc);                                             
  if( mqrc != MQRC_NONE )                                                       
    exit(4);                                                                   
                                                                               
                                                                               
  /*******************************************************************/         
  /* Having opened the two queues we can, process the request queue  */         
  /*******************************************************************/         
  ProcessMessages(HConn, hObjReq, hObjData);                                   
                                                                               
  return(0);                                                                   
}                                                                               
                                                                               
                                                                               
void ProcessMessages(MQHCONN hConn, MQHOBJ hReqObj, MQHOBJ hDataObj)           
{                                                                               
  MQMD reqMD = {MQMD_DEFAULT};                                                 
  MQGMO reqGMO = {MQGMO_DEFAULT};                                               
                                                                               
  MQMD repMD = {MQMD_DEFAULT};                                                 
  MQPMO repPMO = {MQPMO_DEFAULT};                                               
  MQOD repOD = {MQOD_DEFAULT};                                                 
  MQHOBJ hRepObj;                                                               
                                                                               
  MQMD dataMD = {MQMD_DEFAULT};                                                 
  MQGMO dataGMO = {MQGMO_DEFAULT};                                             
                                                                               
  MQLONG mqcc, mqrc;                                                           
  MQLONG mqccback, mqrcback;                                                   
  char* pBuffer;                                                               
  MQLONG DataLength;                                                           
                                                                               
  pBuffer = (char*)malloc(BufferLength);                                       
  if( pBuffer == NULL )                                                         
  {                                                                             
    printf("unable to allocate buffer\n");                                     
    exit(5);                                                                   
  }                                                                             
                                                                               
  mqrc = MQRC_NONE;                                                             
                                                                               
  /*******************************************************************/         
  /* Process the queue until there is some sort of failure           */         
  /*******************************************************************/         
  while( mqrc == MQRC_NONE )                                                   
  {                                                                             
                                                                               
    /*****************************************************************/         
    /* Get the request message                                       */         
    /*****************************************************************/         
    /* Make sure we clear the MsgId and CorrelId as we have no idea  */         
    /* what they are going to be, so just get the first msg from the */         
    /* queue                                                         */         
    /*****************************************************************/         
    memset( reqMD.MsgId, 0, MQ_MSG_ID_LENGTH);                                 
    memset( reqMD.CorrelId, 0, MQ_CORREL_ID_LENGTH);                         
                                                                               
    /* Wait forever for a message to arrive to process               */         
    reqGMO.Options = MQGMO_NO_SYNCPOINT | MQGMO_WAIT;                           
    reqGMO.WaitInterval = MQWI_UNLIMITED;                                       
                                                                               
    MQGET(hConn, hReqObj, &reqMD, &reqGMO, BufferLength, pBuffer,               
          &DataLength, &mqcc, &mqrc);                                           
                                                                               
    if( mqrc != MQRC_NONE )                                                     
    {                                                                           
      printf("Failed to get message from req queue: MQRC %d\n", mqrc);         
      exit(6);                                                                 
    }                                                                           
                                                                               
    /*****************************************************************/         
    /* Browse the data message based on msgID in request message     */         
    /*****************************************************************/         
    /* The first 24 bytes of the message we just got are the MsgId   */         
    /* of the message on the data queue that we need to get to send  */         
    /* back to the requester                                         */         
    /*****************************************************************/         
    memcpy(dataMD.MsgId, pBuffer, MQ_MSG_ID_LENGTH);                           
    memset(dataMD.CorrelId, pBuffer, MQ_CORREL_ID_LENGTH);                     
    dataGMO.Options = MQGMO_BROWSE_FIRST | MQGMO_NO_WAIT;                       
                                                                               
    MQGET(hConn, hDataObj, &dataMD, &dataGMO, BufferLength, pBuffer,           
          &DataLength, &mqcc, &mqrc);                                           
                                                                               
    if( mqrc != MQRC_NONE )                                                     
    {                                                                           
      printf("Failed to get message from data queue: MQRC %d\n", mqrc);         
      /* If we are running in syncpoint we would have to backout here*/         
      exit(7);                                                                 
    }                                                                           
                                                                               
    /*****************************************************************/         
    /* Open the reply to queue                                       */         
    /*****************************************************************/         
    repOD.ObjectType = MQOT_Q;                                                 
    memcpy(repOD.ObjectName, reqMD.ReplyToQ, MQ_Q_NAME_LENGTH);                 
                                                                               
    MQOPEN(hConn, &repOD, MQOO_OUTPUT, &hRepObj, &mqcc, &mqrc);                 
                                                                               
    if( mqrc != MQRC_NONE )                                                     
    {                                                                           
      printf("Failed to open reply queue %s, MQRC %d\n",                       
             repOD.ObjectName, mqrc);                                           
      /* If we are running in syncpoint we would have to backout here*/         
      exit(8);                                                                 
    }                                                                           
                                                                               
    /*****************************************************************/         
    /* Put the reply message                                         */         
    /*****************************************************************/         
    /* It is important to look at the Report options that the client */         
    /* sent us, so that we know what MsgId and CorrelId to use when  */         
    /* we send back the reply message                                */         
    /*****************************************************************/         
    if( (reqMD.Report & MQRO_PASS_CORREL_ID) )                                 
      repMD.CorrelId = reqMD.CorrelId;
    else                                                                       
      repMD.CorrelId = reqMD.MsgId;
                                                                               
    if( (reqMD.Report&MQRO_PASS_MSG_ID) )                                       
      repMD.MsgId = reqMD.CorrelId;
    else                                                                       
      repPMO.Options = MQPMO_NEW_MSG_ID;
                                                                               
    repMD.MsgType = MQMT_REPLY;                                                 
    repPMO.Options = MQPMO_NO_SYNCPOINT;                                       
                                                                               
    MQPUT(hConn, hRepObj, &repMD, &repPMO, DataLength, pBuffer,                 
          &mqcc, &mqrc);                                                       
                                                                               
                                                                               
    if( mqrc != MQRC_NONE )                                                     
    {                                                                           
      printf("Failed to put reply correctly, MQRC %d\n", mqrc);                 
      /* If we are running in syncpoint we would have to backout here*/         
      break;                                                                   
    }                                                                           
    else                                                                       
    {                                                                           
      /* If we are running in syncpoint we would have to commit here */         
    }                                                                           
                                                                               
    /* Close the reply to queue                                      */         
    MQCLOSE(hConn, hReqObj, MQCO_NONE, &mqcc, &mqrc);                         
                                                                               
    printf("Message data: %s\n", pBuffer);                                     
                                                                               
  }                                                                             
                                                                               
                                                                               
                                                                               
}


The place which I modify was
Code:




memset( reqMD.CorrelId, 0, MQ_CORREL_ID_LENGTH);

memcpy(dataMD.MsgId, pBuffer, MQ_MSG_ID_LENGTH);                           

memset(dataMD.CorrelId, pBuffer, MQ_CORREL_ID_LENGTH);
   
if( (reqMD.Report & MQRO_PASS_CORREL_ID) )                                 
      repMD.CorrelId = reqMD.CorrelId;
else                                                                       
      repMD.CorrelId = reqMD.MsgId;
                                                                               
if( (reqMD.Report&MQRO_PASS_MSG_ID) )                                       
      repMD.MsgId = reqMD.CorrelId;
else                                                                       
      repPMO.Options = MQPMO_NEW_MSG_ID;

 /* Close the reply to queue                                      */         
 MQCLOSE(hConn, hReqObj, MQCO_NONE, &mqcc, &mqrc);

But when I use JCL(COMPSERV) to compile above
The COMSERV Code was
Code:

//COMPSERV JOB MSGCLASS=H                                           
//* INSTRUCTIONS                                                   
//*                                                                 
//* BEFORE SUBMITTING THIS JCL IT IS NECESSARY TO TAILOR IT. REPLACE
//* THE FOLLOWING WITH APPROPRIATE VALUES:                         
//* &JOBPREFIX - THE PREFIX FOR THIS JOB                           
//* ZCONABC    - THE USERID YOU ARE RUNNING UNDER                   
//*                                                                 
//PP1 EXEC PGM=CBCDRVR,REGION=0M,                                   
// PARM=('OPTF')                                                   
//SYSOPTF  DD *                                                     
  PPONLY,RENT,LONGNAME,                                             
  DEF(BATCH,MVS),                                                   
  NOEXPO,NOMAR,                                                     
  ,                                                                 
/*                                                                 
//STEPLIB  DD DSN=CEE.SCEERUN,DISP=SHR                             
//         DD DSN=CBC.SCBCCMP,DISP=SHR                         
//SYSLIB   DD DSN=CEE.SCEEH.H,DISP=SHR                         
//         DD DSN=CEE.SCEEH.SYS.H,DISP=SHR                     
//         DD DSN=CEE.SCEEH.NETINET.H,DISP=SHR                 
//         DD DSN=CEE.SCEEH.ARPA.H,DISP=SHR                     
//         DD DSN=WMQ.V600.SCSQC370,DISP=SHR                   
//SYSLIN   DD DSN=&&LOAD,DISP=(,DELETE,DELETE),                 
//         UNIT=SYSDA,SPACE=(3200,(30,30)),                     
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)                 
//SYSIN    DD DSN=ZCONABC.CONTEST.D2008.PART3.C(MQSERV),DISP=SHR
//SYSPRINT DD SYSOUT=*                                         
//SYSCPRT  DD SYSOUT=*                                         
//SYSTERM  DD DUMMY                                             
//SYSUT1   DD DSN=&&SYSUT1,DISP=(,DELETE,DELETE),               
//         UNIT=SYSDA,SPACE=(3200,(30,30)),                     
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)                 
//SYSUT2   DD DSN=&&SYSUT2,DISP=(,DELETE,DELETE),               
//         UNIT=SYSDA,SPACE=(3200,(30,30)),                     
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)   
//SYSUT3   DD DSN=&&SYSUT3,DISP=(,DELETE,DELETE),
//         UNIT=SYSDA,SPACE=(3200,(30,30)),       
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)   
//SYSUT4   DD DSN=&&SYSUT4,DISP=(,DELETE,DELETE),
//         UNIT=SYSDA,SPACE=(3200,(30,30)),       
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)   
//SYSUT5   DD DSN=&&SYSUT5,DISP=(,DELETE,DELETE),
//         UNIT=SYSDA,SPACE=(3200,(30,30)),       
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)   
//SYSUT6   DD DSN=&&SYSUT6,DISP=(,DELETE,DELETE),
//         UNIT=SYSDA,SPACE=(3200,(30,30)),       
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)   
//SYSUT7   DD DSN=&&SYSUT7,DISP=(,DELETE,DELETE),
//         UNIT=SYSDA,SPACE=(3200,(30,30)),       
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)   
//SYSUT8   DD DSN=&&SYSUT8,DISP=(,DELETE,DELETE),
//         UNIT=SYSDA,SPACE=(3200,(30,30)),       
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)   
//SYSUT9   DD DSN=&&SYSUT9,DISP=(,DELETE,DELETE), 
//         UNIT=SYSDA,SPACE=(3200,(30,30)),       
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)   
//SYSUT10  DD DSN=&&SYSUT10,DISP=(,PASS),         
//         UNIT=SYSDA,SPACE=(3200,(30,30)),       
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)   
//CMP1 EXEC PGM=CBCDRVR,REGION=0M,                 
// COND=(7,LT),                                   
// PARM=('OPTF')                                   
//SYSOPTF  DD *                                   
  RENT,SOURCE,LIST,OFFSET,LONGNAME,DLL,NOOPT,     
  DEF(BATCH,MVS),                                 
  NOEXPO,                                         
  ,                                               
/*                                                 
//STEPLIB  DD DSN=CEE.SCEERUN,DISP=SHR             
//         DD DSN=CBC.SCBCCMP,DISP=SHR             
//SYSLIB   DD DSN=CEE.SCEEH.H,DISP=SHR                 
//         DD DSN=CEE.SCEEH.SYS.H,DISP=SHR             
//         DD DSN=WMQ.V600.SCSQC370,DISP=SHR           
//SYSLIN   DD DSN=&&LOAD,                               
//         DISP=(,PASS),UNIT=SYSDA,SPACE=(3200,(30,30)),
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)         
//SYSPRINT DD SYSOUT=*                                 
//SYSCPRT  DD SYSOUT=*                                 
//SYSTERM  DD DUMMY                                     
//SYSUT1   DD DSN=&&SYSUT1,DISP=(,DELETE,DELETE),       
//         UNIT=SYSDA,SPACE=(3200,(30,30)),             
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)         
//SYSUT2   DD DSN=&&SYSUT2,DISP=(,DELETE,DELETE),       
//         UNIT=SYSDA,SPACE=(3200,(30,30)),             
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)         
//SYSUT3   DD DSN=&&SYSUT3,DISP=(,DELETE,DELETE),       
//         UNIT=SYSDA,SPACE=(3200,(30,30)),             
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)         
//SYSUT4   DD DSN=&&SYSUT4,DISP=(,DELETE,DELETE),
//         UNIT=SYSDA,SPACE=(3200,(30,30)),       
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)   
//SYSUT5   DD DSN=&&SYSUT5,DISP=(,DELETE,DELETE),
//         UNIT=SYSDA,SPACE=(3200,(30,30)),       
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)   
//SYSUT6   DD DSN=&&SYSUT6,DISP=(,DELETE,DELETE),
//         UNIT=SYSDA,SPACE=(3200,(30,30)),       
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)   
//SYSUT7   DD DSN=&&SYSUT7,DISP=(,DELETE,DELETE),
//         UNIT=SYSDA,SPACE=(3200,(30,30)),       
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)   
//SYSUT8   DD DSN=&&SYSUT8,DISP=(,DELETE,DELETE),
//         UNIT=SYSDA,SPACE=(3200,(30,30)),       
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)   
//SYSUT9   DD DSN=&&SYSUT9,DISP=(,DELETE,DELETE),
//         UNIT=SYSDA,SPACE=(3200,(30,30)),       
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)   
//SYSUT10  DD DUMMY                                     
//SYSIN    DD DSN=&&SYSUT10,DISP=(OLD,DELETE,DELETE)     
//OUT1 EXEC PGM=EDCALIAS,                               
//   PARM='ADD MQSERV',                                 
//   COND=(7,LT),REGION=2048K                           
//STEPLIB  DD DSN=CEE.SCEERUN,DISP=SHR                   
//SYSIN    DD DSN=*.CMP1.SYSLIN,                         
//         DISP=(OLD,DELETE)                             
//SYSLIB   DD DSN=ZCONABC.CONTEST.D2008.PART3.LIB,       
//         DCB=(DSORG=PO,LRECL=80),DISP=SHR             
//SYSOUT   DD SYSOUT=*                                   
//SYSMSGS  DD DSN=CEE.SCEEMSGP(EDCPMSGE),DISP=SHR       
//SYSPRINT DD SYSOUT=*                                   
//* [TITLE]SKELETON JCL TO LINK ONE BATCH PROGRAM[/TITLE]
//* [PLATFORMS]MVS[/PLATFORMS]                           
//PLK1    EXEC PGM=EDCPRLK,COND=(7,LT),                 
//         REGION=2M,PARM='OMVS'                         
//STEPLIB  DD DSN=CEE.SCEERUN,DISP=SHR                   
//SYSMSGS  DD DSN=CEE.SCEEMSGP(EDCPMSGE),DISP=SHR               
//SYSLIB   DD DSN=CEE.SCEECPP,DISP=SHR                           
//         DD DSN=ZCONABC.CONTEST.D2008.PART3.LIB,DISP=SHR       
//SYSIN    DD DSN=ZCONABC.CONTEST.D2008.PART3.LIB(MQSERV),       
//            DISP=SHR                                           
//         DD *                                                 
/*                                                               
//SYSMOD   DD DSN=&&PLNK,DISP=(,PASS),                           
//            UNIT=SYSDA,SPACE=(6400,(30,30)),                   
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)               
//SYSDEFSD DD SYSOUT=*                                           
//SYSOUT   DD SYSOUT=*                                           
//SYSPRINT DD SYSOUT=*                                           
//*                                                             
//LK1     EXEC PGM=IEWL,REGION=2M,                               
// PARM='RENT,LIST,DYNAM(DLL),MAP,LET,XREF,AMODE(31),RMODE(ANY)',
// COND=(7,LT)                                                   
//SYSLIB   DD DSN=CEE.SCEELKED,DISP=SHR                         
//         DD DSN=ZCONABC.CONTEST.D2008.PART3.LOAD,DISP=SHR
//SYSLIN   DD DSN=*.PLK1.SYSMOD,DISP=(OLD,DELETE)           
//         DD DDNAME=SYSIN                                 
//MQLIB1   DD DSN=WMQ.V600.SCSQLOAD,DISP=SHR               
//SYSLMOD  DD DSN=ZCONABC.CONTEST.D2008.PART3.LOAD,DISP=SHR
//SYSUT1   DD DSN=&&SYSUT1,DISP=(,DELETE,DELETE),           
//            UNIT=SYSDA,SPACE=(6400,(30,30)),             
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200)         
//SYSPRINT DD SYSOUT=*                                     
//SYSIN    DD *                                             
  INCLUDE MQLIB1(CSQBSTUB)                                 
  NAME MQSERV(R)                                           
/*                                                         


I got the JCL log
Code:

0290  IRR010I  USERID ZCONABC  IS ASSIGNED TO THIS JOB.                         
0281  ICH70001I ZCONABC  LAST ACCESS AT 21:08:41 ON TUESDAY, NOVEMBER 24, 2009 
0090  $HASP373 COMPSERV STARTED - INIT 1    - CLASS A - SYS MVST               
0290  -                                         --TIMINGS (MINS.)--             
       ----PAGING COUNTS---                                                     
0290  -JOBNAME  STEPNAME PROCSTEP    RC   EXCP    CPU    SRB  CLOCK   SERV  PG 
         PAGE   SWAP    VIO SWAPS STEPNO                                       
0290  -COMPSERV          PP1         00    598    .00    .00    .00  22681   0 
            0      0      0     0     1                                         
0290  -COMPSERV          CMP1        12    603    .00    .00    .00  22048   0 
            0      0      0     0     2                                         
0290  -COMPSERV          OUT1     FLUSH      0    .00    .00    .00      0   0 
            0      0      0     0     3                                         
0290  -COMPSERV          PLK1     FLUSH      0    .00    .00    .00      0   0 
            0      0      0     0     4                                         
0290  -COMPSERV          LK1      FLUSH      0    .00    .00    .00      0   0 
            0      0      0     0     5                                         
0290  -COMPSERV ENDED.  NAME-                     TOTAL CPU TIME=   .00  TOTAL 
       ELAPSED TIME=   .01                                                     
0090  $HASP395 COMPSERV ENDED                                                   

The OUT1, PLK1 & LK1 seems nothing to do.
That look like some problem with my MQSERV C code.
How to tailor it.
Could somebody help me, please.
I'm getting deeply annoyed with a program[/code]
Back to top
View user's profile Send private message
bruce2359
PostPosted: Tue Nov 24, 2009 2:27 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9399
Location: US: west coast, almost. Otherwise, enroute.

Quote:
COMPSERV CMP1 12 603 .00 .00 .00 22048 0

The CMP1 step got a condition code 12. Since you didn't post the diagnostics from the compile, I'd have to guess that there is source language error.

I gather that you are new to mainframes, yes?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
Jeremy1981
PostPosted: Tue Nov 24, 2009 2:44 pm    Post subject: Reply with quote

Newbie

Joined: 24 Nov 2009
Posts: 3

Yes, indeed I'm new to mainframe.

So...how should I do to modify it.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Nov 24, 2009 3:09 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Jeremy1981 wrote:
So...how should I do to modify it.


See why the compiler objected to your source and threw a CC12.

Change the code accordingly.

Rerun the JCL.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Tue Nov 24, 2009 3:30 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9399
Location: US: west coast, almost. Otherwise, enroute.

Quote:
there is source language error.

Which means that you need to look at the diagnostics output from the compile, identify the line(s) that are in error, and correct them. This is no different from compiling on Windows or UNIX.

Are you new to C programming, as well?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
Jeremy1981
PostPosted: Tue Nov 24, 2009 4:15 pm    Post subject: Reply with quote

Newbie

Joined: 24 Nov 2009
Posts: 3

[quote="bruce2359"]
Quote:


Are you new to C programming, as well?


Yes, My C programming is not well.

Just begin to learn.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Tue Nov 24, 2009 4:27 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9399
Location: US: west coast, almost. Otherwise, enroute.

The best recommendation is to find someone at your work that has more mainframe and C programming experience.

Additionally, there are other post sites that focus on both z/OS, and C programming.

We're here to help with WebSphere MQ and related products and issues.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
kevinf2349
PostPosted: Mon Nov 30, 2009 7:21 am    Post subject: Reply with quote

Grand Master

Joined: 28 Feb 2003
Posts: 1311
Location: USA

Quote:
//SYSOPTF DD *
RENT,SOURCE,LIST,OFFSET,LONGNAME,DLL,NOOPT,
DEF(BATCH,MVS),
NOEXPO,
,
/*


I am not a C programmer but that last comma doesn't look right to me.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Nov 30, 2009 7:33 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

kevinf2349 wrote:
I am not a C programmer but that last comma doesn't look right to me.


Pedantically that's a JCL statement not part of the C code.

Not having my z/OS manual to hand it's possible that it's a mandatory positional parameter. But it could be that the code 12 is the result of a bad parameter.

Since the original poster hasn't posted any additional diagnostics (like the compiler output!) it's all just guesswork.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kevinf2349
PostPosted: Mon Nov 30, 2009 11:15 am    Post subject: Reply with quote

Grand Master

Joined: 28 Feb 2003
Posts: 1311
Location: USA

Vitor wrote:
Pedantically that's a JCL statement not part of the C code.



Even more pedantically it isn't a JCL statement it is an input stream associated with the SYSOPFT DD card.

I agree it could be positional, but .......
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Nov 30, 2009 11:22 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

kevinf2349 wrote:
Vitor wrote:
Pedantically that's a JCL statement not part of the C code.



Even more pedantically it isn't a JCL statement it is an input stream associated with the SYSOPFT DD card.


Ok, dancing on the head of a pin here but yes.

kevinf2349 wrote:
I agree it could be positional, but .......




I certainly don't remember the z/OS C compiler (or the COBOL one) taking positional parameters. But it's been a while since I had a compile deck in front of me.

But even an inexperienced person (as the original poster has admitted to being) should have spotted an "invalid parameter" message in the output.

Best advice remains that already given - seek help from an experienced person on site.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Mon Nov 30, 2009 12:01 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9399
Location: US: west coast, almost. Otherwise, enroute.

Quote:
SYSOPFT DD card.

Irritatingly, pedantically, it's a DD statement.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
kevinf2349
PostPosted: Mon Nov 30, 2009 12:55 pm    Post subject: Reply with quote

Grand Master

Joined: 28 Feb 2003
Posts: 1311
Location: USA

bruce2359 wrote:
Quote:
SYSOPFT DD card.

Irritatingly, pedantically, it's a DD statement.


which are on punched CARD images
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » Mainframe, CICS, TXSeries » Using JCL(COMPSERV) to compile C code
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.