A little macro to copy the definition of a column from one dataset to another.
%macro copycolumn(column,fromset,toset);
proc sql noprint; select type,format,informat into :type,:format,:informat from dictionary.columns where catt(libname,'.',memname)= "&fromset"
and name="&column";
%put &=type &=format &=informat;
alter table &toset add &column &type format=&format informat=&informat;
%mend;
Here's an example:
%copycolumn(CLAIM_PAYMENT_STATUS, LIB2100.CLAIMS, LIB2100.NEWCLAIMS);
Adds CLAIM_PAYMENT_STATUS as a character column with a format of $2.
... View more