Function calls for the C language

QMF provides two function calls for the C language: DSQCIC and DSQCICE.

DSQCIC

This call is for QMF commands that do not require access to application program variables. Use this call for most QMF commands; its syntax is as follows:
     DSQCIC (&DSQCOMM,&CMDLTH,&CMDSTR)         
The parameters have the following values:
DSQCOMM
The interface communications area
CMDLTH
Length of the command string (CMDSTR); a long type parameter
CMDSTR
The QMF command to run, specified as an array of unsigned character type of the length specified by CMDLTH

The QMF command must be in uppercase.

DSQCICE

This call has an extended syntax for the QMF commands that require access to application program variables: START, TRACE, and the extended formats of GET GLOBAL and SET GLOBAL.
     DSQCICE (&DSQCOMM,&CMDLTH,&CMDSTR,         
              &PNUM,&KLTH,&KWORD,         
              &VLTH,&VALUE,&VTYPE);
The parameters have the following values:
DSQCOMM
The interface communications area.
CMDLTH
Length of the command string (CMDSTR); a long integer parameter.
CMDSTR
QMF command to run; an array of unsigned character type. The QMF command must be in uppercase.
PNUM
Number of command keywords or trace areas; a long integer parameter.
KLTH
The length of each specified keyword (KWORD) or trace title; a long integer parameter or an array of long integer parameters.
KWORD
QMF keyword, keywords, or address of trace titles; each is a character, array of characters, or array of addresses to trace titles.
VLTH
The length of each value that is associated with the keyword or trace title; a long integer parameter or array of long integer parameters.
VALUE
The value that is associated with each keyword or the address of a value that is associated with a trace title.

Its type is specified in the VTYPE parameter and can be an unsigned character array, a long integer parameter, or array of long integer parameters. For trace data, VTYPE must be FINT.

VTYPE
Data type of the contents of the VALUE parameter.

This parameter has one of two values, which are provided in the interface communications area, DSQCOMMC:

  • DSQ_VARIABLE_CHAR for unsigned character type
  • DSQ_VARIABLE_FINT for long integer

All of the values that are specified in the VALUE field must have the data type that is specified by VTYPE.

The C language interface has the following parameter considerations:
  • Command strings and the START, GET, and SET command parameters are all input character strings. With these strings, C requires you to pass a storage area that is terminated with a null value, which must be included in the length of the parameter. Use the compile-time length function to obtain the parameter length that is passed to the QMF interface.
  • If the string is not terminated by a null value before reaching the end of the string, an error is returned by QMF. The null value (X'00') indicates the end of a character string.
  • For C parameters that are output character strings, including values obtained by the GET command, QMF moves data from QMF storage to the storage area of the application. QMF also sets the null indicator at the end of the string. If the character string does not fit in the user's storage area, a warning message is issued and the data is truncated on the right. A null indicator is always placed at the end of the data string.