You can access HFS files from a batch program by specifying the HFS file name in the DD statement or in the TITLE option of the OPEN statement.
For example, to access the HFS file /u/USER/sample.txt by using the DD HFS, you would code the DD statement as follows:
//HFS DD PATH='/u/USER/sample.txt',PATHOPTS=ORDONLY,DSNTYPE=HFS
To access the same file by using the TITLE option of the OPEN statement, you would code:
OPEN FILE(HFS) TITLE('//u/USER/sample.txt');
Note the two forward slashes in the TITLE option: the first indicates that what follows is a file name (rather than a DD name), and the second is the start of the fully qualified HFS file name (and fully qualified names have to be used when HFS files are referenced under batch, because there is no current directory that could be used to complete a file specification).
You can access HFS files from a batch program using PL/I dynamic allocation by specifying the HFS file name using one of the following methods:
The following example shows how to access HFS files by using these methods:
//HFS DD PATH='/u/USER/sample.txt',PATHOPTS=ORDONLY...
OPEN FILE(HFS) TITLE('PATH(/u/USER/sample.txt)');
xx = putenv('DD_HFS=/u/USER/sample.txt');
Dcl plixopt char(100) var ext static
init('ENVAR("DD_HFS=PATH(/u/USER/sample.txt)")');
PL/I decides how to treat HFS files under batch in the following order:
To access a fixed length z/OS file from UNIX, the record size of the file must be specified either in the ENVIRONMENT attribute of the file or in the TITLE option on the OPEN statement. So,
'/dataset.name,type(fixed),recsize(80)'