BookmarkSubscribeRSS Feed
Midi
Obsidian | Level 7

Hi Everyone , i'm trying to append multiple files with the proc append and a macro , this is what i wrote :

 

%Macro Prep_Tbl_Date;
%do iii = 1 %to &num_File_.;
proc append Base=Work.Original_Table Data = %unquote(%str(%'&&_File_&iii..%'));
run;
%end;
%mend prep_table_date;
%pre_tbl_date;

Any Help Would be much appreciated , thank you.

3 REPLIES 3
Tom
Super User Tom
Super User

You are trying to reference datasets by using a quoted physical name.  SAS error message is saying the name does not look like a dataset name.  SAS dataset names use sas7bdat as the extension.  You do not need to include the extension. Example:

data test;
  set
   '/dir1/member1.sas7bdat'
   '/dir2/member2'
  ;
run;

If you meant to reference the dataset using normal LIBREF.MEMNAME syntax then do not include the quotes.

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
  • 5316 views
  • 1 like
  • 3 in conversation