Indexed File Assignment - CIS51

1.

SELECT VSAM-VENDOR-FILE
    ASSIGN TO "C:\PCOBWIN\SOURCEPG\VENDOR.DAT"
    ORGANIZATION IS INDEXED
    ACCESS IS SEQUENTIAL
    RECORD KEY IS VENDOR-ID
    ALTERNATE RECORD KEY IS VENDOR-NAME WITH
    DUPLICATES.

This SELECT statement could be used to WRITE the file sequentially, READ the file sequentially using the record key, or READ the file sequentially using the alternate key. TRUE or FALSE. If false, explain or correct.

2.

SELECT VSAM-VENDOR-FILE
    ASSIGN TO "C:\PCOBWIN\SOURCEPG\VENDOR.DAT"
    ORGANIZATION IS INDEXED
    ACCESS IS RANDOM
    RECORD KEY IS VENDOR-ID
    ALTERNATE RECORD KEY IS VENDOR-NAME WITH
    DUPLICATES.

This SELECT statement could be used to READ the file randomly using the record key or READ the file randomly using the alternate record key. TRUE or FALSE. If false, explain or correct.

3.

SELECT VSAM-VENDOR-FILE
    ASSIGN TO "C:\PCOBWIN\SOURCEPG\VENDOR.DAT"
    ORGANIZATION IS INDEXED
    ACCESS IS DYNAMIC
    RECORD KEY IS VENDOR-ID
    ALTERNATE RECORD KEY IS VENDOR-NAME WITH
    DUPLICATES.

This SELECT statement could be used to READ the file randomly using either the record key or the alternate record key, READ the file sequentially using either the record key or the alternate record key. TRUE or FALSE. If false, explain or correct.

4.

WRITE VSAM-VENDOR-RECORD
    INVALID KEY
         PERFORM B-300-PRINT-INVALID-MSG
    NOT INVALID KEY
         PERFORM B-310-PRINT-VALID-TRAIL
END-WRITE.

Using the SELECT statement in #1. This WRITE statement could be used to create the VSAM-VENDOR-FILE. TRUE or FALSE. If false, explain or correct.

5.

MOVE TRANSACTION-ID TO VENDOR-ID.
READ VSAM-VENDOR-FILE
    AT END
         MOVE "YES" TO EOF-VSAM.

Use the SELECT statement in #1. This code will start the sequential reading of the VSAM-VENDOR-FILE with the record that matches TRANSACTION-ID.

TRUE or FALSE. If false, explain or correct.

6.

MOVE TRANSACTION-ID TO VENDOR-ID.
READ VSAM-VENDOR-FILE
    INVALID KEY
         PERFORM B-310-PROCESS-FOUND-RECORD
    NOT INVALID KEY
         PERFORM B-300-ERROR-PRINT
END-READ.

Using the SELECT statement in #2. This code could be used to randomly read and process the record on the VSAM-VENDOR-FILE with the same VENDOR-ID found in TRANSACTION-ID. TRUE or FALSE. If false, explain or correct.

7.

MOVE LOW-VALUES TO VENDOR-NAME.
START VSAM-VENDOR-FILE
    KEY = VENDOR-NAME
    INVALID KEY
        PERFORM B-300-INVALID-ROUTINE
    NOT INVALID KEY
        PERFORM U-000-READ-VENDOR.

Use the SELECT statement from #1. This code will establish the alternate key path and read the records starting at the first record in the file along the alternate key path. TRUE or FALSE. If false, explain or correct.

8.

MOVE TRANSACTION-ID TO VENDOR-ID.
START VSAM-VENDOR-FILE
    KEY = VENDOR-ID
    INVALID KEY
         PERFORM B-200-ERROR-ROUTINE
    NOT INVALID KEY
         READ VSAM-VENDOR-ID
              AT END
                   MOVE "YES" TO EOF-VSAM
         END-READ

END-START.

Use the SELECT statement in #1. This code will start the sequential reading of the VSAM-VENDOR-FILE with the record that matches TRANSACTION-ID. TRUE or FALSE. If false, explain or correct.

9.

MOVE TRANSACTION-NAME TO VENDOR-NAME.
MOVE "YES" TO FOUND-RECORD.
READ MASTER-FILE
    INVALID KEY
         MOVE "NO" TO FOUND-RECORD.
IF FOUND-RECORD = "YES"
    PERFORM B-300-PROCESS-FOUND-NAME
ELSE
    PERFORM B-310-NAME-NOT-FOUND.

Use the SELECT in #2. This code will randomly read the file (using the alternate key) to find the record that matches the name that is in TRANSACTION-NAME. TRUE or FALSE. If false, explain or correct.

10.

MOVE TRANSACTION-ID TO VENDOR-ID.
MOVE "YES" TO FOUND-RECORD.
READ VSAM-VENDOR-FILE
    INVALID KEY
         PERFORM B-310-HANDLE-ERROR
         MOVE "NO " TO FOUND-RECORD.
