0

am trying to extract the first character from each subvalue in a record attribute.

Thus far am trying

REUSE(@RECORD<2>);FIELD(@1,'*',1,1)

But it would appear to be returning the first character of the first subvalue.

Know this can be done, but having no luck with it.

Edit record 2 is in the format ABC]BAD]FCC"

Edit 2 , sorry there's an aster (*) between each letter of the array in previous line but can't work out how to show that

ScaryMinds
  • 335
  • 3
  • 11

2 Answers2

0

If it you are looking to do a FIELD operation on a multivalued attribute use FIELDS instead.

FIELDS(@RECORD<2>,'*',1)

If you are trying to get just the first character, or so any kind of string manipulation for that matter, I will tell you that I have long found that to be somewhat difficult. Upon reflection, the way forward might be using FMTS(), but as I am not sure that is what you are looking for, I will wait to test that out when I have need for it again.

Good Luck.

Van Amburg
  • 1,207
  • 9
  • 15
0

There will be a number of ways to do this but I would use a conversion like this:

OCONVS(@RECORD<2>, 'T1')

This uses the T conversion to text extract the first character. It is applied to a multivalue by using the OCONVS function.