Lists, Lists, Lists

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Lists, Lists, Lists

  • Creator
    Topic
  • #51068
    Mike Keys
    Participant

    I’m in the process of converting some eGate translations into tclprocs.

    A few of these utilize lists to validate against before allowing a message to pass. What is the best way to do this as some of these lists are rather lengthy? Lookup table? Regex?

Viewing 4 reply threads
  • Author
    Replies
    • #68665
      Jim Kosloskey
      Participant

      If the Lists are 2 column lookup and are static then I would use Lookup Tables.

      If you can read the lists, you can use Tcl to convert the lists to a Lookup Table thereby minimizing the effort to convert ( still need to test though).

      If the lists are ‘presence’ indicators (that is if it is present assume some action) then a lookup Table can still be used (if the list is static) but the conversion would be slightly different.

      More information regarding the lists would allow a more detailed response.

      email: jim.kosloskey@jim-kosloskey.com

    • #68666
      Mike Keys
      Participant

      Jim,

      For my fisrt list, I am checking the first few characters of OBR-4 (universal service ID). I have two lists comprised of test prefix codes. There is a list for 3 character codes and a list for 4 character codes. In my current eGate translation I do a file compare by looking at the first three characters of OBR-4 and comparing with the 3 character list and do this again by checking the first 4 charactes of OBR-4 and comparing with the 4 character list. And some of the prefixes are only two characters, so I hardcode a space to make it three.

      I can put all of this in lookup table (single column) but where I am struggling is if I am still going to have to do this twice (once for 3 and once for 4).

    • #68667
      Jim Kosloskey
      Participant

      Depending on the characteristics of the data you might be able to make one table with 4 characters in the first column.

      Pad the 3 character entries with one space on the right and pad the data for the lookup just like you are doing for the 2 character.

      Pad the 2 character data and entries accordingly.

      The 4 character entries and data would remain untouched.

      So if you had these values for the table: 1234 123 12 the table entries would look like this ( means one space):

      1234

      123

      12

      Of course if a space is a valid entry in a 4 character identifier then that won’t work and you will need to use some other pad character.

      Then in your Xlate pad the appropriate number of spaces to the data (possibly to a temp variable) and then do the Lookup.

      I do not recall what happens if you do not populate the second column (maybe you get a null returned) but I always put a value in the second column. If I am filtering then I put a Y or an N to indicate Yes or No.

      If you do not specify anything for the Default then you will get a null for the lookup value if the data value is not found in the Table.

      If it is filtering you are attempting to accomplish then a better place to do this would be in a pre-Xlate proc in the Route definition (you can still use a Table).

      email: jim.kosloskey@jim-kosloskey.com

    • #68668
      Mike Keys
      Participant

      If it is filtering you are attempting to accomplish then a better place to do this would be in a pre-Xlate proc in the Route definition (you can still use a Table).

      Example?

    • #68669
      Jim Kosloskey
      Participant

      We use a reusable, generic proc for filtering that is argument driven.

      If you send me an email, I will send the proc and its doc in the response to your email.

      It may take a couple of days as I am on vacation.

      email: jim.kosloskey@jim-kosloskey.com

Viewing 4 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
4,968
Forums
28
Topics
9,108
Replies
33,633
Topic Tags
248