Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

File operation error

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: File operation error
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: 8593
Location: Back in jolly old England

PostPosted: Tue Aug 11, 2009 5:39 pm    Post subject:
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: 1239
Location: Richfield, MN, USA

PostPosted: Tue Aug 11, 2009 7:42 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us