Opening a Dataset

datasetHandle = datasetOpen (pathname, mode)

The datasetOpen function opens the dataset specified by pathname for the type of access specified by mode. Table 6-1shows the datasetOpen arguments and return values.

Table 6-1

DatasetOpen Function

 

 

 

 

 

 

Item

 

Value

Type

Description

 

 

 

 

 

Argument

 

pathname

char *

VSN:Dataset name

 

 

 

 

VSN = 6-character volser.

 

 

 

 

Volume must be listed in FX volume definition file.

 

 

 

 

Delimiter = : (colon, no spaces allowed)

 

 

 

 

Dataset name: 44 characters max, no spaces allowed.

 

 

mode

char *

r = open dataset for read access

 

 

 

 

w = open dataset for write access

 

 

 

 

 

Return value

 

datasetHandle

DATASET_HAN

Handle

 

 

-1

DLE

Error end

 

 

 

 

 

When the datasetOpen function terminates successfully, it returns a handle which identifies the dataset opened. The datasetHandle information is used as the argument of subsequent functions such as datasetGet, datasetPut, or datasetClose. Do not change the datasetHandle value returned by this function. If the datasetOpen function terminates unsuccessfully, it returns a value of -1. To get the error code information, execute the datasetGetLastError function (see section Acquiring Error Information).

The datasetOpen function has the following restrictions:

Only one dataset at a time can be open within one process. When multiple datasets need to be opened, the open dataset must be closed before another dataset can be opened. This restriction does not apply to open-system files.

A dataset which is being accessed by the datasetFindFirstFile or datasetFindNextFile function cannot be opened. The datasetFindClose function must be executed before the dataset can be opened. This restriction does not apply to open-system files.

6-4

Performing File Access Library (FAL) Operations

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

Page 158
Image 158
Hitachi MK-96RD647-01 manual Opening a Dataset, DatasetOpen Function, DatasetHandle = datasetOpen pathname, mode