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

Using environment variables

Use the export command to establish an environment variable that identifies the data set to be associated with a PL/I file, and, optionally, to specify the characteristics of that data set. The information provided by the environment variable is called data definition (or DD) information.

These environment variable names have the form DD_DDNAME where the DDNAME is the name of a PL/I file constant (or an alternate DDNAME, as defined below). If the filename refers to an HFS file, the filename has to be properly qualified. Otherwise, the PL/I library assumes the filename refers to an MVS data set.

Examples:

declare MyFile stream output;

export DD_MYFILE=/datapath/mydata.dat

/datapath/mydata.dat refers to an HFS file. The filename is fully-qualified.


export DD_MYFILE=./mydata.dat

./mydata.dat refers to an HFS file residing in the current directory.


export DD_MYFILE=mydata.dat

mydata.dat refers to an MVS data set.

The following examples show that the HFS files are accessed when using PL/I dynamic allocation:

export DD_HFS="PATH(/u/USER/sample.txt)"  
export DD_FILE="DSN(USER.FILE.EXT),SHR"   

If you are familiar with the IBM mainframe environment, you can think of the environment variable much like:

For more information about the syntax and options you can use with the DD_DDNAME environment variable, see Specifying characteristics using DD_DDNAME environment variables.

Under z/OS UNIX, where more types of varying length HFS files are supported than under batch, PL/I treats an HFS file as follows:

  1. If ENV(F) is specified in the file declaration, the file is assumed to consist of fixed length records.
  2. If a TYPE is specified in the file's EXPORT statement, the file is assumed to consist of records of that type.
  3. Otherwise the file is assumed to consist of lf-delimited records.

Terms of use | Feedback

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