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
 

 

Two questions about file.

 
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 8:15 am    Post subject: Two questions about file.
Reply with quote

Question: Which one of the following is a reason to use READ filename INTO working-storage-record when using control breaks?
Choice 1
At EOF, input fields are still available for processing.
Choice 2
Checking for EOF is unnecessary.
Choice 3
Total fields can be defined as part of the working-storage-record.
Choice 4
Numeric fields can be summed into total fields.
Choice 5
Numeric edited fields cannot be moved from file buffers.


Code:
PROCEDURE DIVISION.
   
MAINLINE.
 OPEN INPUT I-SALES-FILE
     OUTPUT O-REPORT-FILE

 SET S-SALES-NOT-EOF      TO TRUE
 PERFORM S0100-PROCESS
     UNTIL S-SALES-EOF
 END-PERFORM
 
 CLOSE I-SALES-FILE
     O-REPORT-FILE
 GOBACK.

S0100-PROCESS.
 READ I-SALES-FILE
    AT END
      SET S-SALES-EOF TO TRUE
 END-READ   
 MOVE SPACES              TO O-REPORT-REC
 MOVE I-SALES-NUM         TO O-REPORT-SALES-NUM
 MOVE I-SALES-NAME        TO O-REPORT-SALES-NAME
 WRITE O-REPORT-REC.

Question: The input file contains one record and then the EOF. There is an error in the processing logic above. Which one of the following lists the statements in the order in which they are executed when processing this file?
Choice 1
OPEN, SET, PERFORM S0100, READ (FIRST) , MOVE, MOVE, MOVE, WRITE, PERFORM S0100, READ (EOF), PERFORM (CONDITION IS MET), CLOSE, GOBACK
Choice 2
OPEN, SET, PERFORM S0100, READ (FIRST) , MOVE, MOVE, MOVE, WRITE, PERFORM S0100, READ (EOF), MOVE, MOVE, MOVE, WRITE, CLOSE, GOBACK
Choice 3
OPEN, SET, PERFORM S0100, READ (FIRST) , MOVE, MOVE, MOVE, WRITE, PERFORM S0100, READ (EOF), MOVE, MOVE, MOVE, WRITE, PERFORM (CONDITION IS MET), CLOSE, GOBACK
Choice 4
OPEN, SET, PERFORM S0100, READ (FIRST) , MOVE, MOVE, MOVE, WRITE, PERFORM S0100, READ (EOF), CLOSE, GOBACK
Choice 5
OPEN, SET, PERFORM S0100, READ (FIRST) , MOVE, MOVE, MOVE, WRITE, PERFORM S0100 (CONDITION IS MET), CLOSE, GOBACK
Back to top
View user's profile Send private message

khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Tue Nov 22, 2005 10:23 am    Post subject: Files
Reply with quote

hi frnd,
for the question 1 choice 3 will work.( Total fields can be defined as part of the working-storage-record. ) since the working storage section will contain the field names such that for manipulation of the records.
for question2 i m confused. let me know if any solution.
Back to top
View user's profile Send private message
sungang77

New User


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

PostPosted: Tue Nov 22, 2005 11:07 am    Post subject: Re: Files
Reply with quote

khamarutheen wrote:
hi frnd,
for the question 1 choice 3 will work.( Total fields can be defined as part of the working-storage-record. ) since the working storage section will contain the field names such that for manipulation of the records.
for question2 i m confused. let me know if any solution.


OK. I will, khamarutheen.
Thanks.
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


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