We have recently upgraded from Natural 3.1.6 to Natural 4.1.4. One of the new features is that the Read and Histogram have a new clause added that causes the data base loop to be satisfied at the database instead of in the program.
The syntax change is
READ file-view by descriptor FROM start-value/alt-file-view-field TO end-value/alt-file-view-field
and
HISTOGRAM file-view descriptor FROM start-value/alt-file-view-field TO end-value/alt-file-view-field
Syntactically they are supposed to be the same as using the FROM/THRU clause, the difference is that the data returned is slightly different. The FROM/THRU returns 1 record beyond the range specified so the program can terminate the processing loop. The FROM/TO only returns the requested data and the processing loop is terminated at the database and returns a 3003 response code indicating the end of file.
The problem we are running into is that the TO portion of the FROM/TO clause is being checked incorrectly during a CHECK or STOW operation and returning the NAT0632 error.
DEFINE DATA
LOCAL
1 RD-VIEW VIEW OF EMPLOYEES
2 PERSONNEL-ID
2 NAME
*
1 HIST-VIEW VIEW OF EMPLOYEES
2 PERSONNEL-ID
*
1 #UNIQUE-CNT (I4)
END-DEFINE
READ ALT-FILE-VIEW
H1.
HISTOGRAM HIST-VIEW PERSONNEL-ID FROM RD-VIEW.PERSONNEL-ID
TO RD-VIEW.PERSONNEL-ID
IF *NUMBER(H1.) = 1
ADD 1 TO #UNIQUE-CNT
END-IF
END-HISTOGRAM
END-READ
END
In this example the syntax check will give the error NAT0632 on the TO RD-VIEW.PERSONNEL-ID
If the TO is changed to THRU no error will be generated. Is anyone else having this problem?
Geoff Smith