1 2 Previous Next 16 Replies Latest reply on Feb 22, 2012 5:56 AM by EC67993

    command task command from parameter file

    New Member

      Hi

       

      I wonder can we assign a command string in a parameter file and call the variable in the command task.

       

      for ex,

       

      in a parameter file i'm giving like

       

      [Global]

      $$test_command=sh '/xxx/yyy/test_script.sh'

       

      and in the workflow level i'm calling the parameter file,

       

      then in the command task command1 as $$test_command

       

      will it work

       

      Thanks in advance

        • 1. command task command from parameter file
          Guru

          Hi Harish,

           

          We can use the variable in the command task which you defined in the param file.

           

          Regards

          Sasiramesh

          • 2. command task command from parameter file
            user150229 Seasoned Veteran

            Hi

             

            The support for parameters in powercenter were greatly enhanced in version 8.6.x

             

            The trick is to use workflow variables EVERYWHERE. You can expect them to work except inside expressions/filters/routers/aggregators in a mapping. As long as the expansion is done at the 'session-level' it will work. Examples include:

             

            - source qualifiers

            - source files for lookups/flat file readers

            - trigger files in wait tasks

            - default values for mapping variables (must be string datatype and have precision greater than the length of the wf-var's name)

            - table owners

             

            You can even expect 'double expansions' as this example:

             

            [Global]

            ;change the following line to DEV when not in production....

            $$infa_env=PROD

             

            $$filename=$$filename_$$infa_env

            $$filename_DEV=\\infa\myshare\testfile.txt

            $$filename_PROD=\\marketing\dataIntegrators\important_list_of_customer_ids.csv

             

            That way you can change many sets of variable values in one big config file in one step during deployment...

             

            Yours

             

            Lars

            • 3. Re: command task command from parameter file
              New Member

              Hi Thanks for the updates,

               

              I'm using Informatica 8.6.1

               

              I have a scenario in my project where there should not be any hardcodes in the workflow, have prepared 3 parameter files for dev, qa and prod env respectively, while moving the informatica components between environments, i don't want to make the support team to do modifications on any of the informatica objects, instead i want to give the appropriate parameter file for the env,

               

              i have a command task in my workflow in which a shell script is called now the script is called in the following way,

               

              sh 'xxxDEV/yyy/test.sh'

               

              now when the workflow is moved to QA and PROD,

              after migration the team has to manually modify the above command to the following

               

              sh 'xxxQA/yyy/test.sh'

              and

              sh ''xxxPROD/yyy/test.sh'

              respectively,

               

              to avoind this i'm writing 3 parameter file which holds the following lines in corrsponding files

               

              DEV parameter file:

              $$call_script=sh 'xxxDEV/yyy/test.sh'

               

              QA parameter file:

              $$call_script=sh 'xxxQA/yyy/test.sh'

               

              PROD parameter file:

              $$call_script=sh 'xxxPROD/yyy/test.sh'

               

              and i'm assigning the value of workflow command task's command1 as $$call_script

               

              when i tried running the WF, it's showing the following error,

               

              err-32512 : execution of command is did not completed successfully,

               

              i've check all the WF configs also, all are fine.

               

              Please guide me on this.

              • 4. Re: command task command from parameter file
                New Member

                Hi Thanks for the updates,

                 

                I'm using Informatica 8.6.1

                 

                I  have a scenario in my project where there should not be any hardcodes  in the workflow, have prepared 3 parameter files for dev, qa and prod  env respectively, while moving the informatica components between  environments, i don't want to make the support team to do modifications  on any of the informatica objects, instead i want to give the  appropriate parameter file for the env,

                 

                i have a command task in my workflow in which a shell script is called now the script is called in the following way,

                 

                sh 'xxxDEV/yyy/test.sh'

                 

                now when the workflow is moved to QA and PROD,

                after migration the team has to manually modify the above command to the following

                 

                sh 'xxxQA/yyy/test.sh'

                and

                sh ''xxxPROD/yyy/test.sh'

                respectively,

                 

                to avoind this i'm writing 3 parameter file which holds the following lines in corrsponding files

                 

                DEV parameter file:

                $$call_script=sh 'xxxDEV/yyy/test.sh'

                 

                QA parameter file:

                $$call_script=sh 'xxxQA/yyy/test.sh'

                 

                PROD parameter file:

                $$call_script=sh 'xxxPROD/yyy/test.sh'

                 

                and i'm assigning the value of workflow command task's command1 as $$call_script

                 

                when i tried running the WF, it's showing the following error,

                 

                err-32512 : execution of command is did not completed successfully,

                 

                i've check all the WF configs also, all are fine.

                 

                Please guide me on this.

                • 5. Re: command task command from parameter file
                  Veeru B Guru

                  Hi Harish,

                   

                  In work flow log what is the error you are getting?

                   

                  If possible please provide log information.

                   

                  Regards,

                  Veeru

                  • 6. Re: command task command from parameter file
                    New Member

                    Workflow Log

                     

                    Severity    Timestamp    Node    Thread    Message Code    Message

                    INFO    2/22/2012 3:30:25 PM    NODE_CINOHIFAPD01SEC    1419905376    LM_36620    Command task instance [archive_command]: running command [Archive data], with command value [sh -c "$$archivedata"].

                    INFO    2/22/2012 3:30:27 PM    NODE_CINOHIFAPD01SEC    1377945952    LM_36621    Command task instance [archive_command]: started command [Archive data], with pid [20021] on node [NODE_CINOHIFAPD01SEC].

                    WARNING    2/22/2012 3:30:29 PM    NODE_CINOHIFAPD01SEC    1419905376    LM_36626    Command task instance [archive_command]: previous command [Archive data] failed and "run if previous command succeeded" option is set, the remaining commands will not be run.

                    ERROR    2/22/2012 3:30:29 PM    NODE_CINOHIFAPD01SEC    1419905376    LM_36623    Command task instance [archive_command]: execution of command [Archive data] did not complete successfully with exit code [32512]

                    ERROR    2/22/2012 3:30:29 PM    NODE_CINOHIFAPD01SEC    1419905376    LM_36320    Command task instance [archive_command]: Execution failed.

                     

                    command task.JPG

                     

                    Parameter file is

                     

                    parameter file.JPG

                    • 7. Re: command task command from parameter file
                      Veeru B Guru

                      HI Harish,

                       

                      Have defined $$archivedata parameter in work flow variables?

                       

                      if you see work flow log its trying to execute $$archivedata this value instead of actual script.

                       

                      Regards,

                      Veeru

                      • 8. Re: command task command from parameter file
                        New Member

                        after i assigned WF parameter now, it shows different error

                         

                        Severity    Timestamp    Node    Thread    Message Code    Message

                        INFO    2/22/2012 6:08:27 PM    NODE_CINOHIFAPD01SEC    1419905376    LM_36620    Command task instance [archive_command]: running command [Archive data], with command value [sh -c "sh /<<maskeddirname>>/test.sh done"].

                        INFO    2/22/2012 6:08:28 PM    NODE_CINOHIFAPD01SEC    1409415520    LM_36621    Command task instance [archive_command]: started command [Archive data], with pid [9824] on node [NODE_CINOHIFAPD01SEC].

                        ERROR    2/22/2012 6:08:30 PM    NODE_CINOHIFAPD01SEC    1398925664    LM_36623    Command task instance [archive_command]: execution of command [Archive data] did not complete successfully with exit code [256]

                        WARNING    2/22/2012 6:08:30 PM    NODE_CINOHIFAPD01SEC    1398925664    LM_36626    Command task instance [archive_command]: previous command [Archive data] failed and "run if previous command succeeded" option is set, the remaining commands will not be run.

                        ERROR    2/22/2012 6:08:30 PM    NODE_CINOHIFAPD01SEC    1398925664    LM_36320    Command task instance [archive_command]: Execution failed.

                         

                         

                        when i executed the following command mannually in UNIX

                        sh -c "sh /<<maskeddirname>>/test.sh done"

                        it works fine, but from informatica its not working but the substitution happened for the variable.

                        • 9. Re: command task command from parameter file
                          Veeru B Guru

                          Hi Harish,

                           

                          seems like there is some permissions issue. have you given all permissions on script to informatica user?

                           

                          Regards,

                          Veeru

                          • 10. Re: command task command from parameter file
                            New Member

                            I cross verified now the folder under which the script is precent and the script file both are given with 777 permission ,

                             

                            evenif its showing the error.

                            • 11. Re: command task command from parameter file
                              Veeru B Guru

                              Hi Harish,

                               

                              Do this. redirect script out put to some log file and check what is the error you are getting in log file.

                               

                              sh -c "sh /<<maskeddirname>>/test.sh done > <<maskeddirname>>/test.log

                               

                              Regards,

                              Veeru

                              • 12. Re: command task command from parameter file
                                New Member

                                the log file is getting created but only empty file evenif i run the script manually also the log file is not at all having anything inside it.

                                 

                                the script is a test scripts i'm just copying the same file into a different name,

                                 

                                the script is

                                 

                                process=$1

                                if [ "$process" == "done" ];

                                then

                                cp test.sh test_success.sh

                                fi

                                 

                                "done" is just a parameter to ensure that we can pass a parameter.

                                i removed the file

                                test_success.sh

                                 

                                and starting the workflow,

                                the substitution is happening but it fails,

                                the file "test.sh" and the folder holds the file are given with 777 permission.

                                 

                                evenif its not executing the script.

                                • 13. command task command from parameter file
                                  Guru

                                  Have an try with mentioning the full path in the place of actual script

                                  (instead of masking it)

                                  • 14. command task command from parameter file
                                    Veeru B Guru

                                    Hi Harish,

                                     

                                    in script put some echo statements for each command and teh execute.

                                     

                                    Regards,

                                    Veeru

                                    1 2 Previous Next