Numeric value

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Numeric value

  • Creator
    Topic
  • #47688
    Tim Hallbauer
    Participant

      Is there a way to check if a field value is numeric withing an Xlate without calling out to a proc?

    Viewing 2 reply threads
    • Author
      Replies
      • #56455
        Jim Kosloskey
        Participant

          Tim,

          I don’t think so unless the intrinsic functions (which I have never used) have that function.

          Jim Kosloskey

          email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

        • #56456
          Dennis Pfeifer
          Participant

            Nothing native to the Xlate functions .. but ..

            a one line tcl will do the trick …

            perform a copy ..

            use the following (one line) in the pre proc.

            set xlateOutVals

              ]]

              then .. set the output to @isInteger

              and use @isInteger in an Xlate If statment …

              If @isInteger==1

              Then it’s numeric.

              Dennis

              P.S. (assuming your numbers aren’t too big)

              you may wish to remove the -strict so that empty strings are ‘integers’

            1. #56457
              Tim Hallbauer
              Participant

                Thanks, that brings up another question. The field I am looking at is actually a sub-field in ADT transactions.

                These fields would only be numeric in disaster situations like a terrorist incident or a really huge accident like a bus or plane crash.

                Which method would be more efficient? Keep in mind that they want this installed and running ALL the time, not just when we have an incident

                1. Calling a pre proc on the inbound side and splitting the message to get to the sub field, checking it to see if it’s numeric, changing it to blank and then rebuilding the new message….or

                2. Calling from within the Xlate as suggested but having to do it multiple times, possibly 9, not to mention changing every translate.

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