importing .gz file from unix server and unzip

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
kum_d
Participant
Posts: 20
Joined: Tue Jul 17, 2007 4:53 am

importing .gz file from unix server and unzip

Post by kum_d »

Hi

Can i know how to access the zip (.gz) files which are in remote unix server into windows client and unzip as well as rename to .txt file ,the same using DS

Please help me regrarding this?
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Unzip and ftp it over to the windows server. Write a shell that does all this.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Are you using Server or PX to do this? You can ftp the files over first, then unzip them on Windows (this saves I/O overhead on the network); you could do this outside of DataStage in a script or within a job.
kum_d
Participant
Posts: 20
Joined: Tue Jul 17, 2007 4:53 am

Post by kum_d »

Hi DSGuru,

The current process is they are accessing the .gz file which is in remote unxi server using FTP tool and moving to our local directory in windows.

But now we need to automate it using Datastage i.e we need to access and unzip after import using datastage.

I dont have idea about shell as you mentined me to use shell.

Can you plesae help me how can i do this using datastage
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Control the FTP separately from DataStage, or from an Execute Command activity in a job sequence, or from a before-job subroutine. Use a Filter command in a Sequential File stage to execute your unzip utility; the Sequential File stage will read stdout from the filter command if one is specified.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSRajesh
Premium Member
Premium Member
Posts: 297
Joined: Mon Feb 05, 2007 10:37 pm

Post by DSRajesh »

Hi ArndW,

Can we import the .gz files which are in remote unix server using FTP satge in datastage or can we only access the sequential files using ftp stage?

I need to implement this using datastage only but not like using shell scripts or ftp tool out of datastage.

can you please help me here.
RD
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No, the FTP stage cannot handle compressed or zip or binary (etc) files. It does a metadata driven record by record transfer rather than just streaming bytes, which means text files only.

"I need to implement this using datastage only"

I don't understand restrictions on using scripts or the O/S for some aspects of your work. No tool can do everything and it's perfectly OK to leverage shell scripts / batch files or external tools where appropriate. And this is one of those appropriate times.

Your DataStage job can run / monitor said shell script without issue.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSRajesh
Premium Member
Premium Member
Posts: 297
Joined: Mon Feb 05, 2007 10:37 pm

Post by DSRajesh »

Hi chulett,

I dont have know about shell scripts.
Can you please help me out about the shell script code which works for this.

can you plesae give me an idea with sample shell script and how can we use it?

This helps me a lot to improve knowldge.
RD
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Are you and "kum_d" working together on this? If not, do you have DataStage installed on a UNIX server? If so, there must be someone in your organization that can help you with a simple shell script like that.
-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 »

DSRajesh wrote:...Can we import the .gz files which are in remote unix server using FTP satge in datastage...
Sort of - but I wouldn't recommend doing it that way. If you "fake" the metadata in the FTP stage to be one (binary) column and pipe the incoming binary stream into a unzip program it will work (I have done that before) but that would normally not be a good approach. I think I used that solution in a case where the network connection was stable but very slow and it would have taken hours for the FTP to complete; by using the FTP stage in DataStage as mentioned above I was able to process the data as it came in instead of having to wait for all of it to arrive. Unless you have a similar scenario I would say that the answer to the ftp and gzipped file is "no"
Post Reply