The SAS Output Delivery System and reporting techniques

Create Zip for all the xls files available in the directory

Accepted Solution Solved
Reply
Contributor
Posts: 29
Accepted Solution

Create Zip for all the xls files available in the directory

Hi,

 

I have, let's say, 10 xls files exported from sas with today's date in a particular directory. And I want to zip those files. I have exported those xls files using ods tagsets.ExcelXP and I am using SAS 9.2.

 

I have tried the below code.

 

%let subdir = C:\Report1;
filename dir "&subdir.*.xls ";

ods package(ProdOutput) open nopf;
ods package(ProdOutput)
add file="dir";
ods package(ProdOutput)
publish archive
properties
(archive_name=
"Report1 - Dt.&date1..zip"
archive_path="C:\Report1");
ods package(ProdOutput) close;

 

If the above approach is not correct, then could you let me know the correct way to do it?

 

Many thanks in advance.

 

Regards,

Vikrant


Accepted Solutions
Solution
‎09-13-2017 01:56 PM
Super User
Super User
Posts: 8,339

Re: Create Zip for all the xls files available in the directory

Posted in reply to VikrantSawatkar

So what doesn't work with that?  I can't run it as there are dependancies I don't have.   The logic looks ok, if need be check out one of the many examples, for instance:

http://support.sas.com/kb/45/256.html

And come back with exact questions.

View solution in original post


All Replies
Solution
‎09-13-2017 01:56 PM
Super User
Super User
Posts: 8,339

Re: Create Zip for all the xls files available in the directory

Posted in reply to VikrantSawatkar

So what doesn't work with that?  I can't run it as there are dependancies I don't have.   The logic looks ok, if need be check out one of the many examples, for instance:

http://support.sas.com/kb/45/256.html

And come back with exact questions.

Contributor
Posts: 29

Re: Create Zip for all the xls files available in the directory

Hi RW9,

 

Thank you for the link. I referred it and tweak the code mentioned in it a bit. Now I am able to zip the files

Super User
Posts: 20,671

Re: Create Zip for all the xls files available in the directory

Posted in reply to VikrantSawatkar

I don't know if SAS 9.2 had support for these features, that would be my biggest concern. Some are definitely new in SAS 9.3

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 276 views
  • 0 likes
  • 3 in conversation