A little macro to copy the definition of a column from one dataset to another.
proc sql noprint;
select type,format,informat into :type,:format,:informat from dictionary.columns
where catt(libname,'.',memname)= "&fromset"
%put &=type &=format &=informat;
alter table &toset add &column &type format=&format informat=&informat;
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.
SAS is headed back to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team.
Interested in speaking? Content from our attendees is one of the reasons that makes SAS Innovate such a special event!
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.