Q: We are chaining to a file that has two record formats. We use the record format in factor 2 instead of the file name. When we try to use the %FOUND function (or NOT %FOUND), we get an RPG compile error: RNF0394 The parameter is not valid for built-in function %FOUND. Are we doing something wrong? Surely you can use the record format name on the chain?
A: You can CHAIN to a record format, but %FOUND(fmtname) is not valid; you must use %FOUND or %FOUND(filename), even you you originally chained to a format.