UPDATE FILELIST Example


Example:

 

MyList

FILELIST

 

Prime

IFILE

NAME="Prime.isi"

Second

IFILE

NAME="Second.isi"

  

FILELISTEND

 

KEY2

INIT

"TEST2"

.

 

 

  

OPEN

MyList

  

WRITE

MyList;"TEST1 Record data"

  

WRITE

MyList;"TEST2 Record data"

.

 

 

  

FILEPI

2;MyList

  

READ

Second,KEY2;S$CMDLIN

  

IF OVER

 

  

  

; User Over Logic.....

  

ELSE

 

  

UPDATE

MyList;"TEST3 Record news"

  

IF OVER

 

  

  

; User Update Over Logic.....

  

ENDIF

 

  

ENDIF

 

  

CLOSE

MyList

 

This example opens a FILELIST containing two index files. Two records are written to the FILELIST. Data is written to the primary file (prime) and the key is constructed and inserted into its ISAM file. The key for the secondary file (second) is also constructed and inserted into its ISAM file. The subsequent READ instruction positions the FILELIST to the second record. The UPDATE instruction rewrites the data using the TEST3 string. Both the primary and secondary ISAM keys are updated as required. Both files are then closed.

 



PL/B Language Reference UPDATE FILE Example UPDATE IFILE Example