Hi Patrick,
You need to define a program field for each field and then associate the
program fields with the Display Field using the DSPATR KeyWord.
Note a program field has a length of 1 Character.
A CO_DAY01 1A P
...
A R1_DAY01 ....
A DSPATR(&CO_DAY01)
In your program you then just set the hex value of the color/attribute in
the program field.
The program fields always worked (at least as long as I'm on AS/400/IBM I
... in release V2R3)
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
Modernization ? Education ? Consulting on IBM i
Database and Software Architect
IBM Champion since 2020
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
"Train people well enough so they can leave, treat them well enough so they
don't want to. " (Richard Branson)
"Learning is experience ? everything else is only information!" (Albert
Einstein)
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Patrik
Schindler
Sent: Wednesday, 9 July 2025 10:35
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: DSPF: Condition display fields without indicators
Hello,
I have a display file containing a subfile which I use to show a calendar
for one year on screen. Each month is one record (line) in the SFL, and the
fields are named according to month days (DF_DAY01 to DF_DAY31).
I'm using one indicator per field to mark it DSPATR(RI) for the current day.
This works like expected, but eats up 31 indicators.
Now I want to add "mark Sunday red". Can't use more indicators, and
remembered there were "program to system fields". So I redefined the
individual fields for one month, adding
COLOR(&CO_DAY01)
And after the SFL displayed fields, I added
A CO_DAY01 3A P
Won't compile: CPD7494, Keyword ignored because of error in list of values.
The DDS reference does not state if program fields are allowed or not for
the COLOR keyword.
Note, I'm on V4R5, but I'm getting the same compile error on 7.3.
Found this one:
https://www.rpgpgm.com/2013/10/condition-display-fields-without.html
Seriously? Do I need to fiddle with hex values? Or do I overlook something
in my field descriptions?
Thanks for your thoughts!
:wq! PoC
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
As an Amazon Associate we earn from qualifying purchases.