Rational Developer for System z
Enterprise PL/I for z/OS, Version 4.2, Programming Guide

Accessing HFS files under z/OS

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)")');    
	 

Note:
To use PL/I dynamic allocation, specify the file names by using the DSN() format for MVS data sets, or the PATH() format for HFS files.

PL/I decides how to treat HFS files under batch in the following order:

  1. If ENV(F) is specified in the file declaration, the file is assumed to consist of fixed length records.
  2. If ENV(V) is specified in the file declaration, the file is assumed to consist of lf-delimited records.
  3. If FILEDATA=BINARY is specified on the file's DD statement, the file is assumed to consist of fixed length records.
  4. Otherwise the file is assumed to consist of lf-delimited records.

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,


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)