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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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