That is how it has always worked, you can override by putting DEBUG(*INPUT) on your h spec. From the manual
*INPUT
All externally described input fields will be read during input operations even if they are not used in
the program. Normally, externally described input fields are only read during input operations if the
field is otherwise used within the program.
Scott
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Bob Cagle
Sent: Tuesday, February 10, 2015 9:50 AM
To: RPG400-L@xxxxxxxxxxxx
Subject: New free format file declarations' input fields
So I've written a very simple update program using the new free-format.
Here's a very simplified version of the code:
dcl-f File1 keyed;
dcl-f File2 keyed;
dcl-f File3 keyed;
read File1;
DOW not %eof;
Setll F1FLD1 File2;
Reade F1FLD1 File2;
DOW not %eof;
Setll (F2FLD1:F2FLD2) File3;
Reade (F2FLD1:F2FLD2) File3;
DOW not %eof;
F3FLD1 = NewValue;
Update File3;
Reade (F2FLD1:F2FLD2) File3;
ENDDO;
Reade F1FLD1 File2;
ENDDO;
Read File1;
ENDDO;
I've put it in debug to check my code, but only the fields that I've actually referenced in the program are being populated. For example, any other field in File1 besides F1FLD1 is blank/zero. Is this a side-effect of the new DCL-F statements? Shouldn't the field buffer still be getting populated with the values from the file?
Thanks
Bob Cagle
IT Manager
Lynk, Inc.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.