FILELIST


 

A FILELIST is a group of IFILE and/or AFILE variable declarations that can be processed with a single OPEN, CLOSE, WRITE, UPDATE, or DELETE operation. The instruction uses the following format:

 

 

label

FILELIST

{^}|{%}|{*}|{*%}

 

 

FILELISTEND

 

 

Where:

label

Required. A Data Definition Label.

^

Optional. Denotes the item as being a POINTER.

%

Optional. Denotes the item as being GLOBAL.

*

Optional. Denotes the item as being COMMON.

*%

Optional. Denotes the item as being both COMMON and GLOBAL.

Flags Affected: NONE

Note the following:

  1. The FILELIST and FILELISTEND constructs define the beginning and ending points of a group of IFILE and/or AFILE variables.

  2. The first IFILE or AFILE declaration in the FILELIST is the primary file. Any subsequent IFILE or AFILE declarations are secondary files.

  3. The FILELIST may not be empty.

  4. A FILELIST is limited to thirty (30) files.

  5. The label specified for the FILELIST is required and references the file group in an OPEN, CLOSE, WRITE, UPDATE, or DELETE instruction. When a FILELIST is used in an OPEN instruction, all of FILELIST files must have a NAME parameter declared.

  6. The following are instructions may be used with a FILELIST: OPEN, CLOSE, DELETE, WRITE, and UPDATE.

  7. Each FILELIST defined without the ^ qualifier must have a terminating FILELISTEND statement that indicates the end of the FILELIST group. If the ^ is specified, the FILELIST is a pointer and the FILELISTEND statement is not allowed.

  8. A FILELISTEND statement without a prior FILELIST statement declaration is not allowed.

  9. If the FILELIST is defined as Global, all included file variables must also be defined as Global variables.

  10. If a FILELIST is declared as Common, all included file variables must also be declared as Common.

  11. Nesting of FILELIST/FILELISTEND constructs is not allowed.

  12. All of the files in a FILELIST must be managed files or they must all be not managed. Mixing managed and non-managed files causes a runtime execution error.

  13. When a FILELIST operation is executed, the file group is validated to ensure the following:

  14. When using a PREPARE or OPEN for any file specified in a FILELIST, a valid key specification must be available for the file. Note that the IFILE PREPARE operation was modified to allow valid key specifications.

  15. If an IFILE PREPARE instruction is performed for an IFILE in a FILELIST, the key specifications must be supplied. If no key specifications are provided, an I23 error is given.

  16. It is not valid to DELETE, INSERT, UPDATE, or WRITE using individual AFILE or IFILE declared in a FILELIST. All operations that modify a file declared in a FILELIST must use the FILELIST name.

  17. FILELIST does not work with RMS files.

  18. The first file defined in a FILELIST should not be created with the primary key option.

  19. IFILEs using the primary key option must use the standard primary key (P{nn}{=|#}{c}) format. If an ISI is generated using the alternate primary key specification (P{type}"{col}{func}{'string'}") option, the ISI file cannot be included in a FILELIST declaration. Otherwise, an I23 subcode 40 error is given for any FILELIST WRITE or UPDATE operation executed. Note also that:

  20. Generate/bullet1.gif    The alternate primary data is not available in an ISI header. Prior to 8.5C, the ISAM keys for this form of an ISI file could be invalid after a FILELIST WRITE/UPDATE operation.

    Generate/bullet1.gif    Use of the primary key specification (P{nn}{=|#}{c}) for generation of an ISI file has always worked for an IFILE included in a FILELIST declaration before and after changes made for 8.5C.

 

 

See Also: Example Code, File Definitions, Disk I/O Instructions

 



PL/B Language Reference FILE IFILE