Page 1 of 1

Batch script running trouble from Datastage

Posted: Tue Dec 02, 2014 3:41 pm
by sam334
All,
I have a windows batch script which sftp a file. Now manually I am able to send the file but when used the script in After Job Subroutine, the job hangs. Basically it is not working while executing it from Datastage after job sub routine. Is that an issue Admin should handle? Any other option to run the script in datastage.

Thanks.

Sam.

Posted: Tue Dec 02, 2014 3:56 pm
by ray.wurlod
Stick some echo commands into the script to see how far it actually gets.

For example, some variants of FTP do not allow the entry of the password to be subjected to redirection.

Posted: Tue Dec 02, 2014 4:18 pm
by chulett
When you run the script manually, does it stop and ask you any questions? That would be a typical reason for a 'hang' when automating it as there's no-one there the answer the question.

Posted: Tue Dec 02, 2014 4:19 pm
by sam334
Ok.Thanks Ray. But if this is the issue then when I run it manually it should not be working right. It works perfectly. Only issue is running from DS

Posted: Tue Dec 02, 2014 4:20 pm
by sam334
Craig,
Nope.. It simply sends the file and we get the transmission successful email.

Posted: Tue Dec 02, 2014 4:42 pm
by chulett
To Ray's point, some processes know when they are running in "interactive mode" - manually from the command line - and when they are running under automation and can behave differently from one mode to the other. Put in some breadcrumbs so you can see how far you get and then hopefully know exactly where it is when it hangs.

Posted: Wed Dec 03, 2014 8:22 am
by priyadarshikunal
Also, try to put absolute paths in the script as scheduled ones may not utilize the environment variables you may have defined for your user when running from DataStage. Did you put "echo"s in you script to find out which statement its getting stuck at?

Posted: Thu Dec 04, 2014 10:31 am
by sam334
Thanks for all the help. Found the issue, it was in VB script email sent commands. There was a space and believe datastage was executing differently than in manual execution.

Thanks.