VOCPATH()

VOCPATH()

Top  Previous  Next

 

The VOCPATH() function returns the pathname for a file referenced via the VOC.

 

 

Format

 

VOCPATH(filename {, dict.flag})

 

where

 

filenameis the file name for which the pathname is to be returned. The extended file name syntaxes are allowed.

 

dict.flagevaluates to True to return the dictionary pathname, False to return the data pathname. If omitted, the data pathname is returned.

 

 

The VOCPATH() function processes the VOC file to return the pathname for the supplied filename. If filename corresponds to a Q-pointer, the function resolves the remote reference.

 

The optional dict.flag argument allows a program to specify whether the returned pathname should be that of the data or dictionary components of the file. The function also recognises use of a prefix of DICT and a single space on the front of the filename, returning the dictionary pathname regardless of the value of dict.flag.

 

If the function is successful, the return value is the file pathname and the STATUS() function will return zero. If the filename cannot be resolved to a pathname, the return value will be a null string and the STATUS() function will return an explanatory error number.

 

 

Examples

 

DISPLAY VOCPATH('SALES')

 

This statement would display the pathname of the data part of the SALES file.

 

 

DISPLAY VOCPATH('SALES', @true)

 

Adding the dict.flag as True would display the pathname of the dictionary part of the SALES file.

 

 

DISPLAY VOCPATH('DICT SALES')

 

Use of the DICT prefix would also display the pathname of the dictionary part of the SALES file.

 

 

DISPLAY VOCPATH('CUSTOMERS,NORTH')

 

Used with a multi-file reference, the pathname returned will be that of the NORTH subfile of the CUSTOMERS file.

 

 

DISPLAY VOCPATH('HR:PAYROLL')

 

This example uses an extended file name syntax to resolve the pathname of the PAYROLL file in the HR account.