Highlighting a keyword in an alphanumeric description field

Our client has a requirement where a keyword is supposed to produce a list of records containing it and highlighted in red on a map.
The records would come from a database with an alphanumeric field of 60 bytes length which basically is a description field.

For example, search ‘APP’

Rec1 APPLICATION
Rec2 LARGE APPLICATOR
Rec3 MAPPER

Would it be possible to accomplish this in Natural Mainframe online application?
We tried using an array of control variables but they came out spaced out on the map.

Thanks,
MArk

I don’t think you can do it.
I think its the whole field or nothing.

Thanks Giles for your input as it helps reinforce my thinking it is not possible.
I want to ensure that there is no trick that can pull it off in my scenario.

I don’t have any suggestions for marking the full matching substring, but you could use the
MARK POSITION
to highlight the matching start character inside the fields.
But as far as I remember only on 3270 !

Finn

See doc:
http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat824mf/sm/input1.htm#input_exa3

I’ve just dredged this up from memory. It might help. You will lose a space for the dynamic attribute but it will highlight part of the string
DEFINE DATA LOCAL
1 #FIELD (A20)
1 #CV1 (C)
END-DEFINE
REPEAT
INPUT #FIELD (AD=MY CV=#CV1 DY= )
END-REPEAT
END

run the program and enter
LARGELICATOR

To implement the use of DY= , you could

EXAMINE #FIELD FOR ‘APP’ AND REPLACE WITH ‘’

They the DY= will take over.

Of course, ‘APP’ could just as easily be #KEY, and you could also
COMPRESS ‘<’ #KEY ‘>’ into #REPLACE instead of ‘’

One other note. you could also REPLACE FIRST in the EXAMINE if that is what the customer wants, even if there are multiple instances of the search key.

One more note. you might have to expand #FIELD to accommodate the delimiters <> (and perhaps multiple instances of them), depending on how many actual characters might be in the field.

Thanks you very much for your expert inputs Giles, Steve and Finn.

I will try it and update you of the result.

Cheers! :slight_smile:

Hello experts,

I was given another option that may eliminate the delimiter space but i can’t make it work.
Is this possible?

DY= '23BL’24GR’25YE’26

Binary 23=BL, 24=GR, 25=YE, 26=Escape character

COMPRESS ‘Hello’ H’24 ‘world’ INTO #A /* world will be green

Many thanks!

DY= has been around for a long time in Natural. A very nice feature, especially for creating multi color bar charts.

However, the control characters do leave a space. for example

1 #BAR (A60) INIT <’ @ # $'> /* put some number of blanks between the characters

and

Write #bar (ad=v cd=pi dy=@ye#bl$gr&)

You will get a multi colored bar, BUT, there will be gaps where the control characters are.

I would get them to do it then :wink:

I’m suspicious about it myself nor could i find anything else in the documentation other than what you guys have presented.

Just want to make sure i leave no stone unturned :lol: