1 Reply Latest reply on Sep 17, 2013 1:47 PM by philmodjunk

    What is the best way to receive this information?

    Kirk_1

      Title

      What is the best way to receive this information?

      Post

           I will receive the following data set:

           ISA*00*          *00*          *ZZ*ABCCOMPANY     *02*EXLA           *090331*0409*|*00401*000005177*0*P*:<NL>
           GS*BL*ABCCOMPANY*EXLA*20090331*0409*51770001*X*004010<NL>
           ST*211*0001<NL>

           What is the best way to bring it into my system?

           I tried:

           Set value:: $EdiImport

           Let ( [

                           $params = Get ( ScriptParameter ) ;

                           INname = GetValue ( $params ; 1 ) ;           

                           INAddress = GetValue ( $params ; 2 )

           It does not evaluate it, i'm guessing it can't distinguish * as separators but i don't know if thats the issue or not.

        • 1. Re: What is the best way to receive this information?
          philmodjunk

               Second post dealing with GetValue in a row...

               GetValue returns all the data separated by the return character, not the * character.

               You could use the substitute function to replace the * character with returns and then GetValue could work to return all text shown between the returns, you may want to use the trim function to remove unneeded trailing spaces:

               Let ( $Text = Substitute ( Get ( ScriptParameter ) ; "*" ; ¶ ) ; Trim ( GetValue ( $Text  ; 1 ) ) )

               Should return ISA from the above sample text if it is passed as a script parameter. Subsequent uses of GetValue can extract different text from the $Text variable without needing to get another copy of the script parameter and perform another substitution.