The FOR statement is used for reading and updating files. The FOR construct begins with a FOR and ends with an ENDFOR.
Note: To access VSAM files from CA Ideal, your site must have the CA Ideal VSAM support option installed.
To process data from a VSAM file, you must first define the data in a CA Ideal dataview and catalog it. The dataview defines the field names that you can use in the CA Ideal application. CA Ideal supports dataviews for all three types of VSAM files:
The record length in a VSAM file can vary in two ways:
ESDS files are not required to have a fixed‑length segment. KSDS files require a fixed‑length segment, since the keys must always be in the same position in the record. For RRDS files, variable‑occurrence records are not supported. Variable‑segment records are accommodated to allow the use of multiple record types; however, the actual records written are padded with binary zeros, as required, to create fixed‑length records.
The FOR EACH and FOR FIRST constructs retrieve and update one record at a time. These constructs are iterative; with each iteration, they return the next requested record. It is not necessary to create an image of the record in working data. CA Ideal maintains a data structure that contains the record retrieved by each iteration of the FOR. PDL statements can use the fields in this structure. If a record is updated in the scope of the FOR (and updating is allowed), the data set is automatically updated at the ENDFOR for the current iteration.
To insert a new record into the file, use the FOR NEW statement. The FOR NEW statement adds a single record that is not iterative. To repeat processing of a FOR NEW statement, place the statement in a looping structure, such as a LOOP construct.
These FOR statements are described in the next sections. For information on creating, cataloging, and displaying VSAM dataviews, see the Creating Dataviews Guide.
|
Copyright © 2015 CA Technologies.
All rights reserved.
|
|