4 Replies Latest reply on Apr 18, 2012 3:06 PM by 444262

    ODI OSCommand - OS command return codes

    765170
      Hi,

      where can I find all the error return codes of OdiOsCommand? Is there any table of return codes?
      eg. I am getting error number 2 when generating a list of files in directory by unix command "ls"

      OdiOSCommand "-OUT_FILE=#c_EXTRACTS_ROOT_DIR/processing/#v_FILE_NAME.#v_EFFECTIVE_DATE" "-WORKING_DIR=#c_EXTRACTS_ROOT_DIR/incoming/I1" "-SYNCHRONOUS=YES"
      ls #v_FILE_NAME*.zip

      thank you
      Kubis.
        • 1. Re: ODI OSCommand - OS command return codes
          774570
          see if this method(http://odiexperts.com/getting-one-or-several-unknown-files-from-a-directory) helps you and also instead of windows command try the ls command and execute
          1 person found this helpful
          • 2. Re: ODI OSCommand - OS command return codes
            765170
            Thank you Kshitiz, you and Cezar are doing REALLY GOOD work at ODI Experts.

            That's what I am doing, reading the files in a directory (with mask) then using interface to store the list of them into a metatable. But where there are no files (which unfortunately happend now - extracts did not come) this OdiOsCommand failed returning code 2.

            Message
            om .sunopsis .dwg .function .SnpsFunctionBaseExceptuon: OS command returned 2.

            I need to handle error codes from OdiOsCommand when it fails. Is there a list of the error codes?

            We are using ODI on Linux.
            Kubis
            • 3. Re: ODI OSCommand - OS command return codes
              Cezar Santos
              Hi Kubis,

              you can create a variable and use the "getprevsteplog" api in the refresh tab to obtain the error code.

              After that you can identify if the error is "2" and take no action...


              Make sense?


              Cezar Santos
              http://odiexperts.com
              1 person found this helpful
              • 4. Re: ODI OSCommand - OS command return codes
                444262
                Hi.
                I am calling a shell script from ODI as below inside an ODI procedure P1. The os command below is in 'Command on Target' side.I have defined v_in_param as an 'option' inside procedure P1

                OdiOSCommand sample.sh v_in_param

                i am getting error as 'OS command returned 1'.

                Is it the right syntax to pass an 'option' parameter to an OS call?

                thanks