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

Two questions about file.


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
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
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: 677
Location: NJ

PostPosted: Tue Nov 22, 2005 10:23 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top