0 Replies Latest reply: May 15, 2014 10:10 AM by rvelez RSS

    Script PreProcess

    rvelez

      I reviewed most of the thread regarding this and nothing seems to help me with this process.

       

      Here is what I am trying to do on Monarch Pro 9.   I am trying to setup a DataPump process to run that will first grab a file automatically from an SFTP site, then process it accordingly.   I tried multiple ways of doing this.  I create a dos batch script, running the FTP executable with a file that has the parm, and just straight string of commands.   All had the same results.

       

      I use WINSCP to connect and retrieve files from an SFTP site.   The command I use in DOS that works is:

      winscp.exe /console /command "option batch on" "open "user: password@ftp.site.com" "cd OUTBOUND" "get text_file.txt c:\reports\" "exit"      This works fine.

       

      I copied the above script to the DataPump process under Scripts->PreProcess:

      In the COMMAND field:  winscp.exe

      In the Parameter field:  /console /command "option batch on" "open "user: password@ftp.site.com" "cd OUTBOUND" "get text_file.txt c:\reports\" "exit"

       

      This is what it looks like after I update:

       

      -

      Shell("""winscp.exe"""" "Log.ExpandMacros("/console /command ""option batch on"" ""open ""user: password@ftp.site.com"" ""cd OUTBOUND"" ""get text_file.txt c:\reports\"" ""exit"""),AppWinStyle.Hide,True)</preprocess>

        </script>

       

       

      It compiles successfully.    When I run the process, i get the following message.

       

      Date/Time Event Description

       

      - 05-11-2011 13:53:25 Created.

      time  2011-05-11T13:53:25

       

      - 05-11-2011 13:53:25 In PreProcess

      time  2011-05-11T13:53:25

       

      - 05-11-2011 13:53:26 Process prerequisites were not met: File 'C:\reports\text_file.txt' does not exist.

      time  2011-05-11T13:53:26

       

      - 05-11-2011 13:53:26 Failed: DwchServer.NoRetryInfoException: Process prerequisites failed, but no retry information is available. Process will not be retried. ---> DwchServer.SpecifiedFileDoesNotExistPrerequisiteException: File 'C:\reports\text_file.txt' does not exist. at DwchServer.ProjectInputs.TestPrerequisites() at DwchServer.ProcessHandler.b(ServerDB A_0, JobRow A_1, JobLog A_2) --- End of inner exception stack trace --- at DwchServer.ProcessHandler.b(ServerDB A_0, JobRow A_1, JobLog A_2)

      time  2011-05-11T13:53:26

      alert  SystemAlertProcessFailed

       

      - 05-11-2011 13:53:26 Distribution started

      time  2011-05-11T13:53:26

      source  distributor

       

      - 05-11-2011 13:53:26 Distribution completed

      time  2011-05-11T13:53:26

      source  distributor

      value  complete

       

       

      Now, when I use the Prerequisites tab when editing a project, then add a Cmd as:

      winscp.exe /console /command "option batch on" "open "user: password@ftp.site.com" "cd OUTBOUND" "get text_file.txt c:\reports\" "exit"

       

       

      I get this error:

       

      Date/Time Event Description

       

      - 05-11-2011 14:00:32 Created.

      time  2011-05-11T14:00:32

       

      - 05-11-2011 14:00:33 Process prerequisites were not met: External process returned failure code 1.

      time  2011-05-11T14:00:33

       

       

      - 05-11-2011 14:00:33 Failed: DwchServer.NoRetryInfoException: Process prerequisites failed, but no retry information is available. Process will not be retried. ---> DwchServer.CmdLineFailureCodePrerequisiteException: External process returned failure code 1. at DwchServer.CmdLinePrerequisite.Test() at DwchServer.CmdLinePrerequisite.Test(String strProcessName) at DwchServer.ProjectInputs.TestPrerequisites() at DwchServer.ProcessHandler.b(ServerDB A_0, JobRow A_1, JobLog A_2) --- End of inner exception stack trace --- at DwchServer.ProcessHandler.b(ServerDB A_0, JobRow A_1, JobLog A_2)

      time  2011-05-11T14:00:33

      alert  SystemAlertProcessFailed

       

       

      - 05-11-2011 14:00:33 Distribution started

      time  2011-05-11T14:00:33

      source  distributor

       

       

      - 05-11-2011 14:00:34 Distribution completed

      time  2011-05-11T14:00:34

      source  distributor

      value  complete

       

       

      Now in this scenerio, when I click on the Test button for this script, it works fine and the file is retrieved from the FTP site.  

       

      Thanks for any help you can send my way.