Hi Affan,
You have to pass or set an value to %1 in your c program. Comand Stage has no idea what's %1.
For example the following is the content of my .bat file:
SET user=%1
SET pswd=%2
SET sid=%3
SET sp_home="c:\oracle\ora92\bin"
cd %sp_home%
call %sp_home%\sqlplus %user%/%pswd%@%sid% @c:\exestp.sql
exit
then you call this .bat file from your Command Stage and the value of the paramater for %1, user, will be passed into the %user% of the .bat file.
Hopefully, this gives you an idea.
ACtually my C pogram accepts no param, strange enough but i have solved the problem by adding the path of the C program into SHELL SEARCH PATH. i have no clue why i did that can anyone please explain this to me that whats the significance of this ENV variable and why did my command stage worked after adding the path into this variable.
Not strange at all - you should make no assumptions about the environment your commands run under when launched from a DataStage job. The fact that the command works under the same user from the command line is fairly meaningless. Other than to know it actually works that is.
If you had posted the requested information, it should have been obvious what the issue was: you didn't explicitly path this executable. Meaning, you put something like "thecommand" in the box when you should have put "C:\thepath\thecommand" instead. That would explain why adding the path it could be found in to that environment variable solved your problem.
-craig
"You can never have too many knives" -- Logan Nine Fingers
Probably because your program has logic that uses the PATH, just like writing a shell script that requires execution from without a specific directory can't be run from outside that directory, even with fully qualifying the command line when executing the script.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle