Capability to read a compressed 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

Post Reply
vnspn
Participant
Posts: 165
Joined: Mon Feb 12, 2007 11:42 am

Capability to read a compressed file

Post by vnspn »

Hi,

Does DataStage have the capability to read a compressed file?

If I received a file that is compressed from another application or a Mainframe system, can DataStage read that file?

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

Post by chulett »

No. At least not directly. You'll need to 'uncompress' it first and that's a job for your O/S. Or your file transfer mechanism.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can specify unzip, gunzip, etc., as the filter command in a Sequential File stage. Then DataStage reads from the output of the command via a pipe.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Which would be the 'O/S' that I mentioned. :wink:

And it will take more than a simple 'unzip' command in the Filter. That might get you the file names being unzipped but not their content. Make sure your unzipper / decompressor has an option to write the uncompressed output to standard out. For example:

Code: Select all

gunzip -c filename
Not sure what the equivalent would be on the Windows command line.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Code: Select all

UnZip 5.50 of 17 February 2002, by Info-ZIP.  Maintained by C. Spieler.  Send
bug reports to the authors at Zip-Bugs@lists.wku.edu; see README for details.

Usage: unzip [-Z] [-opts[modifiers]] file[.zip] [list] [-x xlist] [-d exdir]
  Default action is to extract files in list, except those in xlist, to exdir;
  file[.zip] may be a wildcard.  -Z => ZipInfo mode ("unzip -Z" for usage).

  -p  extract files to pipe, no messages     -l  list files (short format)
  -f  freshen existing files, create none    -t  test compressed archive data
  -u  update files, create if necessary      -z  display archive comment
  -x  exclude files that follow (in xlist)   -d  extract files into exdir

modifiers:                                   -q  quiet mode (-qq => quieter)
  -n  never overwrite existing files         -a  auto-convert any text files
  -o  overwrite files WITHOUT prompting      -aa treat ALL files as text
  -j  junk paths (do not make directories)   -v  be verbose/print version info
  -C  match filenames case-insensitively     -L  make (some) names lowercase
  -$  label removables (-$$ => fixed disks)  -V  retain VMS version numbers
  -M  pipe through "more" pager              -s  spaces in filenames => '_'

Examples (see unzip.txt for more info):
  unzip data1 -x joe   => extract all files except joe from zipfile data1.zip
  unzip -fo foo ReadMe => quietly replace existing ReadMe if archive file newer
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Excellent. And freeware to boot. :wink:

http://www.info-zip.org/

I'm sure there's an equivalent for the command line package for WinZip which I have, didn't bother to check the syntax. Only caveat there is you need to have the registered version of WinZip, not still be freeloading off the 'evaluation' copy. :lol:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply