Unziping file from Windows environment

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Lucky
Participant
Posts: 31
Joined: Mon Oct 10, 2005 11:05 pm

Post 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.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
Lucky
Participant
Posts: 31
Joined: Mon Oct 10, 2005 11:05 pm

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
Lucky
Participant
Posts: 31
Joined: Mon Oct 10, 2005 11:05 pm

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Lucky
Participant
Posts: 31
Joined: Mon Oct 10, 2005 11:05 pm

Post by Lucky »

It is not prompting anything when i run from command line and working fine

Regards,
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
Lucky
Participant
Posts: 31
Joined: Mon Oct 10, 2005 11:05 pm

Post 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,
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You might also investigate using the START command in DOS for running your command.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply