Page 2 of 2

Posted: Wed Sep 27, 2006 1:35 am
by Lucky
Hi,

I have the compatible command line support installed on the machine and as I have already mentioned, the command works when executed from the command prompt.

But I am not successfull in doing the same from DS.

Posted: Wed Sep 27, 2006 2:54 am
by ArndW
I missed that, sorry. You will need to specify absolute pathnames for all objects, since the cwd from inside datastage is that of the project unless you explicitly change it in the command. I would look in your project directory on DOS and I'm certain you'll find the uncompressed objects.

Posted: Wed Sep 27, 2006 10:27 pm
by Lucky
Hi ArndW, Ray , DSGuru2B
Thanks for u r responses,
I think i m giving complete path in the command, will u pl tell me where i have to give paths other than d:\progra~1\winzip\ , c:\ in "d:\progra~1\winzip\winzip32.exe -min -e c:\File_Name.zip c:\ |dir


Regards

Posted: Thu Sep 28, 2006 2:01 am
by ArndW
Have you tried doing a search on Windows drives c:\ and d:\ for the missing files just to make sure that they were not extracted elsewhere? Also, try creating a file "C:\test.txt" and instead of issuing the WinZip from DS try just an ExecDOS of "move test.txt done.txt" to see if this is executed.

Posted: Thu Sep 28, 2006 2:37 am
by Lucky
Hi ArndW ,

I have searched c:\ and d:\ ,files are not extracted any where else,
And I m able to do copying file form one location to another location using ExecDOS from Before job subroutine
and also using the command "d:\progra~1\winzip\winzip32.exe -min -e c:\File_Name.zip c:\ |dir" from command line i m able to Unzipping the files, but if i m using the same command from the DS Job before job subroutine, DS job is just hanging and if kill Winzip32.exe process from task bar then i m getting the error message

Test11..BeforeJob (ExecDOS): Error when executing command: d:\progra~1\winzip\winzip32.exe -min -e
*** No output from command ***


Appriciate for u r resonse.

Regards

Posted: Thu Sep 28, 2006 3:01 am
by chulett
When it works for you from the command line, does it prompt you for anything, a question you need to answer perhaps? That is the typical cause of a 'hang' like this as there's no-one there to answer it when run from a job.

If so, look to see if there are any additional command line options to override or automatically answer the question.

Posted: Thu Sep 28, 2006 3:40 am
by Lucky
It is not prompting anything when i run from command line and working fine

Regards,

Posted: Thu Sep 28, 2006 3:45 am
by ArndW
Lucky,

in your case note that the DS job is not hanging, it is just waiting for your WinZip to return control to it; so actually WinZip is hanging. In 99 out of a 100 cases this is because it has issued some command and is waiting for input, as Craig has already suggested. Could it be that the output file/directory is already there {because you tested it by hand} and it is asking whether or not you want to overwrite the file(s)? If this is the case since the DS job is a background process it cannot respond to that question and will wait forever.

Posted: Thu Sep 28, 2006 4:30 am
by Lucky
Thanks Craig and ArndW,

I m sure that there is no existing files in the directory, also i have corss checked and there is no file with that name to ask for replacing the existing file.


Regards,

Posted: Thu Sep 28, 2006 6:31 am
by ArndW
Try writing your own routine as follows:

Code: Select all

Command = "d:\progra~1\winzip\winzip32.exe -min -e c:\File_Name.zip c:\"
EXECUTE 'SH -c "':Command:'"' CAPTURING Ans RETURNING ErrorCode
Ans = 'Error Code "':ErrorCode:'", Output "':Ans:'".'
Compile and run - if the routine returns then you must be doing something different in your job. If the routine execution "hangs" then enter the TCL and do a PORT.STATUS command to ensure that a process is indeed executing your WinZip32.exe program. Check the most recent file in the &PH& subdirectory of the project and see if there is any text in there.

Now that I think about it, you could just enter TCL and execute the SH -C "d:\...." command and see if it prompts you for something - this is better than writing a routine to do the same thing.

Posted: Thu Sep 28, 2006 3:27 pm
by ray.wurlod
You might also investigate using the START command in DOS for running your command.