extracting a zip file from a job

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

Post Reply
vsi
Premium Member
Premium Member
Posts: 507
Joined: Wed Mar 15, 2006 1:44 pm

extracting a zip file from a job

Post by vsi »

Hi,

i have a zip file which will be created in a folder.
i need to watch for the zip file.
once,this zip file is existing in a folder, extract the files to a particular folder..
these extracted files are necessary for some other operations..

eg:
lets say i have folder called "Inbox"
at some period of time, a zip file is created in the folder "Inbox".

I need to watch for this zip file in "inbox" folder,extract files to some other folder.
all these are done before running a job.

my server is running on Unix.datastage client tools are on Windows.

i apologize for any spelling mistakes

Thanks
vsi
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

This will be quite a tricky exercise if DataStage really is on a UNIX server. Do you use samba or some similar protocol to make Windows folders visible to UNIX? Unless this is the case, I doubt that DataStage-on-UNIX is the correct tool for this task.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rleishman
Premium Member
Premium Member
Posts: 252
Joined: Mon Sep 19, 2005 10:28 pm
Location: Melbourne, Australia
Contact:

Post by rleishman »

Apols to Ray if he covered it lower in his reply, but you can get Zip and Unzip for Unix. I have used them on both Tru64 and Linux, I'd be surprised if they're not available for (some) other platforms as well - google it.
Ross Leishman
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

More concerned for now how to use a Wait For File activity on UNIX to await the appearance of a file in a Windows folder, which it appears is what vsi wants to do. :?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rleishman
Premium Member
Premium Member
Posts: 252
Joined: Mon Sep 19, 2005 10:28 pm
Location: Melbourne, Australia
Contact:

Post by rleishman »

Mmmm, yes :oops: . I really should read through to the end of the OP's post. "client tools are on Windows" is a bit inconclusive, but I think you're right to bet that the OP wants to wait on a remote file.
Ross Leishman
vsi
Premium Member
Premium Member
Posts: 507
Joined: Wed Mar 15, 2006 1:44 pm

Post by vsi »

Yes,

DataStage Designer,Manager,Director,Admin are running on
Windows 2k Prof.

The flat files exist on Unix Server.
normally i access the files using Putty.

Plz know me,if you have anzy questions..

Thanks
vsi
rleishman
Premium Member
Premium Member
Posts: 252
Joined: Mon Sep 19, 2005 10:28 pm
Location: Melbourne, Australia
Contact:

Post by rleishman »

By "flat files", so you mean the Zip Files? If the Zip files are on Unix, try to source a WinZip compatible version of Zip compatible for your flavour of Unix - use Google.
Ross Leishman
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I'm not aware that any of the putty command line utilities gives you a Wait For File capability. You could, I guess, script a ptcp command to attempt to copy the file, and only proceed if it succeeds, otherwise sleep for a while and try again, but it's not a pretty solution.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vsi
Premium Member
Premium Member
Posts: 507
Joined: Wed Mar 15, 2006 1:44 pm

Post by vsi »

can i do all these stuff with in a job and create a scheduler..
i can use waitforfile activity in the job,
i can unzip the file and i can archive the zip file.

but i need a right approach for these...
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

HOW can you use a Wait For File activity?

That's been my point. Unless you can "see" the Windows folder where the zip file will arrive from your UNIX machine on which DataStage is running, you will wait in vain.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

So rather than beliveing in Datastge, you may start writing your own logic using routine or any bat file to wait for file and extract the same.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
vsi
Premium Member
Premium Member
Posts: 507
Joined: Wed Mar 15, 2006 1:44 pm

Post by vsi »

ray.wurlod wrote:HOW can you use a Wait For File activity?

That's been my point. Unless you can "see" the Windows folder where the zip file will arrive from your UNIX machine on which DataStage is running, you will wait in vain.
Hi ray,

FYI,

from Datastage Designer,
in sequence, WaitForFile activity,
when i click "Browse for File",i am able to see all the folders
which are existing in UNIX system.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

...and the zip file will arrive in a UNIX directory?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vsi
Premium Member
Premium Member
Posts: 507
Joined: Wed Mar 15, 2006 1:44 pm

Post by vsi »

ray.wurlod wrote:...and the zip file will arrive in a UNIX directory?

yes,
somehow the zip file is in Unix Directory.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In that case you CAN use a Wait For File activity. Then an Execute Command activity to run a UNIX-based unzip or - alternately - use the same command as a filter in a Sequential File stage.
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