+

Search Tips | Advanced Search

crtmqcvx (create data conversion code)

Create data conversion code from data type structures.


Purpose

Use the crtmqcvx command to create a fragment of code that performs data conversion on data type structures. The command generates a C function that can be used in an exit to convert C structures.

The command reads an input file containing structures to be converted, and writes an output file containing code fragments to convert those structures.

For information about using this command, see Utility for creating conversion-exit code.


Syntax

crtmqcvxSourceFileTargetFile


Required parameters

    SourceFile
    The input file containing the C structures to convert.

    TargetFile
    The output file containing the code fragments generated to convert the structures.


Return codes

Return code Description
0 Command completed normally
10 Command completed with unexpected results
20 An error occurred during processing


Examples

The following example shows the results of using the data conversion command against a source C structure. The command issued is:
crtmqcvx source.tmp target.c
The input file, source.tmp, looks like this:
 /* This is a test C structure which can be converted by the */
 /* crtmqcvx utility                                         */
 
 struct my_structure
 {
     int    code;
     MQLONG value;
 };
The output file, target.c, produced by the command, looks like this:
 MQLONG Convertmy_structure(
              PMQDXP  pExitParms,
              PMQBYTE *in_cursor,
              PMQBYTE *out_cursor,
              PMQBYTE in_lastbyte,
              PMQBYTE out_lastbyte,
              MQHCONN hConn,
              MQLONG  opts,
              MQLONG  MsgEncoding,
              MQLONG  ReqEncoding,
              MQLONG  MsgCCSID,
              MQLONG  ReqCCSID,
              MQLONG  CompCode,
              MQLONG  Reason)
 {
     MQLONG ReturnCode = MQRC_NONE;
 
     ConvertLong(1); /* code */
 
     AlignLong();
     ConvertLong(1); /* value */
 
 Fail:
     return(ReturnCode);
 }
We can use these code fragments in the applications to convert data structures. However, if you do so, the fragment uses macros supplied in the header file amqsvmha.h.

Last updated: 2020-10-04