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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1100 views
  • 2 likes
  • 2 in conversation