Page 1 of 1

Why am I getting an extra double quotes for scheduled job

Posted: Tue Oct 02, 2007 8:16 am
by dang
Windows Server 2003 SP2
Datastage 7.5


In a routine activity sequence I have the following command:
"copy " : Char(34) : SOME_PATH : "\DataIn\REGION.CSV " : Char(34) : " " : Char(34) :BASE_PATH : "\data_in\user\REGION.CSV" : Char(34) : " /Y /V"

I have the job scheduled to start on the first of the month, but the actual job may not be run for a day or two due to processing being done before this job can run. When it comes time for the job to run, it usually fails with the following:

SEQ__GETFILES..JobControl (ExecDOS): Error when executing command: copy ""\\hofs1\corpdata$\COMPANY\XXXX-XXXX\YYYY-YYYY Project"\DataIn\REGION.CSV " "D:\ETLData\ETL_Prod\data_in\user\REGION.CSV" /Y /V
*** Output from command was: ***
The system cannot find the path specified.


When I reset the job and restart it manually, it runs fine:
SEQ__GETFILES..JobControl (ExecDOS): Executed command: copy "\\hofs1\corpdata$\COMPANY\XXXX-XXXX\YYYY-YYYY Project\DataIn\REGION.CSV " "D:\ETLData\ETL_Prod\data_in\user\REGION.CSV" /Y /V
*** Output from command was: ***
1 file(s) copied.

Any idea why the sheduled command has added double quotes after the copy command and after the word Project?


Thanks in advance for your suggestions!!

Re: Why am I getting an extra double quotes for scheduled jo

Posted: Tue Oct 02, 2007 12:23 pm
by DeepakCorning
Are you supplying the file name as a parameter or it is hardcoded in the job?

Posted: Tue Oct 02, 2007 12:56 pm
by dang
The filename is hardcoded "REGION.CSV" The parameters I am passing are SOME_PATH and BASE_PATH

Posted: Tue Oct 02, 2007 3:44 pm
by ArndW
Dang - just as an aside, you can mix quote characters in DataStage, so your command could read:

Code: Select all

'copy "':SOME_PATH:'\DataIn\REGION.CSV" "':BASE_PATH:'\data_in\user\REGION.CSV" /Y /V'
If you use that, does your error remain the same?

Posted: Tue Oct 02, 2007 5:48 pm
by chulett
Ah... was going to point that out when I got a chance. :wink:

Posted: Wed Oct 03, 2007 6:36 am
by dang
Thanks ArndW and chulett. I used that command and it worked fine running manually. Next month will be the test when it runs as a scheduled job. I will mark this as resolved.

Dan