DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
Author Message
Lucky
Participant



Joined: 10 Oct 2005
Posts: 31

Points: 296

Post Posted: Mon Sep 25, 2006 8:10 pm Reply with quote    Back to top    

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

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 15 Jan 2003
Posts: 5209
Location: Lutz, FL
Points: 39179

Post Posted: Mon Sep 25, 2006 8:22 pm Reply with quote    Back to top    

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
Rate this response:  
Not yet rated
DSguru2B

Premium Poster


since February 2006

Group memberships:
Premium Members, Heartland Usergroup

Joined: 09 Feb 2005
Posts: 6690
Location: Houston, TX
Points: 34892

Post Posted: Mon Sep 25, 2006 9:40 pm Reply with quote    Back to top    

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.
Rate this response:  
Not yet rated
Lucky
Participant



Joined: 10 Oct 2005
Posts: 31

Points: 296

Post Posted: Mon Sep 25, 2006 11:16 pm Reply with quote    Back to top    

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
Rate this response:  
Not yet rated
ray.wurlod

Premium Poster
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

Post Posted: Mon Sep 25, 2006 11:23 pm Reply with quote    Back to top    

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
Rate this response:  
Not yet rated
Kirtikumar
Participant



Joined: 15 Oct 2004
Posts: 378
Location: Pune, India
Points: 3027

Post Posted: Tue Sep 26, 2006 12:37 am Reply with quote    Back to top    

Wanted to know one thing - Can it be done using command filters available in seq file stage?

_________________
Regards,
S. Kirtikumar.
Rate this response:  
Not yet rated
Lucky
Participant



Joined: 10 Oct 2005
Posts: 31

Points: 296

Post Posted: Tue Sep 26, 2006 2:54 am Reply with quote    Back to top    

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
Rate this response:  
Not yet rated
ArndW

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup

Joined: 16 Nov 2004
Posts: 14022
Location: Germany
Points: 79230

Post Posted: Tue Sep 26, 2006 2:57 am Reply with quote    Back to top    

What happens if you force some output, i.e. add "| dir" to your command line?

_________________
Image
Rate this response:  
Not yet rated
Lucky
Participant



Joined: 10 Oct 2005
Posts: 31

Points: 296

Post Posted: Tue Sep 26, 2006 3:21 am Reply with quote    Back to top    

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
Rate this response:  
Not yet rated
ArndW

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup

Joined: 16 Nov 2004
Posts: 14022
Location: Germany
Points: 79230

Post Posted: Tue Sep 26, 2006 3:27 am Reply with quote    Back to top    

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"

_________________
Image
Rate this response:  
ray.wurlod

Premium Poster
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

Post Posted: Tue Sep 26, 2006 6:41 am Reply with quote    Back to top    

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
Rate this response:  
Not yet rated
DSguru2B

Premium Poster


since February 2006

Group memberships:
Premium Members, Heartland Usergroup

Joined: 09 Feb 2005
Posts: 6690
Location: Houston, TX
Points: 34892

Post Posted: Tue Sep 26, 2006 12:32 pm Reply with quote    Back to top    

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.
Rate this response:  
Not yet rated
Lucky
Participant



Joined: 10 Oct 2005
Posts: 31

Points: 296

Post Posted: Tue Sep 26, 2006 8:45 pm Reply with quote    Back to top    

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????
Rate this response:  
Not yet rated
Lucky
Participant



Joined: 10 Oct 2005
Posts: 31

Points: 296

Post Posted: Wed Sep 27, 2006 12:44 am Reply with quote    Back to top    

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...
Rate this response:  
Not yet rated
ArndW

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup

Joined: 16 Nov 2004
Posts: 14022
Location: Germany
Points: 79230

Post Posted: Wed Sep 27, 2006 1:21 am Reply with quote    Back to top    

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?

_________________
Image
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours