QXXRTVDA() — Retrieve Data Area
Format
#include <xxdtaa.h>
void QXXRTVDA(_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 following typedef definition
is included in the <xxdtaa.h> header file. The character arrays
are not null-ended strings so they must be blank filled.
typedef struct _DTAA_NAME_T {
char dtaa_name[10]; /* name of data area */
char dtaa_lib[10]; /* library that contains data area */
}_DTAA_NAME_T;
The
QXXRTVDA()
function retrieves a copy
of the data area specified by dtaname starting
at position offset with a length of 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
- The contents of the local data area are to be retrieved. The library name dtaa_lib must be blank.
- *GDA
- The contents of the group data area are to be retrieved. The library name dtaa_lib must be blank.
- *PDA
- Specifies that the contents of the program initialization parameters (PIP) data area are to be retrieved. The PIP data area is created for each pre-started job and is a character area up to 2000 characters in length. You cannot retrieve the PIP data area until you have acquired the requester. 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 retrieved. 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 the data is being retrieved.
The parameter dtaptr is a pointer to the storage that receives the retrieved copy of the data area. Only character data can be retrieved using QXXRTVDA.
Example
#include <stdio.h>
#include <xxdtaa.h>
#define DATA_AREA_LENGTH 30
#define START 6
#define LENGTH 7
int main(void)
{
char uda_area[DATA_AREA_LENGTH];
/* Retrieve data from user-defined data area currently in MYLIB */
_DTAA_NAME_T dtaname = {"USRDDA ", "MYLIB "};
/* Use the function to retrieve some data into uda_area. */
QXXRTVDA(dtaname,START,LENGTH,uda_area);
/* Print the contents of the retrieved subset. */
printf("uda_area contains %7.7s\n",uda_area);
}