IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

File operation error


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sakthisiga
Warnings : 1

New User


Joined: 11 Jun 2009
Posts: 60
Location: Chennai

PostPosted: Tue Aug 11, 2009 5:29 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Aug 11, 2009 5:39 pm
Reply with quote

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
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue Aug 11, 2009 7:42 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Error to read log with rexx CLIST & REXX 11
Search our Forums:

Back to Top