Previous Page | | | Next Page |
Accessing VSAM Data Sets |
We have a variable length VSAM file which is to be copied to a sequential dataset.If we do this using IDCAMS utility, what will be the record length of the flat file? Will there be any loss of data if the VSAM is a variable length file when it is copied to flat file? If so, can anyone suggest a.
You can use the following options for VSAM files in the FILEstatement and in the INFILE statement. (Unless otherwise indicated, the optioncan be used in both.)
causes SAS to read the VSAM data set backwards(INFILE only).
indicates how many data buffers to use forthe VSAM data set.
indicates how many index buffers to usefor the VSAM data set.
indicates that you want to read physicalVSAM control interval records rather than logical records. This option istypically used for diagnostic purposes (INFILE only).
defines a numeric SAS variable that youmust set to 1 when you want to erase a VSAM record (INFILE only).
defines a numeric variable that SAS setsto the VSAM logical error code. This option is similar to the _FDBK_ automaticvariable. When SAS sets the FEEDBACK variable, you must reset it to 0 in orderto continue.
causes SAS to use the KEY= variable as theleading portion of a record's key. VSAM retrieves the first record whose keymatches the generic key (INFILE only).
indicates that direct keyed access is beingused to read records either from a KSDS or from an ESDS via an alternate index.Also, the variable contains the key value to be used in the retrieval of arecord (input) or the writing of a record (output) (INFILE ONLY).
is used in conjunction with the KEY= option.KEYGE indicates that when KEY= is used in a retrieval request, SAS retrievesany record whose key is equal to or greater than the specified key. Thisoption is useful when the exact key is not known (INFILE only).
specifies a numeric SAS variable that, whenused with GENKEY, specifies the length of the key that is to be compared tothe keys in the file.
indicates the numeric variable that SASsets to the position of the VSAM key field. This option enables you to readkeys without knowing the key position in advance. This variable is set tothe column number (starting from 1).
specifies not to use record-level sharing (RLS) to openan RLS-eligible data set (INFILE only).
gives the appropriate password for a VSAMdata set that has password protection.
specifies a numeric variable that you setto the relative byte address (RBA) of the data record that you want to read.The RBA= option indicates that addressed direct access is being used; it isappropriate for KSDS and ESDS. If you specify the CONTROLINTERVAL option,you can use the RBA= option to access control records in an RRDS (INFILE only).
stops the DATA step from executing if areturn code greater than 4 is returned by the operating environment when theVSAM data set is opened.
defines a numeric variable that SAS setsto the number of logical records in a VSAM data set that has been opened forinput.
specifies the organization of records ina new VSAM data set. Use this option only if SMS is active. The followingis a list of valid values:
KS | specifies a VSAM key-sequenced dataset. |
ES | specifies a VSAM entry-sequenceddata set. |
RR | specifies a VSAM relative-recorddata set. |
LS | specifies a VSAM linear-space dataset. |
indicates that the VSAM file is reset toempty (no records) when it is opened. This option applies only to loadinga VSAM data set that has been marked REUSE. You cannot use this option ifthe data set contains an alternate index.
defines a numeric variable that you setto the relative record number (RRN) of the record that you want to read orwrite. This option indicates that keyed direct access is being used; it isappropriate for RRDS only.
specifies sequential VSAM record retrievalwhen either the RBA= (for an ESDS) or the RRN= option (for an RRDS) is specified(INFILE only).
indicates skip-sequential processing ofVSAM files. Skip-sequential processing finds the first record whose valueis the same as the value that is specified by the KEY= option;records are read sequentially from then on (INFILE only).
defines a numeric SAS variable that indicatesthat not every record that it reads is to be updated. Use this option whenyou are updating records in a VSAM data set (INFILE only). When an INFILEand a FILE statement reference the same VSAM data set, records are retrievedfor update by default.
In most cases when you retrieve a record for update,no user, including you, can access that particular record or any other recordsin the same control interval until you free the record by executing a PUTor an INPUT statement for the data set. The UPDATE= option avoids user lockoutwhen only a few of many records read need to be updated. When you set theUPDATE= variable to a value of 1 before the INPUT statement, the record isretrieved for update. This value is the default if UPDATE= is not specified.If you set UPDATE=0 before the INPUT statement, the record is not retrievedfor update.
Previous Page | | | Next Page | | | Top of Page |
Previous Page | | | Next Page |
Accessing VSAM Data Sets |
You can use the following options for VSAM files in the FILEstatement and in the INFILE statement. (Unless otherwise indicated, the optioncan be used in both.)
causes SAS to read the VSAM data set backwards(INFILE only).
indicates how many data buffers to use forthe VSAM data set.
indicates how many index buffers to usefor the VSAM data set.
indicates that you want to read physicalVSAM control interval records rather than logical records. This option istypically used for diagnostic purposes (INFILE only).
defines a numeric SAS variable that youmust set to 1 when you want to erase a VSAM record (INFILE only).
defines a numeric variable that SAS setsto the VSAM logical error code. This option is similar to the _FDBK_ automaticvariable. When SAS sets the FEEDBACK variable, you must reset it to 0 in orderto continue.
causes SAS to use the KEY= variable as theleading portion of a record's key. VSAM retrieves the first record whose keymatches the generic key (INFILE only).
indicates that direct keyed access is beingused to read records either from a KSDS or from an ESDS via an alternate index.Also, the variable contains the key value to be used in the retrieval of arecord (input) or the writing of a record (output) (INFILE ONLY).
is used in conjunction with the KEY= option.KEYGE indicates that when KEY= is used in a retrieval request, SAS retrievesany record whose key is equal to or greater than the specified key. Thisoption is useful when the exact key is not known (INFILE only).
specifies a numeric SAS variable that, whenused with GENKEY, specifies the length of the key that is to be compared tothe keys in the file.
indicates the numeric variable that SASsets to the position of the VSAM key field. This option enables you to readkeys without knowing the key position in advance. This variable is set tothe column number (starting from 1).
specifies not to use record-level sharing (RLS) to openan RLS-eligible data set (INFILE only).
gives the appropriate password for a VSAMdata set that has password protection.
specifies a numeric variable that you setto the relative byte address (RBA) of the data record that you want to read.The RBA= option indicates that addressed direct access is being used; it isappropriate for KSDS and ESDS. If you specify the CONTROLINTERVAL option,you can use the RBA= option to access control records in an RRDS (INFILE only).
stops the DATA step from executing if areturn code greater than 4 is returned by the operating environment when theVSAM data set is opened.
defines a numeric variable that SAS setsto the number of logical records in a VSAM data set that has been opened forinput.
specifies the organization of records ina new VSAM data set. Use this option only if SMS is active. The followingis a list of valid values:
KS | specifies a VSAM key-sequenced dataset. |
ES | specifies a VSAM entry-sequenceddata set. |
RR | specifies a VSAM relative-recorddata set. |
LS | specifies a VSAM linear-space dataset. |
indicates that the VSAM file is reset toempty (no records) when it is opened. This option applies only to loadinga VSAM data set that has been marked REUSE. You cannot use this option ifthe data set contains an alternate index.
defines a numeric variable that you setto the relative record number (RRN) of the record that you want to read orwrite. This option indicates that keyed direct access is being used; it isappropriate for RRDS only.
specifies sequential VSAM record retrievalwhen either the RBA= (for an ESDS) or the RRN= option (for an RRDS) is specified(INFILE only).
indicates skip-sequential processing ofVSAM files. Skip-sequential processing finds the first record whose valueis the same as the value that is specified by the KEY= option;records are read sequentially from then on (INFILE only).
defines a numeric SAS variable that indicatesthat not every record that it reads is to be updated. Use this option whenyou are updating records in a VSAM data set (INFILE only). When an INFILEand a FILE statement reference the same VSAM data set, records are retrievedfor update by default.
In most cases when you retrieve a record for update,no user, including you, can access that particular record or any other recordsin the same control interval until you free the record by executing a PUTor an INPUT statement for the data set. The UPDATE= option avoids user lockoutwhen only a few of many records read need to be updated. When you set theUPDATE= variable to a value of 1 before the INPUT statement, the record isretrieved for update. This value is the default if UPDATE= is not specified.If you set UPDATE=0 before the INPUT statement, the record is not retrievedfor update.
Previous Page | | | Next Page | | | Top of Page |