Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ZIPPING A FILE FROM SAS 1

Status
Not open for further replies.

depacho

Programmer
Aug 26, 2005
6
US
Hi,

I am producing a huge number of big files exported to different file types (mainly xls or CSV) and I was wondering if there is any way to produce these files already zipped directly from SAS instead of having to go and zip one by one (they go to different places so it is not zipping all in one file).


Thnak you.
 
two possible methods, which are actually very similar. You can use most Zip programs (PKZIP, WInzip etc) from a command line. For instance, in a job script I used to run in windows, we used this:-
Code:
pkzip25 -add -max -directories -header %zipdest%.zip  e:\%client%\%jobno%\ *.*

So, you could have a dos script (or whatever environment you are working in) do the work for you.

If you are set on doing it via SAS, the other option is to use the X command. I would look this up in the doco if I were you, as there is alot of system specific stuff there. Personally I'd rather do it from a script (you can set the same script to run your SAS program) as it's a bit more obvious what is happening, SAS can be a little oblivious at times to the results of your host process (ie it might fail and there's nothing in your log to say so). I've used the X command before (no examples on me I'm afraid) and you can pass it macro variables etc etc, so it can be pretty powerful like that, but you really need to make sure that you pick up the return codes after the X process completes and check for errors.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top