Hi Rob,
FQPRINT O F 132 PRINTER OFLIND(*INOF)
worked fine. What is it trying to figure out if you don't prefix it with
the *IN, named indicators?
In V3R1, IBM introduced RPG IV, which had the OFLIND keyword instead of
just putting the indicator name in a particular position of the F-specs.
When they started using a keyword, they required that the indicator
name be spelled out as *INxx.
It's no different from the calc specs. You can't do this:
C IF OF = *ON
you have to do this, instead:
C IF *INOF = *ON
The only way you can use the 2-character abbreviated indicator name is
when you use them in the legacy 'conditioning indicator' or 'resulting
indicator' spaces of the C-spec, I-spec or O-spec. You can never use
the short names in regular calc spaces, and you also can't use them on
the F-spec under OFLIND(). It's no different. So that was V3R1.
In V3R1 - V4R5, specifying OFLIND(OF) (or even Kurt's OFLIND(INOF))
would be a syntax error, and wouldn't compile.
As Booth also pointed out, you had to use numbered indicators with an
externally defined file, and the special indicators that began with the
letter O for program-described files. Those were your only options.
Then in V5R1, IBM finally yielded to those of us who were campaigning
for ways to eliminate the numbered indicators from our code. They said
"In V5R1, OFLIND file-specification keyword can now take any indicator,
including a named indicator, as an argument."
So now you don't have to use indicator names like *INOF or *IN76. You
can create a named indicator (D-spec data type N) and use it with the
OFLIND() keyword, and it'll work great.
For example:
FREPORT O F 132 PRINTER OFLIND(ReportOverflow)
D ReportOverflow s 1N
/free
if ReportOverflow;
except NewPage;
endif;
Very pretty, huh? And easier to understand than *IN76.
Anyway... what you did, OFLIND(OF) wouldn't have been valid syntax
prior to V5R1. But in V5R1 and later, it's using a field named OF, not
the built-in indicator *INOF. Which almost worked for you! The only
problem is, named indicator fields can't be specified in the 2-character
conditioning indicator spaces on O-specs. Only built-in indicators
can be... so the F-spec thinks you mean a named indicator named OF, and
the O-spec thinks you mean the built-in indicator *INOF.
But the built-in indicator, *INOF isn't assigned to that file -- so you
get the 'it's not assigned' error.
Make sense?
As an Amazon Associate we earn from qualifying purchases.