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

Hi everyone,

 

After running code, I have a library WORK with 64 outputs like the picture below:

 

My97_0-1613428516190.png

And normally I export to physical file for one file is as below:

libname myfolder 'C:\Users\pnguyen\OneDrive - Massey University\PhD JOURNEY\2Cfiltering';
proc copy in=work out=myfolder;
select argentina_merge2;
run;
quit;

Could you please help me to generate code to export all files from library work to physical files as above? I appreciate any other alternative way in doing so as well.

 

I want to "export" because I do not want to write a so-called "long" code because it is really a mess for me to debug afterward.

 

Warm regards.

P/S: I also added the output of content of library "WORK"

 

And when running PROC CONTENTS, I saw some strange memname that I do not know where they come from, so be careful about them

My97_0-1613429031041.png

 

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

> Could you please help me to generate code to export all files from library work to physical files as above?

The work files are physical files, so this question is oddly worded.

Look at the proc copy statements, especially exclude and select.

Or maybe copy all, and delete the unneeded ones, like _PRODSAVAIL.

 

 

View solution in original post

3 REPLIES 3
ChrisNZ
Tourmaline | Level 20

> Could you please help me to generate code to export all files from library work to physical files as above?

The work files are physical files, so this question is oddly worded.

Look at the proc copy statements, especially exclude and select.

Or maybe copy all, and delete the unneeded ones, like _PRODSAVAIL.

 

 

Phil_NZ
Barite | Level 11

Hi @ChrisNZ 

 

I mean, how to macronize or generalize the code

 

libname myfolder 'C:\Users\pnguyen\OneDrive - Massey University\PhD JOURNEY\2Cfiltering';
proc copy in=work out=myfolder;
select argentina_merge2;
run;
quit;

For all files in the library work (the code above just for only one output file in the library work)

 

Warm regards.

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
ChrisNZ
Tourmaline | Level 20

 

 

     R e a d   t h e   d o c u m e n t a t i o n.

 

 

In this case, remove the select statement.

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
  • 3 replies
  • 713 views
  • 2 likes
  • 2 in conversation