ILE C/C++ Run-Time Library Functions


QXXCHGDA() -- Change Data Area

Format

#include <xxdtaa.h>
 
void QXXCHGDA(_DTAA_NAME_T dtaname, short int offset, short int len,
              char *dtaptr);

Language Level: ILE C Extension

Threadsafe: Yes.

Description

The QXXCHGDA() function allows you to change the data area specified by dtaname, starting at position offset, with the data in the user buffer pointed to by dtaptr of length len. The structure dtaname contains the names of the data area and the library that contains the data area. The values that can be specified for the data area name are:

*LDA
Specifies that the contents of the local data area are to be changed. The library name dtaa_lib must be blank.

*GDA
Specifies that the contents of the group data area are to be changed. The library name dtaa_lib must be blank.

data-area-name
Specifies that the contents of the data area created using the Create Data Area (CRTDTAARA) CL command are to be changed. The library name dtaa_lib must be either *LIBL, *CURLIB, or the name of the library where the data area (data-area-name) is located. The data area is locked while it is being changed.

QXXCHGDA can only be used to change character data.

Note:
This function accepts and returns only EBCDIC character strings. When LOCALETYPE(*LOCALEUTF) is specified on the compilation command, the user may need to convert any non-EBCDIC character strings to EBCDIC before calling this function and convert any resulting EBCDIC character strings to the correct CCSID.

Example that uses QXXCHGDA()


#include <stdio.h>
#include <xxdtaa.h>
 
#define START   1
#define LENGTH  8
 
int main(void)
{
  char newdata[LENGTH] = "new data";
 
  /* The local data area will be changed              */
  _DTAA_NAME_T dtaname = {"*LDA      ", "          "};
 
  /* Use function to change the local data area.      */
  QXXCHGDA(dtaname,START,LENGTH,newdata);
  /* The first 8 characters in the local data area    */
  /* are: new data                                    */
}

Related Information


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]