IFILE Examples


Example 1:

 

DIFILE

IFILE

 

DIFILE is an ISAM file with the maximum record size set to 256 bytes (default).

 

Example 2:

 

BIFILE

IFILE

BUFFER=504,NODUP,WEOF

 

BIFILE is an ISAM file with the maximum record size set to 504 bytes. Duplicate records are not allowed and all new records are written at the End of File, thus deleted record space is not reused.

 

Example 3:

 

TFILE

IFILE

VARIABLE=120,COMPRESSED

 

TFILE is an ISAM file with variable length records allowed and a maximum record length of 120 bytes. The records 'can' be space compressed and are written at the End of File.

 

Example 4:

 

IFILE1

IFILE

FIXED=332

IFILE2

IFILE

VARIABLE=332,COMPRESSED

  

...

 

  

CALL

SUB USING IFILE1

  

CALL

SUB USING IFILE2

  

...

 

PTRFILE

IFILE

^

SUB

LROUTINE

PTRFILE

  

...

 

  

READ

PTRFILE,...

  

...

 

  

RETURN

 

 

PTRFILE is a Pointer Variable that contains the address of another IFILE variable at execution time. This assignment is usually accomplished via the parameterized CALL instruction. Once initialized, PTRFILE may be used as any other IFILE variable. It takes on all the attributes of the pointed to IFILE variable.

Example 5:

 

MasterView

INIT

"mydatabase.master"

.

 

 

IFile1

IFILE

VIEW="somedatabase.userview"

or

 

 

IFile1

IFILE

VIEW=MasterView

 

This instruction defines a global ISAM file that is associated with a database and a view.

 



PL/B Language Reference IF/ENDIF Examples IFX Example