The ENVIRONMENT attribute

You use the ENVIRONMENT attribute of a PL/I file declaration file to specify information about the physical organization of the data set associated with a file, and describe other related information. The format of this information must be a parenthesized option list.

Read syntax diagramSkip visual syntax diagram
>>-ENVIRONMENT--(--option-list--)------------------------------><

Abbreviation: ENV

You can specify the options in any order, separated by blanks or commas.

The following example illustrates the syntax of the ENVIRONMENT attribute in the context of a complete file declaration (the options specified are for VSAM).

DCL FILENAME FILE RECORD SEQUENTIAL
    INPUT ENV(VSAM GENKEY);

Table 1 summarizes the ENVIRONMENT options and file attributes. Certain qualifications on their use are presented in the notes and comments in the table.

Table 1. Attributes of PL/I file declarations

Data set type

S
t
r
e
a
m

Record

Legend:
C
Checked for VSAM
D
Default
I
Must be specified or implied
N
Ignored for VSAM
O
Optional
S
Must be specified
-
Invalid

File
Type

C
o
n
s
e
c
u
t
i
v
e

Sequential

Direct

Consecutive

             

B
u
f
f
e
r
e
d

U
n
b
u
f
f
e
r
e
d

R
e
g
i
o
n
a
l

T
e
l
e
p
r
o
c
e
s
s
i
n
g

I
n
d
e
x
e
d

V
S
A
M

R
e
g
i
o
n
a
l

I
n
d
e
x
e
d

V
S
A
M

File attributes1

                   

Attributes implied

File

I

I

I

I

I

I

I

I

I

I

 

Input1

D

D

D

D

D

D

D

D

D

D

File

Output

O

O

O

O

O

O

O

O

O

O

File

Environment

I

I

I

S

S

S

S

S

S

S

File

Stream

D

-

-

-

-

-

-

-

-

-

File

Print1

O

-

-

-

-

-

-

-

-

-

File stream output

Record

-

I

I

I

I

I

I

I

I

I

File

Update

-

O

O

O

-

O

O

O

O

O

File record

Sequential

-

D

D

D

-

D

D

-

-

D

File record

Buffered

-

D

-

-

I

D

D

-

-

S

File record

Keyed2

-

-

-

O

I

O

O

I

I

O

File record

Direct

-

-

-

-

-

-

S

S

S

S

File record keyed

 

                     

ENVIRONMENT options

Comments

F|FB|FS|FBS|V|
  VB|VS|VBS||U

I
 

S
 

S
 

-
 

-
 

-
 

N
 

-
 

-
 

N
 

VS and VBS are invalid
 with Stream

F|FB|U

S

S

-

-

-

-

N

-

-

N

ASCII data sets only

F|V|U

-

-

-

S

-

-

N

S

-

N

Only F for REGIONAL(1)

F|FB|V|VB

-

-

-

-

-

S

N

-

S

N

 

RECSIZE(n)

I

I

I

I

S

I

C

I

I

C

RECSIZE and/or BLKSIZE
must be specified for
consecutive

BLKSIZE(n)

I

I

I

I

-

I

N

I

I

N

 indexed, and regional files

SCALARVARYING

-

O

O

O

-

O

O

O

O

O

Invalid for ASCII data sets

CONSECUTIVE

D

D

D

-

-

-

O

-

-

O

Allowed for VSAM ESDS

LEAVE|REREAD

O

O

O

-

-

-

-

-

-

-

CTLASA|CTL360

-

O

O

-

-

-

-

-

-

-

Invalid for ASCII data sets

GRAPHIC

O

-

-

-

-

-

-

-

-

-

 

INDEXED

-

-

-

-

-

S

O

-

S

O

Allowed for VSAM ESDS

KEYLOC(n)

-

-

-

-

-

O

-

-

O

-

 

ORGANIZATION

D

-

-

-

-

-

-

-

-

-

 

GENKEY

-

-

-

-

-

O

O

-

O

O

INPUT or UPDATE files only;
 KEYED is required

REGIONAL(1)

-

-

-

S

-

-

-

S

-

-

 

VSAM

-

-

-

-

-

-

S

-

-

S

 

BKWD

-

-

-

-

-

-

O

-

-

O

 

REUSE

 

-

 

-

 

-

 

-

 

-

 

-

 

O

 

-

 

-

 

O

 

OUTPUT file only

 

Notes:
  1. A file with the INPUT attribute cannot have the PRINT attribute.
  2. Keyed is required for INDEXED and REGIONAL output.

Those ENVIRONMENT options that apply to more than one data set organization are described in the topics that follow. In addition, in the following sections, each option is described with each data set organization to which it applies.