I’m working on an RPGLE program where I’m trying to update fields in a table based on conditions from another table (STUURPROD). However, I’m getting errors like:
The name or indicator STATUS is not defined.
The name or indicator PRODINV is not defined.
I have declared the files like this:
dcl-f BRONPRDCT disk keyed usage(*input); dcl-f DOELPRDCT disk keyed usage(*output); dcl-f SAVEPRDT disk keyed usage(*output); dcl-f STUURPROD disk keyed usage(*input);
What could be causing these fields not to be recognized? I’m also using variables like PRODINV, STATUS, and VALUE, but they seem to be undefined. How should I properly declare them to avoid these errors?
This will give others enough information to assist you effectively.
Let me know if you need any further adjustments or clarifications!
-
Declared the files using dcl-f:
I declared the BRONPRDCT and STUURPROD tables using the dcl-f keyword like this:
dcl-f BRONPRDCT disk keyed usage(*input); dcl-f DOELPRDCT disk keyed usage(*output); dcl-f SAVEPRDT disk keyed usage(*output); dcl-f STUURPROD disk keyed usage(*input);
-
Accessed fields directly:
I then tried to access fields like STATUS, OPERATION, and VALUE from STUURPROD, and PRODINV, PRODPRIJS from BRONPRDCT in my logic. My assumption was that the fields would be automatically available once the file is declared. -
Used chain to retrieve data:
I attempted to use the chain operation to retrieve the STUURPROD record and expected to directly access the fields after the chain operation like this:
chain (PRODUCTID) STUURPROD; if %found(STUURPROD) and STUURPROD.STATUS = 'Y';
Gijs Verbree is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2