Hi Non sleeper, If you are still awake, my suggestion would be to convert the numeric variables to character in one of your datasets using the below macro and append using Xia Keshan's code: union all. So, you will have all variables as characters and as Kurt says it's now a breeze. But hey, for your future quantitave processing, you will have to convert back to numerics %macro vars(dsn); %let list=; %let type=; %let dsid=%sysfunc(open(&dsn)); %let cnt=%sysfunc(attrn(&dsid,nvars)); %do i = 1 %to &cnt; %let list=&list %sysfunc(varname(&dsid,&i)); %let type=&type %sysfunc(vartype(&dsid,&i)); %end; %let rc=%sysfunc(close(&dsid)); data want(drop= %do i = 1 %to &cnt; %let temp=%scan(&list,&i); _&temp %end;); set &dsn(rename=( %do i = 1 %to &cnt; %let temp=%scan(&list,&i); &temp=_&temp %end;)); %do j = 1 %to &cnt; %let temp=%scan(&list,&j); /** Change C to N for numeric to character conversion **/ %if %scan(&type,&j) = N %then %do; /** Also change INPUT to PUT for numeric to character **/ &temp=PUT(_&temp,8.); %end; %else %do; &temp=_&temp; %end; %end; run; %mend vars; %vars(Your_input_dataset_name) Regards, Naveen Srinivasan L&T Infotech
... View more