× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



My experience is that if you don't use the keyword then even if you condition the DSPATR(UL) keyword off the underline still displays.
Based on the manual this should only happen if you don't include the DSPATR(UL) attribute.

I know I have seen protected fields that had the underline even when there was no DSPATR(UL) keyword used.
This shows that the global default for input/both is to always underline.


From the V5R4 DDS manual:
If DSPATR(UL) is specified for a field, the CHGINPDFT keyword cannot control underlining for that field.

For input and both fields, DSPATR(UL) also must be specified but not selected in addition to the equivalent keywords.
This is because DSPATR(UL) is applied to input and both fields by default when CHGINPDFT is not specified.


So, for input and both fields, by not specifying either keywords DSPATR(UL) or CHGINPDFT(UL), the default is to underline.

When only specifying CHGINPDFT(UL) the input/both fields are always underlined.

When using an unconditioned DSPATR(UL) you always get an underline.

When you provide an indicator with DSPATR(UL) to "Not Select" the underline attribute (i.e. turn off the indicator), then CHGINPDFT(UL) is ignored in lieu of the "Not Selected" DSPATR(UL). Allowing you to hide an underline.

So, by specifying "A 41 DSPATR(UL)", the system is effectively ignoring the superfluous "UL" of the CHGINPDFT(UL) keyword.

CHGINPDFT can be passed multiple parameters to trigger different DSPATR equivalents, and can be set at multiple levels of field, record format, and/or file.

It is also interesting to note that if you activate a combination of UL, RI, and HI attributes at the same time with CHGINPDFT and/or DSPATR then the field will be hidden.

Even if you don't specify the "DSPATR(UL)" keyword combination, the attribute can still be set by the program if a DSPATR keyword has been specified with a Program-to-System field:

A S2KEY 1A B 10 29
A DSPATR(&DSPATR28B)
A DSPATR28A 1A P

The "P" of the DSPATR28A definition defines the field as a "Program-to-System" field.

Using this method you can load additional attributes, using their hex equivalent, directly into the attribute field.
AFAIK, this method can only be used to add attributes, and cannot be used to remove the underline for input fields.

If you want the program to control all attributes without using indicators, then DSPATR(&FIELDNAME) can be used with an empty "CHGINPDFT" (without any attribute value).
The empty CHGINPDFT sets the input default to None and removes the default underline.
I wrote a quick test program on V7R1 and verified this result.

The only attribute you cannot set with a Program-to-System field is the Position Cursor attribute.
You can still specify a separate "A 51 DSPATR(PC)" entry or use the row/column positioning using the CSRLOC record level keyword.

We use a service program procedure to generate the desired attribute.
You can combine multiple attributes using the %bitor function.

Here is the function we have in a service program. It's based off of code from this old article:

http://search400.techtarget.com/tip/Display-attributes-made-simple



P Utl_RtnDspAtr B EXPORT
D Utl_RtnDspAtr PI 1A
D colorValue 3 CONST OPTIONS(*OMIT:*NOPASS)
D colorAttr 2 CONST OPTIONS(*NOPASS)
D ProtectField 1N CONST OPTIONS(*NOPASS)

*---
* Define constants
*---
D Blue C Const(X'3A')
D Green C Const(X'20')
D Pink C Const(X'38')
D Red C Const(X'28')
D Turquoise C Const(X'30')
D White C Const(X'22')
D Yellow C Const(X'32')

D Blink C CONST(X'2A')
D NonDisplay C CONST(X'27')
D Protect C Const(X'80')
D Reverse C Const(X'01')
D Underline C Const(X'04')

D color S 3A
D attr S 2A
D pr S 2A
D attribute S 1A

/free

IF %parms < 1 or %addr(colorvalue) = *null;
color = 'GRN';
ELSE;
color = Utl_Toupper(colorValue);
ENDIF;
IF %parms < 2;
attr = ' ';
ELSE;
attr = Utl_Toupper(ColorAttr);
ENDIF;
IF %parms > 2 and ProtectField=*ON;
pr = 'PR';
ELSE;
pr = *blank;
ENDIF;

SELECT;
WHEN Color = 'BLU';
attribute = Blue;
WHEN Color = 'PNK';
attribute = Pink;
WHEN Color = 'RED';
attribute = Red;
WHEN Color = 'TRQ';
attribute = Turquoise;
WHEN Color = 'WHT';
attribute = White;
WHEN Color = 'YLW';
attribute = Yellow;
OTHER;
attribute = Green;
ENDSL;

IF attr = 'UL' or attr = 'UR';
attribute = %bitOr(attribute:Underline);
ENDIF;
IF attr = 'RI' or attr = 'UR';
attribute = %bitOr(attribute:Reverse);
ENDIF;
IF attr = 'BL';
attribute = Blink;
ENDIF;
IF attr = 'ND';
attribute = NonDisplay;
ENDIF;

IF pr = 'PR';
attribute = %bitOr(attribute:Protect);
ENDIF;

RETURN attribute;
/END-FREE
P Utl_RtnDspAtr E

Chris Hiebert
Senior Programmer/Analyst
Disclaimer: Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.