View previous topic :: View next topic
|
Author |
Message |
sakthisiga Warnings : 1 New User
Joined: 11 Jun 2009 Posts: 60 Location: Chennai
|
|
|
|
Code: |
0100 INITIAL-READ.
0110 READ MASTER-FILE
0120 AT END MOVE 'Y' TO MASTER-EOF-SW.
0130 READ TRANSACTION-FILE
0140 AT END MOVE 'Y' TO TRANSACTION-EOF-SW.
0150 PERFORM PROCESS-FILE
0160 UNTIL END-OF-MASTER OR
0170 END-OF-TRANSACTIONS.
0180 GOBACK.
0190 PROCESS-FILE.
0200 PERFORM UNTIL MASTER-KEY >= TRANSACTION-KEY
0210 WRITE MASTER-RECORD
0220 READ MASTER-RECORD AT END MOVE 'Y' TO MASTER-EOF-SW
0230 END-PERFORM.
0240 IF NOT MASTER-EOF
0250 EVALUATE TRUE
0260 WHEN TRANSACTION-IS-DELETE
0270 PERFORM DELETE-MASTER
0280 WHEN TRANSACTION-IS-ADD
0290 PERFORM ADD-MASTER
0300 WHEN TRANSACTION-IS-UPDATE
0310 PERFORM UPDATE-MASTER
0320 END-EVALUATE.
0330 DELETE-MASTER.
0340 IF MASTER-KEY <> TRANSACTION-KEY
0350 DISPLAY '??????'
0360 WRITE MASTER-RECORD.
0370 READ MASTER-FILE AT END MOVE 'Y' TO MASTER-EOF-SW.
0380 PERFORM GET-NEXT-TRANSACTION.
0390 ADD-MASTER.
...
0460 UPDATE-MASTER.
...
0540 GET-NEXT-TRANSACTION.
... |
Code'd
This is a tape-based master-transaction program segment. Assume the files are sorted into ascending sequence by key fields. Transactions may add, delete, or update master file records. Referring to statement #0350, what error, if any, has been detected?
Choice 1
There is no corresponding transaction record for the master record being processed following the initial read.
Choice 2
The master file is out of sequence.
Choice 3
A logic error has occurred.
Choice 4
The master record to be deleted does not exist.
Choice 5
The transaction file is out of sequence.
Can anyone please tell me which one is correct? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
No. The idea of interview questions is that you tell us what you think, and we help you from that point onwards. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Please use BBCode (see FAQ) for readability. For example:
Code: |
0100 INITIAL-READ.
0110 READ MASTER-FILE
0120 AT END MOVE 'Y' TO MASTER-EOF-SW. |
|
|
Back to top |
|
|
|