Zip a file

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

basu.ds
Participant
Posts: 118
Joined: Tue Feb 06, 2007 12:59 am
Location: Bangalore

Zip a file

Post by basu.ds »

Hi ,
Can any one help me on how to zip a csv file using datastage .i tried search in the forum but i did not find enough information .my requirement is that i have a file .i have to zip that file by job.

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

Post by ArndW »

You can do it easily from an after-job call. Just do an ExecSH and pass the ZIP command to the command line. If you are using WinZip you will need to download their command line extension.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

In other words, you'll need something executable from the command line of your O/S for DataStage to initiate the zip. The registered version of WinZip has that as an option, other tools exist as well.
-craig

"You can never have too many knives" -- Logan Nine Fingers
basu.ds
Participant
Posts: 118
Joined: Tue Feb 06, 2007 12:59 am
Location: Bangalore

Post by basu.ds »

Thanks a lot for replies ,
I don't have any zip software installed in my windows system.i tried dos command but it is not working

command zip filename.csv
i tried zip filename.zip also
both are not working any idea please help me

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

Post by ArndW »

The first thing you need to do is to get a DOS command working; once that functions you can get it working from DataStage. There are several compression packages available, from the old PKZIP to the UNIX type gzip, compress and bzip. Which one you decide to use is up to your site.
PhilHibbs
Premium Member
Premium Member
Posts: 1044
Joined: Wed Sep 29, 2004 3:30 am
Location: Nottingham, UK
Contact:

Post by PhilHibbs »

Phil Hibbs | Capgemini
Technical Consultant
qutesanju
Participant
Posts: 373
Joined: Tue Aug 26, 2008 4:52 am

Post by qutesanju »

I also occured same problem.but i tried it with moving the files from source location to destination TEMP location through a BATCH file DOS command.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

basu.ds wrote:I don't have any zip software installed in my windows system
First step - get some. All else is for naught otherwise.
-craig

"You can never have too many knives" -- Logan Nine Fingers
basu.ds
Participant
Posts: 118
Joined: Tue Feb 06, 2007 12:59 am
Location: Bangalore

Post by basu.ds »

Thanks for all ,
i have installed winrar on mechine
I am able to zip a file from command line usind dos command
but i am not able to zip using DataStage by using same command
then i tried create a batch file then i ran working fine from me but when i am using same batch file from datastage not working .my winrar installed in c drive but my datastage installed in d drive ,
so how can i acieve this
please any one suggest me on this

Thanks in advance,
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

basu.ds wrote:I am able to zip a file from command line usind dos command but i am not able to zip using DataStage by using same command
[sigh]

Why not? What syntax did you use and happens when you use it, what error(s) do you get? :?

Perhaps something like this will help in absense of the above information.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Craig - if you print out the post and hold the sheet of paper to the top of your head, you should be able to use digital osmosis and _know_ what the error message is. I, on the other, hand am going to have to wait for a description of the error message from basu.ds.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I believe I too shall wait. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
qutesanju
Participant
Posts: 373
Joined: Tue Aug 26, 2008 4:52 am

Post by qutesanju »

Could you please share the DOS command ti zip and unzip..thru WINRAR?
chulett wrote:
basu.ds wrote:I am able to zip a file from command line usind dos command but i am not able to zip using DataStage by using same command
[sigh]

Why not? What syntax did you use and happens when you use it, what error(s) do you get? :?

Perhaps something like this will help in absense of the above information.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Click the link and all shall be revealed! [poof]
-craig

"You can never have too many knives" -- Logan Nine Fingers
qutesanju
Participant
Posts: 373
Joined: Tue Aug 26, 2008 4:52 am

Post by qutesanju »

@Chulette......the link you shared is useful for EXTRACTING the RAR file....if you have can you pls share same info how to ZIP the file thru WINRAR from command prompt...............

Perhaps something like this will help in absense of the above information.[/quote]
Post Reply