Download SELCOPY Manual
Transcript
VSAM Files VSAM Managed SAM Files Otherwise, if the OPEN is successful, the file will be read as RECFM=U, (Undefined length records), which of course is Unblocked and almost certainly not what is required. VSAM Operations READ (Synonyms RD IN INPUT) Will read any VSAM file, (KSDS, ESDS or RRDS), sequentially, forwards (the default), or Backwards, BWD. The direction of reading a KSDS sequentially may be reversed. Direct reads may be made for any: • KSDS, by key. • ESDS, by RBA. • RRDS, by Record Number. WRITE (Synonyms WR PUT OUT OUTPUT) Will write new records to any VSAM file, which for an empty file is effectively the same as creating it. Note that VSAM will only write records to the end of an ESDS file. WRITE will also write new records, overwriting all previous records, to any VSAM file. (The REUSE parameter). New KSDS records may be written (i.e. inserted) into an existing KSDS using the WRITE statement, provided the records are written in key sequence. WRITE does not use Update mode as it is effectively loading the file which gives it significant speed advantages. Use WRITE instead of INS Never use INS when WRITE will do the same job, particularly on high volume or frequent jobs. INS is only required if update mode is essential in order to issue DEL and REP statements, or if it is not possible to sort the inserts into key sequence before the update. Sorting and writing to VSAM is significantly more efficient than inserting. UPDATE (Synonyms UPD REP REPLACE REWRITE) Will update records on any VSAM file. INSERT (Synonym INS) Will insert records, for KSDS and RRDS only, regardless of sequence. DELETE (Synonym DEL) Will delete records, for KSDS and RRDS only. VSAM Parameters See also: • POS RETVSAM in section Operation Words, Parameters and Keywords. • Suppress KEY/REC NOT FOUND data in section CBLNAME & SELCNAM. • VSAM Output LRECL in this section. VSAM parameters are described briefly here. Please refer to the alphabetic Parameter section which may give a fuller description. KSDS, ESDS, RRDS or VSAM Parameter For VSE, one of the parameters KSDS, ESDS, RRDS or VSAM must be mentioned on the first use of a VSAM file, otherwise ERROR 118 will be issued on any subsequent use of the file which does mention KSDS, ESDS, RRDS or VSAM. 2015-03-03 11:16:07 SELCOPY Manual 249