Batch script running trouble from Datastage

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
sam334
Premium Member
Premium Member
Posts: 145
Joined: Mon Aug 26, 2013 7:42 pm

Batch script running trouble from Datastage

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sam334
Premium Member
Premium Member
Posts: 145
Joined: Mon Aug 26, 2013 7:42 pm

Post 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
sam334
Premium Member
Premium Member
Posts: 145
Joined: Mon Aug 26, 2013 7:42 pm

Post by sam334 »

Craig,
Nope.. It simply sends the file and we get the transmission successful email.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post 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?
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
sam334
Premium Member
Premium Member
Posts: 145
Joined: Mon Aug 26, 2013 7:42 pm

Post 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.
Post Reply