Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Few interview questions in Natural?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries
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    Post subject: Few interview questions in Natural?
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    Post subject: Reply to: Few interview questions in Natural?
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

Site Director


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

PostPosted: Thu Jul 08, 2010 10:54 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: Few interview questions in Natural?
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    IBMMAINFRAMES.com Support Forums -> Java & MQSeries All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts The Last Two Question For You To Ask ... CaptBill Mainframe Interview Questions 0 Fri Apr 14, 2017 5:42 am
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Viewing executing process in NDM .. q... Debb.Brant IBM Tools 0 Wed Dec 14, 2016 10:55 pm
This topic is locked: you cannot edit posts or make replies. Natural ADABAS Opening with CTS enikhilk Mainframe Jobs 0 Wed Nov 30, 2016 5:37 pm
No new posts Casting a Binary Number to Numeric in... Bob Steinkraus Java & MQSeries 6 Tue Aug 09, 2016 5:58 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us