BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ClayZhai
Calcite | Level 5

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;
1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

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;
Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.

View solution in original post

1 REPLY 1
ChrisHemedinger
Community Manager

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;
Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 429 views
  • 0 likes
  • 2 in conversation