Hi, I am using ods package to zip files in sas studio. From official website, I learned that name in the bracket is name aligned to ods package. But it seems this ods package name could be different from the final zip file name(here suppose it is 'newzip'). I need to create several zip files in the same prgramme, but when I reuse the ods package name, an error that this thread has been occupied happens. But after I relaunch sas studio, this pachage name could be used again, but still for once. Any solution? Or I have no way but to change the ods package name in the same pragramme every time when I want to create a new zip file? Thx.
ods package(newzip) open nopf; ods package(newzip) add file=x1 path="data/"; ods package(newzip) add file=x2; ods package(newzip) publish archive properties( archive_name="xyz.zip" archive_path="directory_name_here" ); ods package(newzip) close;
Do you mean something like this? I find it works as expected, creating two zip files (xyz.zip and then xyz2.zip).
filename x1 "c:\temp\myfile.txt";
ods package(newzip) open nopf;
ods package(newzip) add file=x1 path="data/";
ods package(newzip) publish archive
properties(
archive_name="xyz.zip"
archive_path="c:\temp"
);
ods package(newzip) close;
filename x1 "c:\temp\myfile.txt";
ods package(newzip) open nopf;
ods package(newzip) add file=x1 path="data/";
ods package(newzip) publish archive
properties(
archive_name="xyz2.zip"
archive_path="c:\temp"
);
ods package(newzip) close;
Do you mean something like this? I find it works as expected, creating two zip files (xyz.zip and then xyz2.zip).
filename x1 "c:\temp\myfile.txt";
ods package(newzip) open nopf;
ods package(newzip) add file=x1 path="data/";
ods package(newzip) publish archive
properties(
archive_name="xyz.zip"
archive_path="c:\temp"
);
ods package(newzip) close;
filename x1 "c:\temp\myfile.txt";
ods package(newzip) open nopf;
ods package(newzip) add file=x1 path="data/";
ods package(newzip) publish archive
properties(
archive_name="xyz2.zip"
archive_path="c:\temp"
);
ods package(newzip) close;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.