Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [CASE-OPENED] Command Task in Iway Data Migrator
Go
New
Search
Notify
Tools
Reply
  
[CASE-OPENED] Command Task in Iway Data Migrator
 Login/Join
 
Member
posted
Hi All,

I need to invoke a batch script from Iway Data Migrator Process flow. How can I achieve this? Kindly help me with your suggestions.

Thanks,
Balaji

This message has been edited. Last edited by: <Kathryn Henning>,
 
Posts: 11 | Registered: November 06, 2013Reply With QuoteReport This Post
Member
posted Hide Post
I have done this by creating a WF stored procedure (.fex) with the following code,
This sample code passes one variable to the .bat script. The script needs to be in
the location path specified in the call command.

-TYPE **************************************************************************
-TYPE CSV FILE NAME: &CSV_FILE
-DOS CALL "e:\ibi\apps\lps_ch_upload\TRANSFER_FILES\ZipCSV.bat" &CSV_FILE E:\ibi\apps\lps_ch_upload\TRANSFER_FILES, E:\ibi\apps\lps_ch_upload\TRANSFER_FILES;
-RUN
-TYPE END OF JOB
-TYPE **************************************************************************


I then create a Data Migrator FLOW that calls this WF stored proc (that way
the results go to the ETLLOG, which includes any PRINT statements from the .bat script).
The FLOW that calls it will pass in the desired csv_file value.

If you don't have a parameter in your .bat file, just leave it off the call command;
or, if you have multiple parameters, just list them all at the end of the call command
(in the expected order by the .bat script, there are NO commas between parm values).

Hope this helps.
 
Posts: 8 | Registered: May 24, 2012Reply With QuoteReport This Post
Member
posted Hide Post
Hi Sharon,

This is the code I have used in my procedure

-TYPE

-DOS CALL "C:\Users\bnagaraj\Desktop\xyz.bat"


-RUN


- TYPE END OF JOB

And this is the content of my xyz.bat file
echo Test write >> xyzwrite.txt


When I run this in a process flow I am getting the message mentioned below.

DEP_0: procedure command_test_proc started.
C:\ibi\DEVSTU~1\srv77\wfs\edatemp\ts000011>echo Test write 1>>xyzwrite.txt
END OF JOB
(ICM18039) DEP_0 command_test_proc Return Code = 0

My procedure executed successfully and the batch file is invoked.
But the file xyzwrite.txt is not created in the directory where xyz.bat is located.

I tried this too. But it didnt work.
-RUN
DOS C:\Users\bnagaraj\Desktop\xyz.bat
-RUN
-END


Please tell me what is the problem here.

Thanks

Balaji
 
Posts: 11 | Registered: November 06, 2013Reply With QuoteReport This Post
Guru
posted Hide Post
If you don't specify a directory in your output redirection the file will be written to the current directory. In the case of an agent running on our server that's a temporary directory.

Try putting the following command at the end of your focexec and you should see your file name in the log.
!dir

However temporary directories (such as ts000011) are (by default) automatically deleted when the flow completes. That's so that another flow that uses the same agent (and thus directory) wouldn't find files left behind.

Try writing your file out to a more permanent location.

This message has been edited. Last edited by: Clif,
 
Posts: 384 | Location: New York City | Registered: May 03, 2007Reply With QuoteReport This Post
Member
posted Hide Post
Clif,

I tried using !dir command at the end.
But when I run it, I am getting the same message.
And my batch file is not in the temp folder.It is located in the C:\Users\Username\Desktop directory. So it will create a file named xyzwrite.txt in the same directory . It is working fine when I run the batch file from cmd.
But I am getting this message when I invoke the batch script from procedure.
 
Posts: 11 | Registered: November 06, 2013Reply With QuoteReport This Post
Guru
posted Hide Post
Please open a case with hotline; they will be better able to assist you.
 
Posts: 384 | Location: New York City | Registered: May 03, 2007Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [CASE-OPENED] Command Task in Iway Data Migrator

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.