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.
From where do you populate the macro variables? I have a strong suspicion that macro coding is not necessary here and actually unhelpful.
And post some of the macro variables, ie
_file_1
_file_2
_file_3
Use the {i} button for this, so values are preserved and not mangled by the forum software.
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 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.