Steve Stepp

Forum Replies Created

Viewing 3 replies – 1 through 3 (of 3 total)
  • Author
    Replies
  • in reply to: Find Msgs with 2 or more OBR segments in SMAT #85988
    Steve Stepp
    Participant

      I ended up solving this myself. I was trying to do something like

      Code:

      (OBR){2,}

      But it would never match. So I ended up using this instead

      Code:

      bOBRb(?:[sS]+?bOBRb)+

      EDIT: I have since found an even easier way

      Code:

      (?s)OBR.*OBR

      in reply to: TCL or XLATE Complex situation? #79494
      Steve Stepp
      Participant

        I both emailed and spoke to Jim on the phone and he gave some additional tips that I though I’d share, just in case someone else finds this thread interesting.

        I didn’t read the documentation close enough on ITERATE.

        Excerpt: “All variables must start with % and be either f (field), g (group), l (list), or s (segment). If there is more than one variable, use, for example %f1, %f2, and so on.” I wasn’t using one of those four single letters and a number. That was one issues (of several).

        Another tip, unless the % variable is used in an actual address path (such as “1(0).1(%g1).1(%g99).OBX(0).#5(0)” ) you likely need to preface it with a dollar sign ($) so that TCL will interpret it correctly as a variable. This got me in an IF statement, MATH statement, and COPY statement.

        in reply to: TCL or XLATE Complex situation? #79492
        Steve Stepp
        Participant

          Jim,

          I am trying to use the technique to add an OBX segment (as the first OBX) when certain conditions are met. But I’m having issues with the variables I think. I’ve always used a percent sign for iteration variables (i.e. %group1 ) and an @ symbol for regular variables (i.e. @obxcntr). I appear to be getting errors when trying to use the @ var in a path.

          I also tried to make my variables using the percent instead but that didn’t work either.

          I’ve included an image with a screenshot from the Xlate.

        Viewing 3 replies – 1 through 3 (of 3 total)