Problem running a .bat file from Command Stage

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
danddmrs
Premium Member
Premium Member
Posts: 86
Joined: Fri Apr 20, 2007 12:55 pm

Problem running a .bat file from Command Stage

Post by danddmrs »

Any reason this line would work in a .bat file executed from Windows Explorer but fails when executing the .bat file from the Execute Command stage?

IF %length% == 0 GOTO NOMSG

DataStage Event Detail:
Reply=255
Output from command ====>
GOTO was unexpected at this time.

Thanks!
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Re: Problem running a .bat file from Command Stage

Post by SURA »

Is it executing when you executed from dos prompt?

Code: Select all

IF %length% == 0 GOTO NOMSG 
space might be the reason i guess!

IF %length%==0 GOTO NOMSG


DS User
danddmrs
Premium Member
Premium Member
Posts: 86
Joined: Fri Apr 20, 2007 12:55 pm

Post by danddmrs »

The .bat file does execute successfully from DOS prompt, removing the spaces did not change the result. Thanks!
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

Post some details, like the values from the fields in the Execute Command stage, and the contents of the .bat file, the path, and file name.
Choose a job you love, and you will never have to work a day in your life. - Confucius
danddmrs
Premium Member
Premium Member
Posts: 86
Joined: Fri Apr 20, 2007 12:55 pm

Post by danddmrs »

Was going to use this to detect records in a file. Converted the file into a reject, triggered a notification stage to send the file, used a sequencer with ANY option to continue process.
Post Reply