Acquiring Attribute Information for Multiple Datasets

A combination of the datasetFindFirstFile, datasetFindNextFile, and datasetFindClose functions is used to acquire attribute information for more than one dataset in the specified z/OS volume.

1. datasetHandle = datasetFindFirstFile (pathname, &ffd)

The datasetFindFirstFile function acquires the attribute information for the first dataset in the volume specified by pathname and returns the data into ffd. Table 6-7shows the datasetFindFirstFile arguments and return values.

Table 6-7

DatasetFindFirstFile Function

 

 

 

 

 

Item

 

Value

Type

Description

 

 

 

 

 

Argument

 

pathname

char *

VSN

 

 

 

 

VSN = 6-character volser.

 

 

 

DATASET_FIND_DATA

Volume must be listed in volume definition file.

 

 

ffd

Area where the dataset attribute information is stored.

 

 

 

 

 

Return value

 

datasetHandl

DATASET_HANDLE

Normal end

 

 

e

 

Error end

 

 

-1

 

 

 

 

 

 

 

When the datasetFindFirstFile function terminates successfully, it returns a handle which identifies the dataset for which the attribute information was acquired. The datasetHandle information is used as the argument of the subsequent functions datasetFindNextFile and datasetFindClose. Do not change the datasetHandle value returned by this function. If the datasetFindFirstFile function terminates unsuccessfully, it returns a value of -1. To get the error code information, execute the datasetGetLastError function (see section Acquiring Error Information). For example, when the datasetFindFirstFile function does not find any datasets in the VTOC, the datasetGetLastError function will return

DATASET_ERROR_END_NO_DATASET.

The datasetFindFirstFile function has the following restrictions:

The datasetFindFirstFile function cannot be used on an open dataset. Use this function before opening or after closing the dataset.

After a dataset has been accessed by the datasetFindFirstFile function, the dataset cannot be opened until after the datasetFindClose function is called.

Performing File Access Library (FAL) Operations

6-9

Hitachi USP V Cross-OS File Exchange User’s Guide

Page 163
Image 163
Hitachi MK-96RD647-01 manual DatasetFindFirstFile Function, Argument Pathname Char