Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Tricky Question in NATURAL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> NATURAL & MQSERIES
Author Message
atulrukmangad

New User


Joined: 10 Apr 2006
Posts: 13

PostPosted: Tue May 02, 2006 10:09 am    Post subject: Tricky Question in NATURAL
Reply with quote

This was asked in an interview.

What will be the result of the following and why ?

READ (10) EMPLOY-VIEW WITH EMPLOY-ID = '3'
ACCEPT IF EMPLOY-ID = '3'
REJECT IF EMPLOY-ID ='3'
WRITE EMPLOY-ID
END-READ

Assume that EMPLOY-ID =3 exists in the EMPLOYEE table.
Back to top
View user's profile Send private message
References
PostPosted: Tue May 02, 2006 10:09 am    Post subject: Re: Tricky Question in NATURAL Reply with quote

skodidine

New User


Joined: 05 Apr 2006
Posts: 6

PostPosted: Tue May 02, 2006 9:53 pm    Post subject: Re: Tricky Question in NATURAL
Reply with quote

if records exist with EMPLOY-ID = '3' within the first 10 READS, then they will be written because:

"If an ACCEPT condition is satisfied, the record will be accepted and consecutive ACCEPT/REJECT statements will be ignored."

Sanjay
Back to top
View user's profile Send private message
rahul_mf
Warnings : 1

New User


Joined: 13 Sep 2005
Posts: 13

PostPosted: Wed May 03, 2006 1:25 pm    Post subject: Re: Tricky Question in NATURAL
Reply with quote

Sanjay , you are absolutely right.

But I dont know why you have written:-
"if records exist with EMPLOY-ID = '3' within the first 10 READS"

Because the statement :-
READ (10) EMPLOY-VIEW WITH EMPLOY-ID = '3'

Means that it will read those first 10 records which satisfy the condition
EMPLOY-ID = '3' .
Back to top
View user's profile Send private message
skodidine

New User


Joined: 05 Apr 2006
Posts: 6

PostPosted: Wed May 03, 2006 8:57 pm    Post subject: Re: Tricky Question in NATURAL
Reply with quote

ooops!! Sorry, didnt read the statement correctly, yes it will pick up the first 10 records that have EMPLOY-ID = '3'. My mistake.

Sanjay
Back to top
View user's profile Send private message
rahul_mf
Warnings : 1

New User


Joined: 13 Sep 2005
Posts: 13

PostPosted: Thu May 04, 2006 8:00 am    Post subject: Re: Tricky Question in NATURAL
Reply with quote

No probs icon_wink.gif
Back to top
View user's profile Send private message
Bidzoniy

New User


Joined: 04 May 2006
Posts: 1

PostPosted: Sat May 06, 2006 7:07 am    Post subject: Natural Interview Questions
Reply with quote

Can somebody provide the list of the possible Natural/Adabas interview questions (at leat some of them) or point me where I can find them

Thanks
Back to top
View user's profile Send private message
naveen_desireddy

New User


Joined: 29 Aug 2005
Posts: 9
Location: Hyderabad, India

PostPosted: Tue May 23, 2006 1:58 am    Post subject:
Reply with quote

if records exist with EMPLOY-ID = '3' within the first 10 READS, then they will be written because:

"If an ACCEPT condition is satisfied, the all the record's will be accepted
irrespective of other conditions
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> NATURAL & MQSERIES All times are GMT + 6 Hours
Page 1 of 1