Hi,
I am trying to simply combine 5 tables (having the same variables),
libname XYZ "/sasdata/data/data3/Ali";
data XYZ.concatenation;
set XYZ.FBG_Analysis4 XYZ.FBG_ANALYSIS9 XYZ.FBG_ANALYSIS34 XYZ.FBG_ANALYSIS42
ERROR: Variable 'COT00503.D_SRVY'n has been defined as both character and numeric.
XYZ.FBG_ANALYSIS64;
run;
proc print data=XYZ.concatenation;
var C_ST C_DSTRB_AREA N_RSK ConstructionClass COT00503.C_CSP_CONST_CLS Current_FBG Updated_FBG Difference_percentage;
title 'Data Set CONCATENATION';
run;
But, I get this error. This variable 'COT00503.D_SRVY' is a "date" variable and I don't know how to solve the issue. Could you please help?
Thank you Reeza. Could you please advise how to "make them all the same in a separate step" as you said?
Once you figure out which dataset contains the character date, you could fix it like this:
libname XYZ "/sasdata/data/data3/Ali";
data XYZ.concatenation;
set
XYZ.FBG_Analysis4
XYZ.FBG_ANALYSIS9
( rename='COT00503.D_SRVY'n=COT00503_D_SRVY_str
in=special )
XYZ.FBG_ANALYSIS34
XYZ.FBG_ANALYSIS42
XYZ.FBG_ANALYSIS64;
if special then 'COT00503.D_SRVY'n = input(COT00503_D_SRVY_str, anydtdte.);
drop COT00503.D_SRVY_str;
run;
You might have to use a different informat.
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!
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.