| IBM MAINFRAME HELP & SUPPORT FORUMS Technical Forums for IBM Mainframe Applications like COBOL, JCL, CICS, DB2, FileAid, DFSORT, Endevor, Xpediter, CoolGen, CA-7&11, AbendAid, IMS, IDMS, PL/I, MqSeries, SyncSort, Assembler, ChangeMan, Easytrieve, InterTest, REXX, CLIST etc...
|
| View previous topic :: View next topic |
| Author |
Message |
atulrukmangad
Joined: 10 Apr 2006
Posts: 13
|
| Posted: Tue May 02, 2006 10:09 am Post subject: Tricky Question in NATURAL |
|
|
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 |
|
skodidine
Joined: 05 Apr 2006
Posts: 6
|
| Posted: Tue May 02, 2006 9:53 pm Post subject: Re: Tricky Question in NATURAL |
|
|
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 |
|
rahul_mf
Joined: 13 Sep 2005
Posts: 13
|
| Posted: Wed May 03, 2006 1:25 pm Post subject: Re: Tricky Question in NATURAL |
|
|
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 |
|
skodidine
Joined: 05 Apr 2006
Posts: 6
|
| Posted: Wed May 03, 2006 8:57 pm Post subject: Re: Tricky Question in NATURAL |
|
|
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 |
|
rahul_mf
Joined: 13 Sep 2005
Posts: 13
|
| Posted: Thu May 04, 2006 8:00 am Post subject: Re: Tricky Question in NATURAL |
|
|
| No probs :wink: |
|
| Back to top |
|
Bidzoniy
Joined: 04 May 2006
Posts: 1
|
| Posted: Sat May 06, 2006 7:07 am Post subject: Natural Interview Questions |
|
|
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 |
|
naveen_desireddy
Joined: 29 Aug 2005
Posts: 9
Location: Hyderabad, India
|
| Posted: Tue May 23, 2006 1:58 am Post subject: |
|
|
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 |
|
| |
THIS IS AN ARCIVE FORUM IN READ ONLY MODE. IF YOU WANT TO ASK YOUR DOUBTS USE THE ACTUAL FORUM
|