IF FOUND-RECORD = "YES"
    PERFORM B-300-PROCESS.

Use the SELECT in #3. This code will randomly read a record from the file with a VENDOR-ID that matches the data in TRANSACTION-ID. TRUE or FALSE. If false, explain or correct.

11.

MOVE LOW-VALUES TO VENDOR-NAME.
START VSAM-VENDOR-FILE
    KEY GREATER THAN VENDOR-NAME
    INVALID KEY
         PERFORM B-300-INVALID-ROUTINE
    NOT INVALID KEY
         PERFORM U-000-READ-VENDOR.

Use the SELECT statement from #1. The code above will establish the alternate key path and read the records starting at the first record in the file along the alternate key path. TRUE or FALSE. If false, explain or correct.

12.

READ VSAM-VENDOR-FILE NEXT
    AT END
         MOVE "YES" TO EOF-VENDOR.

Use the SELECT in #3. This code will read the next sequentially record in the file. TRUE or FALSE. If false, explain or correct.

13.

MOVE TRANSACTION-NAME TO VENDOR-NAME.
READ MASTER-FILE
    KEY IS VENDOR-NAME
    INVALID KEY
         PERFORM B-310-NAME-NOT-FOUND
    NOT INVALID KEY
         PERFORM B-300-PROCESS-FOUND-NAME
END READ.

Use the SELECT in #2. This code will randomly read the file (using the alternate key) to find the record that matches the name that is in TRANSACTION-NAME. TRUE or FALSE. If false, explain or correct.

14.

MOVE TRANSACTION-NAME TO VENDOR-NAME.
START VSAM-VENDOR-FILE
    KEY = VENDOR-NAME
    INVALID KEY
         PERFORM B-300-INVALID-ROUTINE
    NOT INVALID KEY
         PERFORM U-000-READ-VENDOR.

Use the SELECT statement from #1. This code will establish the alternate key path and read the records along the alternate key path starting with the record that contains the VENDOR-NAME that matches the name in TRANSACTION-NAME. TRUE or FALSE. If false, explain or correct.

15.

MOVE TRANSACTION-ID TO VENDOR-ID.
READ VSAM-VENDOR-FILE
    INVALID KEY
        PERFORM B-310-PROCESS-FOUND-RECORD
    NOT INVALID KEY
        PERFORM B-300-ERROR-PRINT
END-READ.

Using the SELECT statement in #2. This code could be used to randomly read and process the record on the VSAM-VENDOR-FILE with the same VENDOR-ID found in TRANSACTION-ID. TRUE or FALSE. If false, explain or correct.

16.

READ VSAM-VENDOR-FILE
    AT END
         MOVE "YES" TO EOF-VSAM.

Using the SELECT statement from #1. This read statement could be used to start reading the file sequentially beginning with the first record. TRUE or FALSE. If false, explain or correct.

17.

READ VSAM-VENDOR-FILE NEXT
    AT END
         MOVE "YES" TO EOF-VENDOR.

Use the SELECT in #2. This code will read the next sequentially record in the file. TRUE or FALSE. If false, explain or correct.

18.

OPEN INPUT VSAM-VENDOR-FILE
    TRANSACTION-FILE...
...
...
MOVE TRANSACTION-ID TO VENDOR-ID.
READ VSAM-VENDOR-FILE
    INVALID KEY
         PERFORM B-300-RECORD-NOT-THERE
    NOT INVALID KEY
         PERFORM B-310-PROCESS-RECORD
         REWRITE VSAM-VENDOR-RECORD
              INVALID KEY
                   PERFORM B-320-REWRITE-PROBLEM
              NOT INVALID KEY
                   PERFORM B-330-REWRITE-ERROR
         END-REWRITE
END-READ

Use the SELECT statement in #2 or #3. This code will open the file (assume the ... means in the appropriate routine) and then at a later point in the program, after the transaction has been read, the code will establish the key and randomly READ the record and process errors or REWRITE the retrieved record after processing is complete TRUE or FALSE. If false, explain or correct.

19.

MOVE TRAANSACTION-ID TO VENDOR-ID.
DELETE VSAM-VENDOR-RECORD
    INVALID KEY
         PERFORM B-300-PRINT-INVALID-MSG
    NOT INVALID KEY
         PERFORM B-310-PRINT-DELETE-TRAIL.

Use the SELECT statement in #2 or #3. This code will delete a record from the file if the key exists and produce a paper trail. The DELETE does not have to be preceded by a READ. TRUE or FALSE. If false, explain or correct.

20.

MOVE TRANSACTION-ID TO VENDOR-ID.
WRITE VSAM-VENDOR-RECORD
    INVALID KEY
         PERFORM B-300-WRITE-NOT-EXECUTED.

Use the SELECT statement in #2 or #3. This statement would WRITE a new record on the indexed VSAM file TRUE or FALSE. If false, explain or correct.