Hello
I am using proc append.
I get warning "WARNING: Variable OR has different lengths on BASE and DATA files ."
The more serios problem is that the length of variable OR is not enough and I cannot see the full name on output.
Any solution please?
%macro RRR1(CAT);
title "&CAT.";
proc sql;
create table temp as
select "&CAT." as OR ,
sum(&CAT. ) as Nr_yes,
sum(case when &CAT. ne 1 then 1 else 0 end ) as Nr_No
from ttt
;
quit;
proc append base=Wanted data=temp force nowarn;
run;
%mend;
%RRR1(CAT=X1);
%RRR1(CAT=X2)
%RRR1(CAT=X3)
%RRR1(CAT=X4)
title;
proc print data=wanted noobs;run;
Make sure that your base data set has the longest length ever to occur in any of your data you intend to append.
Make sure that your base data set has the longest length ever to occur in any of your data you intend to append.
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.