Page 1 of 1

Command stage output

Posted: Tue Apr 11, 2017 1:43 pm
by k.prashanthi
Hello,

I have the below command in the execute command stage:

Code: Select all

c:\windows\system32\find /c "," D:\IBM\Data\Files\WorkingData\Proj\File.txt
When I have tried the same command in the server's command prompt it was returning the correct output value but when I run the datastage job,it is not returning any output.

Code: Select all

CopyOfCopyOfCopyOfCopyOfCopyOfCopyOfSeq_RoutesheetTotalMiles2..JobControl (@Execute_Command_16): Executed: c:\windows\system32\find /c "," D:\IBM\Data\Files\WorkingData\Proj\File.txt
Reply=1
Output from command ====>

I appreciate your help on this. TIA!

Posted: Tue Apr 11, 2017 3:39 pm
by chulett
Both times executed by the same user?

Posted: Wed Apr 12, 2017 8:10 am
by k.prashanthi
Yes! Executed by the same user both times.

Posted: Wed Apr 12, 2017 8:48 am
by PaulVL
Default path will be different. (CWD)
Environment variables will be different ($PATH, LIB, etc...)

Add debug statements to echo that stuff out.

Does your environment do credential mapping? (yes you indicated that you ran the job with the same ID, but ... never hurts to double check.) Look in the director log to see which ID ran the job.

Does it work for someone else?

Did that file exist at the time of job execution?

Is "D" drive mapped in the engine environment?

Posted: Thu Apr 13, 2017 9:02 am
by k.prashanthi
Paul, All the above were verified and looks good, not sure why this command stage is not returning output.

Posted: Mon Apr 17, 2017 1:21 pm
by k.prashanthi
Any other ideas on this issue?

Posted: Mon Apr 17, 2017 3:39 pm
by Mike
Since you seem to be out of ideas...

I wouldn't be running Windows commands even on a Windows installation. Take advantage of the MKS toolkit and run a unix-style find command inside a unix shell.

Mike

Posted: Tue Apr 18, 2017 10:34 am
by UCDI
can you do anything else like

dir filename

with the same setup?