WRITE IFILE Examples


Example 1:

 

  

WRITE

DATAFILE,KEY1;VAR1,VAR2,*ZF,BALANCE

 

Logical file:

DATAFILE

Method:

Index (KEY1 is a previously defined character string variable)

Variables:

VAR1, VAR2 and BALANCE

List controls:

*ZF zero-fills the numeric variable BALANCE

Partial write:

No semi-colon specified (writes End Of Record (EOR) mark)

Example 2:

 

  

WRITE

MYFILE,KEY2;*LL,FIELD1,*PL,FIELD2;

 

Logical file:

MYFILE

Method:

Index (KEY2 is a previously defined character string variable)

Variables:

FIELD1 and FIELD2

List controls:

*LL enabled for FIELD1 only (*PL disables it after FIELD1)

Partial write:

Semi-colon specifies partial WRITE (no EOR)

Example 3:

 

  

WRITE

MYFILE;FIELD1,FIELD2

 

Logical file:

MYFILE

Method:

Index (the key is constructed using the contents of FIELD1 and FIELD2)

Variables:

FIELD1 and FIELD2

List controls:

none

Partial write:

none

 

 



PL/B Language Reference WRITE FILELIST Example XOR Examples