View previous topic :: View next topic
|
Author |
Message |
Arunprasad.k
New User
Joined: 04 Jan 2008 Posts: 7 Location: Chennai, India
|
|
|
|
Experts,
I am reading a ADABAS file with a view defined. Here is the simple program I have written.
Code: |
DEFINE DATA
LOCAL
01 AR_VEHICHLES-VIEW VIEW OF VEHICLES
02 WHOLESALE-SALE-DATA (1:20)
03 DEALER-ORDER-NUMBER
03 DEALER-ORDER-TYPE
02 NMC-MODEL-SERIAL (N11.0)
02 VIN-PREFIX (A11)
01 #I (N2)
END-DEFINE
*
RD1. READ (40) AR_VEHICHLES-VIEW
FOR #I=1 TO 20
IF SUBSTR(DEALER-ORDER-NUMBER(#I),1,1) = 'F'
DISPLAY VIN-PREFIX 1X NMC-MODEL-SERIAL 4X DEALER-ORDER-NUMBER(#I)
END-IF
END-FOR
END-READ
END |
When I check this code (giving CHECk in command line), it shows no errors. But when I run this code (by giving RUN in command line) it gives me the following error.
Quote: |
NAT3041 Error detected in format buffer. DB/FNR 233/6 |
Line of error:
Code: |
RD1. READ (40) AR_VEHICHLES-VIEW |
PS: I searched this forum with the key word NAT3041 and could not found any hits. Since I am new to Natural, I could not think of some other key words. |
|
Back to top |
|
|
Arunprasad.k
New User
Joined: 04 Jan 2008 Posts: 7 Location: Chennai, India
|
|
|
|
Sorry guys, the problem is resolved!!
Reason: The ADABAS file is not present in that region (or Library. Not sure regarding the terms).
I was under an assumption that when a VIEW (of Vehicles file) is present then the FILE should also be present in that region.
Thank you all.
Arun. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome
Thank you for posting what you found. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
A little explanation:
Although NATURAL is an interpreted language, it still generate some kind of object-like-module that is created when you CATALOG, STOW or CATALL.
Within this module, NATURAL keep track of files and their origin. If a view was specified, and that view came from a DDM that contains an FNR and DBID, then NATURAL imbed their values into this "module".
Then, when executing the module, NATURAL is looking for these specific FNR and DBID (in your case: 233/6).
There are several solution for this issue.
First direction is to use DBID=0 in the DDM.
The other direction is to use logical files table, and point the DBID/FNR to other numbers at run time (there are at least 3 ways to achieve this).
O. |
|
Back to top |
|
|
|