| Author |
Message |
Lucky
Participant
Joined: 10 Oct 2005
Posts: 31
Points: 296
|
|
| DataStage® Release: 7x |
| Job Type: Server |
| OS: Windows |
|
Hi Gurus,
I want to Unzip files which are in specified directory using routine or someother way (and once Unzipping is done next job will extract those files). If anyone have idea about on this pl guide me.
Both DataStage client and Server are installed in Windows environment.
Kind Regards
Luk
|
|
|
|
|
 |
kcbland
Participant
Group memberships: Premium Members, Inner Circle, Server to Parallel Transition Group
Joined: 15 Jan 2003
Posts: 5209
Location: Lutz, FL
Points: 39179
|
|
|
|
|
|
|
Try before/after routine call to ExecDOS and use the zip/unzip command line program. Or, use a Command stage in a Sequence.
|
_________________ 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 |
|
|
|
 |
DSguru2B
 since February 2006
Group memberships: Premium Members, Heartland Usergroup
Joined: 09 Feb 2005
Posts: 6690
Location: Houston, TX
Points: 34892
|
|
|
|
|
|
|
You can also use the routine activity stage in a sequence job to call the custom routine that unzips the files. This way you can control the execution incase the unzipping is unsuccessful.
|
_________________
Early, is on time,
On time, is late,
Late is unacceptable.
|
|
|
|
 |
Lucky
Participant
Joined: 10 Oct 2005
Posts: 31
Points: 296
|
|
|
|
|
|
Thanks Kenneth Bland AND DSguru2B for the response,
DSguru2B will u pl help me in how can i Zip/Unzip files through routine.
Thanks in Advance
|
|
|
|
|
 |
ray.wurlod
Participant
Group memberships: Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group
Joined: 23 Oct 2002
Posts: 41076
Location: Canberra, Australia
Points: 228937
|
|
|
|
|
|
|
Don't even attempt it. It's an additional and unnecessary layer because, in the routine, you'd be invoking the appropriate operating system command (via DSExecute()).
Use an Execute Command acti ...
|
_________________ Zenith Solutions (Australia) Pty Ltd
-- from obscurity to
clarity
|
|
|
|
 |
Kirtikumar
Participant
Joined: 15 Oct 2004
Posts: 378
Location: Pune, India
Points: 3027
|
|
|
|
|
|
|
Wanted to know one thing - Can it be done using command filters available in seq file stage?
|
_________________ Regards,
S. Kirtikumar. |
|
|
|
 |
Lucky
Participant
Joined: 10 Oct 2005
Posts: 31
Points: 296
|
|
|
|
|
|
Hi Ray,
Thanks for the response.....
I m executing following command to Unzip files from Before job subroutine
d:\progra~1\winzip\winzip32.exe -min -e c:\File_Name.zip c:\
Here c:\ is my source file path and i want to keep the unzipped file in the same path itself .
When i execute above command, i m getting the following error message (From director)
Test11..BeforeJob (ExecDOS): Error when executing command: d:\progra~1\winzip\winzip32.exe -min -e
*** No output from command ***
Job stopped - before-job routine returned error: Error 1 returned from BEFORE routine DSU.ExecDOS
Can anyone tell me is there anything wrong in my command....and Pl correct me
Thanks in Advance
Regards
Luk
|
|
|
|
|
 |
ArndW
Participant
Group memberships: Premium Members, Inner Circle, Australia Usergroup
Joined: 16 Nov 2004
Posts: 14022
Location: Germany
Points: 79230
|
|
|
|
|
|
|
What happens if you force some output, i.e. add "| dir" to your command line?
|
_________________
|
|
|
|
 |
Lucky
Participant
Joined: 10 Oct 2005
Posts: 31
Points: 296
|
|
|
|
|
|
Hi ArndW ,
I did't get exactly ,
i.e. add "| dir" to your command line?
If possible If possible Will u pl explain me ..
Regards
Luk
|
|
|
|
|
 |
ArndW
Participant
Group memberships: Premium Members, Inner Circle, Australia Usergroup
Joined: 16 Nov 2004
Posts: 14022
Location: Germany
Points: 79230
|
|
|
|
|
|
|
Currently your DOS command is "d:\progra~1\winzip\winzip32.exe -min -e c:\File_Name.zip c:\ ", I wanted to have this command force some sort of text into the buffer, so I wondered what would happen if you changed that to "d:\progra~1\winzip\winzip32.exe -min -e c:\File_Name.zip c:\ | dir"
|
_________________
|
|
|
|
 |
ray.wurlod
Participant
Group memberships: Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group
Joined: 23 Oct 2002
Posts: 41076
Location: Canberra, Australia
Points: 228937
|
|
|
|
|
|
|
Examine the source code for ExecDOS. It requires that there be some output from the command. Arnd's suggestion, of adding a
dir
command, forces there to be some output. A
hostname
command o ...
|
_________________ Zenith Solutions (Australia) Pty Ltd
-- from obscurity to
clarity
|
|
|
|
 |
DSguru2B
 since February 2006
Group memberships: Premium Members, Heartland Usergroup
Joined: 09 Feb 2005
Posts: 6690
Location: Houston, TX
Points: 34892
|
|
|
|
|
|
I was under the impression that multiple files need to be unzipped and hence i advised to go for a routine where a substantial amount of error handling can be coded. But if the unzipping is for a single file then yes, no need for a routine.
Regards,
|
_________________
Early, is on time,
On time, is late,
Late is unacceptable.
|
|
|
|
 |
Lucky
Participant
Joined: 10 Oct 2005
Posts: 31
Points: 296
|
|
|
|
|
|
After appending " | dir " to the command "d:\progra~1\winzip\winzip32.exe -min -e c:\File_Name.zip c:\", the problem still remains.
As I understand, the command "d:\progra~1\winzip\winzip32.exe -min -e c:\File_Name.zip c:\ |dir" actually opens the winzip32.exe but the unzipping process is not happening.
When I killed the WINZIP32.exe process in Task Manager, the process returned CODE = 0 which means the command has unzipped the file.
But actually the unzipping process has never really happened.
A simple command like copy works fine but when I tried to execute unzip, postie commands via DS, the routine simply hangs...
Any idea if I am missing out on something????
|
|
|
|
|
 |
Lucky
Participant
Joined: 10 Oct 2005
Posts: 31
Points: 296
|
|
|
|
|
|
Hello All,
Any idea about this problem???
We are using
DataStage version 7.1,
O/S: Windows 2000,
WinZIP version: 9.0 with command line support.
If anyone has ever tried this one, please let me know how to go about this problem.
I have tried all the options
1. Calling ExecDOS in before Job Routine by passing the command as the input value
2. Using the Execute command stage in a sequence job
3. Passing the command as parameter to the Filter Command in Sequential File Stage after checking the option "Stage uses filter commands"
But none of them worked for me...
|
|
|
|
|
 |
ArndW
Participant
Group memberships: Premium Members, Inner Circle, Australia Usergroup
Joined: 16 Nov 2004
Posts: 14022
Location: Germany
Points: 79230
|
|
|
|
|
|
If I recall my WinZip correctly, you cannot use the normal executable from the command line but need to download the command-line version of the code (available on their website); I've used that from DOS before with no problems but can't recall what the executable is called, but I don't think that it is WinZip32.exe.
Doesn't it make sense to test the command line version directly to make sure that it works before trying it from inside of DataStage?
|
_________________
|
|
|
|
 |
|
|