Hi Jeff,
The multi-value subroutines act on each system-delimiter delimited "piece" (i.e. value, sub-value). In order to use FIELDS, you need to get rid of the sub-value marks so that FIELDS can work down to only the value-level. Depending on how you write your I-Types, it would be
FIELDS(COVERT(@SM,"|",[whatever the larger thing is called]),"|",1,1)
-or-
...;CONVERT(@SM,"|",@);FIELDS(@,"|",1,1)
Of course the | can't be part of the data. Use whatever character works for the data.
I hope that helps.
Tyrel
------------------------------
Tyrel Marak
Technical Support Manager
Aptron Corporation
Florham Park NJ United States
------------------------------
Original Message:
Sent: 07-15-2021 12:01
From: Jeff Teter
Subject: I-type dictionary for first subvalue
I'll claim a senior moment here... An associate is trying to write an I-type dictionary that retrieves the first subvalue in a set of fields. I can certainly do it with a subroutine and the FIELD function, but the FIELDS function specifically excludes use of the value mark or sub-value mark as delimiters. Suggestons? I'm sure it will be a forehead slapper when presented...
The existing data is:
ABC@SVMDEF@VMGHI@SVMZBA@VMQAR
He wants it to return:
ABC@VMGHI@VMQAR
Thanks, in advance!
------------------------------
Jeff Teter
Woodforest National Bank
The Woodlands, TX
------------------------------