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
Job CCSID Interface
All character data sent to this function is expected to be in the CCSID of the job. All character data returned by this function is in the CCSID of the job. See Understanding CCSIDs and Locales for more information.
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.
Example
#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 */
}