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.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.