Download with_ans PDF

Titlewith_ans
TagsSubroutine Software Development Computer Programming Software Software Engineering
File Size196.3 KB
Total Pages35
Document Text Contents
Page 34

TRUE
0270
WHEN
TRANSACTION-
IS-UPDATE
0280

PERFORM
UPDATE-MASTER

0290
WHEN
TRANSACTION-
IS-ADD
0300

PERFORM ADD-
MASTER
0310
WHEN
TRANSACTION-
IS-DELETE
0320

PERFORM
DELETE-MASTER

0330
END-
EVALUATE.
0340 DELETE-
MASTER.
0350 ...
0360 ADD-
MASTER.
0370 ...
0380 UPDATE-
MASTER.
0390 ...

This is a tape-based master-transaction
program segment. A number of
complications arise processing a transaction
file against a master file. Directing your
attention to statements #0260 through
#0330, why is this code ordered as shown?

Choice 1 UPDATES are expected to be more prevalent
than other transactions, thus better
performance.

Choice 2 This code order is of no consequence.

Choice 3 This code is designed to handle the
possibility that all three transaction types
occur in the input stream for a given master
record. Delete first; then add; then update.

Choice 4 It must be coded this way in order to avoid a
deadly embrace.

Choice 5 The code is designed to reduce memory
utilization.

IDENTIFICATION
DIVISION.
PROGRAM-ID.
AM82P001 IS
COMMON.
....
PROCEDURE
DIVISION.
...
CALL
'AM82P002'.
GOBACK.
END PROGRAM
AM82P001.
IDENTIFICATION
DIVISION.
PROGRAM-ID.
AM82P002.
...
PROCEDURE
DIVISION.
...
CALL
'AM82P003'.
EXIT
PROGRAM.
END PROGRAM
AM82P002.
IDENTIFICATION
DIVISION.
PROGRAM-ID.
AM82P003 IS
COMMON.
...
PROCEDURE
DIVISION.
...
MOVE 'X' TO
SERVICE-AND-
EQUIPMENT.
...
STOP RUN.
END PROGRAM
AM82P003.

Which one of the following states why the
COMMON clause in the sample code above is
coded incorrectly?

Choice 1 The COMMON clause can only be coded on
the PROGRAM-ID of a program to increase
the scope of programs that it can call.

Choice 2 EXIT PROGRAM nor STOP RUN may be used
in a nested program unless the COMMON
clause is coded.

Choice 3 COMMON may only be coded in a contained
program.

Choice 4 COMMON may not be coded within the same
program in which the COMMON program is
contained.

Choice 5 When COMMON is coded on a PROGRAM-ID
clause of a contained program, the
contained program may only be called by a
program in which it is directly contained.

Similer Documents