READ FILE Examples


Example 1:

 

  

READ

DATAFILE,SEQ;VAR1,VAR2,*UC,NAME,*LC

 

Logical file:

DATAFILE

Method:

Sequential (SEQ is a previously defined -1 or -2 numeric variable)

Variables:

VAR1, VAR2 and NAME

List controls:

*UC enabled for NAME only (*LC disables it after NAME)

Partial read:

No semi-colon specified (full record READ)

 

Example 2:

 

  

READ

MYFILE,RECORD;FIELD1,FIELD2;

 

Logical file:

MYFILE

Method:

Random (RECORD is previously defined 0 or greater numeric variable)

Variables:

FIELD1 and FIELD2

List controls:

None

Partial read:

Semi-colon specified for partial READ

 

 



PL/B Language Reference READ AFILE Examples READ IFILE Examples