DELETE 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

 

  

DELETE

MyList

  

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 DELETE instruction removes the keys from both index files and deletes the data in the text file. Both files are then closed.

 



PL/B Language Reference DELETE (FILE) Example DELETE (IFILE) Examples