Friday, December 16, 2011

Opening a File (ESDS, KSDS, or RRDS)



   How you code your OPEN statement for a VSAM file depends on whether the
   file is an empty file or a loaded file.

   To open a file that has never contained records (an empty file):

 |     Use OPEN OUTPUT for ESDS files.

     Use OPEN OUTPUT or OPEN EXTEND for KSDS and RRDS files.  (Either
     coding has the same effect.)  If you have coded the file for random or
     dynamic access, you can also use OPEN I-O if the file is optional.

   To open a file that already contains records (a loaded file):

       Use OPEN INPUT, OPEN I-O, or OPEN EXTEND

       °   For an ESDS or RRDS file opened EXTEND, the added records are
           placed after the last existing records in the file.

       °   For a KSDS file opened EXTEND, each record you add must have a
           record key higher than the highest record in the file.

   A file that once contained records, all of which have been deleted, can be
   opened as I-O or EXTEND.

   In every case, you should check the file status key after each OPEN statement.

Subtopics:


       1 Initially Loading a File Sequentially

       2 Initially Loading a File Randomly or Dynamically

       3 Loading a VSAM Data Set with Access Method Services
           
 Loading a VSAM Data Set with Access Method Services

   You can load or update a VSAM data set with the IDCAMS REPRO command.  See
   your Access Method Services Reference manual.  REPRO should be used
   whenever possible. 

No comments:

Post a Comment