-1

I have store two characters value in two temp table

CREATE tt_test1 NO-UNDO
FIELD Value_1 AS CHARACTER.

CREATE  tt_test1.
ASSIGN  tt_test1.Value_1 = "SBCL---DS----A3".

CREATE tt_test2 NO-UNDO
FIELD Value_2 AS CHARACTER.

CREATE tt_test2 NO-UNDO
ASSIGN tt_test2.Value_2 = "4+7+9+14,L-SA".

If you see tt_test2.Value_2 is based tt_test1.Value_1.

i.e

4 = L (4th character of tt_test1.Value_1)

7 = - (7th character of tt_test1.Value_1)

9 = S (9th character of tt_test1.Value_1)

14 = A (14th character of tt_test1.Value_1)

So now my question is how can compare tt_test1.Value_1 and tt_test1.Value_2 is matching correctly?

If its matching then i need to assign in one variable. Please help this case.

Thiru
  • 231
  • 6
  • 20
  • What does this question have to do with “progress-bar” or “progressdialog”? I feel like I am misunderstanding it somehow. – Tom Bascom Mar 16 '19 at 14:30
  • I am sorry sir for make a confusion. It wont happen again – Thiru Mar 16 '19 at 15:42
  • The tags that seem relevant (to me anyway) for this question are "progress-4gl" and "openedge". Adding unrelated tags just because they happen to contain the word "progress" is counter-productive and confusing. – Tom Bascom Mar 16 '19 at 19:52
  • Your sample does not compile Unable to understand after -- "CREATE tt_test1". (247). What are you trying to achieve ? From this simple non-compiling sample I guess you're trying to test some relation between two variables – carl verbiest Mar 18 '19 at 07:07

1 Answers1

1

You could use the SUBSTRING() function to compare the various 4th, 7th, 9th and 14th characters.

Something like:

IF SUBSTRING( field1, 4, 1 ) = SUBSTRING( field2, 4, 1) and
   SUBSTRING( field1, 7, 1 ) = SUBSTRING( field2, 7, 1 ) and
   SUBSTRING( field1, 9, 1 ) = SUBSTRING( field2, 9, 1 ) and
   SUBSTRING( field1, 14, 1 ) = SUBSTRING( field2, 14, 1 ) THEN ...
Tom Bascom
  • 13,405
  • 2
  • 27
  • 33