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

Few interview questions in Natural?


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rohanjlobo

New User


Joined: 24 Feb 2010
Posts: 2
Location: bangalore

PostPosted: Thu Jul 08, 2010 1:27 pm
Reply with quote

Hi,

Please let me know the answers for following questions :
1. If i am reading 10 duplicte records(10 + 10 =20) using FIND statement, what will be the *counter and *number?
2. How to change particular natural error in program?
3. How to load the data in adabas database?
4. How to use workfiles?
5. If i am calling subprogram from main program, and in subprogram if i change the values of fields passed from main program, will it afect main program?
6. Some important adabas errors?

Thanks in advance,
Rohan.
Back to top
View user's profile Send private message
atulbagewadikar

New User


Joined: 15 Jun 2006
Posts: 26

PostPosted: Thu Jul 08, 2010 5:15 pm
Reply with quote

1.
*NUMBER always tells you the number of records satisfying a search criteria (used on WITH clause).
*COUNTER counts iterations i.e. no. of times a loop (FIND in your case) is executed.

In your case
*NUMBER should be 20 (considering there are 20 records macthing a value specified).
*COUNTER should be 10 (considering you are reading 10 records)

See the sample example

Code:
FIND(5) ACCT WITH ACCT-NO EQ '023500002'
DISPLAY ACCT-NO
END-FIND
WRITE 'NO OF RECORDS FOUND (*NUMBER) = ' *NUMBER
WRITE 'NO OF TIMES LOOP EXECUTED (*COUNTER) = ' *COUNTER
*
END

ACCOUNT NUMBER
--------------

023500002
023500002
023500002
023500002
023500002

NO OF RECORDS FOUND (*NUMBER) = 9
NO OF TIMES LOOP EXECUTED (*COUNTER) = 5


2. Can you please be more specific?

3. Using NATURAL's STORE statment (ADDs the record to ADABAS). There is ADABAS utility as well i.e. ADALOD

4. Using READ WORK FILE and WRITE WORK FILE statements (depends on what you want to achieve). There are other statments as well like DEFINE WORK FILE, CLOSE WORK FILE see the NATURAL manual.

5. The fields will have changed values (in main program as well).

6. There are many. Depends on what kind of work you do and can enountered to.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Jul 08, 2010 10:54 pm
Reply with quote

Hello,

Quote:
6. Some important adabas errors?
If it happens, it is important. If it was not important, it would not be documented as an error. . . It is far more important to be able to research and correct a problem than it is to have memorized the error codes. . .

The errors that occur depend on which mistakes are made - which is typically site-specific.

This is true of all database management systems. . .

If you are trying to show experience where there is none, it doesn't work. . .
Back to top
View user's profile Send private message
rohanjlobo

New User


Joined: 24 Feb 2010
Posts: 2
Location: bangalore

PostPosted: Fri Jul 09, 2010 3:04 pm
Reply with quote

Thanks atul....

2. Say if particualar natural application is abending or displaying error - nat0001. So is it possible to change[edit] this error inside program (From nat0001 to 'undefined varaible') so that next time if same error comes it will display 'undefined variable' instead 'nat0001'
Back to top
View user's profile Send private message
atulbagewadikar

New User


Joined: 15 Jun 2006
Posts: 26

PostPosted: Fri Jul 09, 2010 4:33 pm
Reply with quote

Rohan,

Seems you need to study and understand NATURAL basics.

NAT errors can occur during compilation (CHECK, STOW etc) and should be resolved accordingly to compile an object successfully.

Some of them may occur at run time (like you mentioned). NAT system errors(starting with NAT if you're not aware) are NATURAL system messages defined by SOFTWARE AG (to whom NATURAL/ADABAS belongs to) and not available to change their number or description at user level (not at admin level too!!!). I belive SOFTWARE AG NATURAL/ADABAS owners only can have this privilege if they really want to.

Well, you can trap these errors though at run time using ON ERROR statement and may want to pass a message (that you want to). You also have an option to define user defined or application specific messages. This should be placed into *ERROR-NR system variable (and executing REINPUT WITH TEXT *nnnn). You may modify the content of this system variable via a Natural program; however, not within an ON ERROR statement block.

Hope this clears your doubt.
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 -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts IMS DB using Natural Language IMS DB/DC 0
No new posts Negative value - packed field - Natur... Java & MQSeries 0
No new posts Call Natural program with rexx CLIST & REXX 2
No new posts Comp interview questions Mainframe Interview Questions 5
No new posts Interview Questions on Cobol DB2 program Mainframe Interview Questions 5
Search our Forums:

Back to Top