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 Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm


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