Friday, December 16, 2011

Updating Records in a VSAM File

   The COBOL language statements that can be used to update a VSAM file in
   the Environment and Data Divisions are the same.

   Figure shows the statements that you can use in the Procedure Division
   to update VSAM files.

     ________________________________________________________________  
     | Figure 73. Procedure Division Statements Used to Update VSAM Files     |
   |_______________________ ________________________ _______________________|
   | ESDS                  | KSDS                   | RRDS                  |
   |_______________________|________________________|_______________________|
   | ACCESS IS SEQUENTIAL: | ACCESS IS SEQUENTIAL:  | ACCESS IS SEQUENTIAL: |
   |     OPEN EXTEND       |     OPEN EXTEND        |     OPEN EXTEND       |
   |     WRITE             |     WRITE              |     WRITE             |
   |     CLOSE             |     CLOSE              |     CLOSE             |
   |         or            |         or             |         or            |
   |     OPEN  I-O         |     OPEN  I-O          |     OPEN  I-O         |
   |     READ              |     READ               |     READ              |
   |     REWRITE           |     REWRITE            |     REWRITE           |
   |     CLOSE             |     DELETE             |     DELETE            |
   |                       |     CLOSE              |     CLOSE             |
   |_______________________|________________________|_______________________|
   | ACCESS IS RANDOM:     | ACCESS IS RANDOM:      | ACCESS IS RANDOM:     |
   |                       |     OPEN  I-O          |     OPEN  I-O         |
   |                       |     READ               |     READ              |
   |     not applicable    |     WRITE              |     WRITE             |
   |                       |     REWRITE            |     REWRITE           |
   |                       |     DELETE             |     DELETE            |
   |                       |     CLOSE              |     CLOSE             |
   |_______________________|________________________|_______________________|
   | ACCESS IS DYNAMIC     | ACCESS IS DYNAMIC      | ACCESS IS DYNAMIC     |
   | Sequential Processing:| Sequential Processing: | Sequential Processing:|
   |                       |     OPEN  I-O          |     OPEN  I-O         |
   |                       |     READ NEXT          |     READ NEXT         |
   |     not applicable    |     WRITE              |     WRITE             |
   |                       |     REWRITE            |     REWRITE           |
   |                       |     START              |     START             |
   |                       |     DELETE             |     DELETE            |
   |                       |     CLOSE              |     CLOSE             |
   |_______________________|________________________|_______________________|
   | ACCESS IS DYNAMIC     | ACCESS IS DYNAMIC      | ACCESS IS DYNAMIC     |
   | Random Processing:    | Random Processing:     | Random Processing:    |
   |                       |     OPEN  I-O          |     OPEN  I-O         |
   |                       |     READ               |     READ              |
   |     not applicable    |     WRITE              |     WRITE             |
   |                       |     REWRITE            |     REWRITE           |
   |                       |     DELETE             |     DELETE            |
   |                       |     CLOSE              |     CLOSE             |
   |_______________________|________________________|_______________________|

          

No comments:

Post a Comment