"IF NO RECORDS FOUND"

I am modifying a 20 year-old program written in Reporting mode.
A new record has been added to the database that may or may not occur. I need to discover if the record exists before taking action.
I am unable to get “IF NO RECORDS FOUND” to work in the old program. I’ve written a couple of test programs and it works fine there when the records are defined in the DEFINE DATA area. The old program does not have numbered data elements, so that seems to be a problem.
The error I get is NAT0384 Explicit format specification required.

Any ideas greatly appreciated.

Ed O’Farrell

A couple of possibilities come to mind; but a look at the code would help. For example, the statement that the 0384 points to.

Usually, in report mode, this error is due to an undefined variable. Thus, in the INRF clause, did you MOVE something to a variable whose format/length has not been specified?

In the INRF clause do you have a database field spelled incorrectly?

Do you have a DO…DOEND for the clause?

steve

Twenty years ago, Natural would automatically assign (N7) as the format and length of any variable for which you did not define them explicitly.

Check the FS parameter in your Natparms. OFF means that a format specification is not required; Natural will default to N7. This applies only to Reporting Mode.

Probably the IF NO RECORDS FOUND clause is wrongly positioned
like this
0010 FIND EMPLOYEES WITH NAME EQ ‘a’
0020 WRITE ‘in loop’
0030 IF NO RECORDS FOUND
0040 WRITE ‘nothing found’
0050 END

The code above leads to NAT0384 (on MF)
In sysntax, IF NO RECORDS FOUND is part of the FIND !

Peter