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
 

 

Choose the Best: What's error in the followinf code?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
sungang77

New User


Joined: 03 Nov 2005
Posts: 46
Location: Shanghai, China

PostPosted: Tue Nov 22, 2005 11:58 am    Post subject: Choose the Best: What's error in the followinf code?
Reply with quote

Code:
MAINLINE.                                                               
SET S-NOT-END-OF-FILE TO TRUE                     
  PERFORM A0100-PROCESS-RECS                                   
    UNTIL S-END-OF-FILE       
  END-PERFORM.     
                                                                     
 A0100-PROCES-RECS.
  READ I-PLAYER-FILE                                             
    AT END   
       ADD +1           TO A-FILES-PROCESSED
    NOT AT END
       PERFORM A0200-INC-TOTALS
    END-READ.

Question:The sample code above should handle a process of reading an input file and using an amount from the file to increment totals. The calculation section is NOT shown. What error in the sample code will prevent this process from working correctly?
Choice 1
A priming read should be done before the PERFORM.
Choice 2
S-END-OF-FILE is never set to true.
Choice 3
S-NOT-END-OF-FILE should not be set before the first read.
Choice 4
A mathematical statement cannot be used with an AT END clause.
Choice 5
The PERFORM?UNTIL should be based on a counter not end-of-file switch.
Back to top
View user's profile Send private message

mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Wed Nov 23, 2005 8:01 am    Post subject:
Reply with quote

Choice 2. No eof indication to stop the loop = infinit loop.
Back to top
View user's profile Send private message
sungang77

New User


Joined: 03 Nov 2005
Posts: 46
Location: Shanghai, China

PostPosted: Wed Nov 23, 2005 8:17 am    Post subject:
Reply with quote

mmwife wrote:
Choice 2. No eof indication to stop the loop = infinit loop.


Yeah, I think you are right Jack.
Back to top
View user's profile Send private message
Santoshhn

New User


Joined: 18 May 2005
Posts: 5

PostPosted: Wed Nov 23, 2005 7:28 pm    Post subject: Re: Choose the Best: What's error in the followinf code?
Reply with quote

Program will be in Loop..
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 How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 0 Thu Jan 12, 2017 12:02 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm


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