Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
which record will be read?

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

New User


Joined: 16 Jul 2008
Posts: 9
Location: bangalore

PostPosted: Thu Jul 24, 2008 12:39 pm    Post subject: which record will be read?
Reply with quote

A vsam file having 6 records reckey say 1 to 6

Open input infile
move 3 into reckey.
read infile next.
start inrec.
read inrec next.


here which record will be read?

1. no rec
2. rec3
3. unpredictale
4. rec1
Back to top
View user's profile Send private message

sedireswarapu

New User


Joined: 18 Jun 2008
Posts: 28
Location: India

PostPosted: Thu Jul 24, 2008 11:40 pm    Post subject:
Reply with quote

Hi ,

Is the question correct ?

From the question, it looks like the filename is 'infile', but 'inrec' is also used in the START/READ statements.

Only files can be read, and records are written/rewritten.

Also, only the filename is used in the START statement (used to reposition the file pointer at a record other than the next logical record).

Code:

START file-name
   KEY IS comparison key
END-START.


comparison - the type of comparison to make between the records
key field and the contents of key

EQUAL TO
GREATER THAN
NOT LESS THAN
GREATER THAN OR EQUAL TO

In the START statement, nothing is mentioned to reposition the file pointer..
Back to top
View user's profile Send private message
sedireswarapu

New User


Joined: 18 Jun 2008
Posts: 28
Location: India

PostPosted: Thu Jul 24, 2008 11:44 pm    Post subject:
Reply with quote

I guess no record will be read [choice 1].

Please correct me if am wrong...
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Fri Jul 25, 2008 12:14 am    Post subject:
Reply with quote

Also, you have 2 READ statements, one of which is incorrect as Sriram has pointed out. Which of the 2 READ statements are you asking about?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jul 25, 2008 12:46 am    Post subject:
Reply with quote

Hello Sriram,

Quote:
I guess no record will be read [choice 1].

Please read the following - i believe there is no valid choice. . .


jyothimenon1,

I believe you need to start over. . . I believe the posted code will not compile (you should verify this).

If the code will not compile, it cannot be executed, so all of the answers are incorrect. . . All of the answers assume the code will run.

As i mentioned in another of your topics, i believe you have mis-quoted some interview questions. If the questions andf answers are not posted exactly as asked in the interview, any answer given by the forum may not be the answer that was expected.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Fri Jul 25, 2008 2:36 am    Post subject:
Reply with quote

Original poster is jyothimenon1.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jul 25, 2008 2:41 am    Post subject: Reply to: which record will be read?
Reply with quote

Hi Terry,

Thanx for the correction - i've patched up the earlier reply icon_redface.gif

d
Back to top
View user's profile Send private message
sedireswarapu

New User


Joined: 18 Jun 2008
Posts: 28
Location: India

PostPosted: Fri Jul 25, 2008 10:29 am    Post subject:
Reply with quote

Dick,

I guessed that no record will be read, assuming that there will be no successful execution of the code. But as you said the posted code has to be verified for the compilation (successful/unsuccessful).
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us