270 likes | 507 Views
FILE ORGANIZATIONS. SEQUENTIAL – PHYSICAL – VSAM (ESDS) – INDEXED – ISAM – VSAM (KSDS) RELATIVE – VSAM (RRDS) -. FILE ACCESS MODES. SEQUENTIAL RANDOM DYNAMIC. FILE DESCRIPTION. FD filename [ RECORDING MODE IS {F|V|S|U}] [ BLOCK CONTAINS [integer-1 TO]
E N D
FILE ORGANIZATIONS SEQUENTIAL – PHYSICAL – VSAM (ESDS) – INDEXED – ISAM – VSAM (KSDS) RELATIVE – VSAM (RRDS) -
FILE ACCESS MODES SEQUENTIAL RANDOM DYNAMIC
FILE DESCRIPTION FD filename [RECORDING MODE IS {F|V|S|U}] [BLOCK CONTAINS [integer-1 TO] integer-2 {CHARACTERS|RECORDS}] [RECORD CONTAINS [integer-3 TO] integer-4 CHARACTERS] LABEL {RECORDS IS| RECORDS ARE} {STANDARD|OMITTED}
PHYSICAL SEQUENTIAL SELECT [OPTIONAL] filename ASSIGN TO [-S] assignment-name [ORGANIZATION IS SEQUENTIAL] [ACCESS MODE IS SEQUENTIAL] [PASSWORD IS data-name1] [FILE STATUS IS data-name2]
VSAM ESDS SELECT [OPTIONAL] filename ASSIGN TO AS-assignment-name [ORGANIZATION IS SEQUENTIAL] [ACCESS MODE IS SEQUENTIAL] [PASSWORD IS data-name1] [FILE STATUS IS data-name2]
ISAM SELECT filename ASSIGN TO I-assignment [ACCESS MODE IS {SEQUENTIAL|RANDOM|DYNAMIC}] RECORD KEY IS data-name1 NOMINAL KEY IS data-name2
VSAM KSDS SELECT filename ASSIGN TO assignment-name ORGANIZATION IS INDEXED [ACCESS MODE IS {SEQUENTIAL|RANDOM|DYNAMIC}] RECORD KEY IS data-name1 [PASSWORD IS data-name2] [ALTERNATE KEY IS data-name3 [PASSWORD IS data-name4] [WITH DUPLICATES]] [FILE STATUS IS data-name5]
VSAM RRDS SELECT filename ASSIGN TO assignment-name ORGANIZATION IS RELATIVE [ACCESS MODE IS {SEQUENTIAL[RELATIVE KEY IS data-name1]|{RANDOM|DYNAMIC} RELATIVE KEY IS data-name2}] [PASSWORD IS data-name3] [FILE STATUS IS data-name4]
FILE STATUS CODES VSAM byte1 byte2 0 successful 0 no further info 2 dup/key-dup spec 1 at end 0 no further info 2 invalid key 0 no further info 1 sequence error 2 duplicate key 3 no record found 4 boundary violation 3 permanent error 0 no further info 4 boundary violation 9 other 0 no further info 1 password failure 2 logic 3 resource n/a 4 no current record pointer
OPEN statement Format 1 Sequential files OPEN {INPUT filename1 [REVERSED | with NO REWIND] [filename2 [REVERSED | with NO REWIND]… OUTPUT filename3 [with NO REWIND] [filename4 [with NO REWIND]]… I-O filename5 [filename6]… EXTEND filename7 [filename8]…}
OPEN statement cont. Format 2 VSAM Indexed files OPEN {INPUT filename1 [filename2]… OUTPUT filename3 [filename4]… I-O filename5 [filename6]… EXTEND filename7 [filename8]…}
OPEN statement cont. Format 3 VSAM Relative files OPEN {INPUT filename1 [filename2]… OUTPUT filename3 [filename4]… I-O filename5 [filename6]…}
WRITE statement Format 1 Physical Sequential files WRITE record-name [FROM identifier1] [{BEFORE | AFTER} ADVANCING { {identifier2 | integer} [LINE | LINES] | { mnemonic-name | PAGE} } ] [ AT {END-OF-PAGE | EOP} imp.-stmt.]
WRITE statement cont. Format 2 VSAM Sequential files WRITE record-name [ FROM identifier]
WRITE statement cont. Format 3 VSAM Indexed and Relative WRITE record-name [FROM identifier] [INVALID KEY imp.-stmt.]
READ statement Format 1 Sequential Retrieval READ filename [NEXT] RECORD [INTO identifier] [AT END imp.-stmt.]
READ statement cont. Format 2 Random Retrieval READ filename RECORD [INTO identifier] [KEY IS data-name] [INVALID KEY imp.-stmt.]
START statement START filename [KEY IS {EQUAL TO | = | GREATER THAN | > | NOTLESS THAN | NOT < } dataname] [INVALID KEY imp.stmt.]
START statement cont. To reset current record pointer to first of file MOVE LOW-VALUES TO PRIME-REC-KEY START filename KEY IS NOT LESS THAN PRIME-REC-KEY
REWRITE statement REWRITE record-name [FROM identifier] [INVALID KEY imp.stmt.]
DELETE statement DELETE filename RECORD [INVALID KEY imp.-stmt.]
CLOSE statement Format 1 - Physical Sequential CLOSE filename1 [{reel | unit} [WITH NOREWIND | FOR REMOVAL] | WITH {NOREWIND | LOCK}] [ filename2 [{reel | unit} [WITH NOREWIND | FOR REMOVAL] | WITH {NOREWIND | LOCK}]]…
CLOSE statement cont. Format 2 - VSAM Files CLOSE filename1 [WITH LOCK] [filename2 [WITH LOCK]]…
DEFINE SPACE DEFINESPACE – (FILE (ddname) – VOLUMES (vol-ser) – {RECORDS | TRACKS | CYLINDERS} (primary secondary) – RECORDSIZE (average maximum))
DEFINE CLUSTER DEFINECLUSTER - (NAME (cluster-name) - VOLUMES (vol-ser) - {RECORDS | TRACKS | CYLINDERS} (primary secondary) - RECORDSIZE (average maximum) - INDEXED - KEYS (length offset) - UNIQUE -
DEFINE CLUSTER cont. FILE (ddname) - MODEL (cluster-name)) - DATA - NAME ( entry-name) - INDEX - NAME (entry-name)