In teradata, you can see the table definition by running a show table xxx to get the contents on how it was created. In SAS you can also run this same code that writes out the contents to a table or perform a describe xxx which produces the code in a log. what i was looking to do is utilize SAS to read this code to recreate the table to perform a comparison on another table. The columns could always change so i want to make it as dynamic as possible. Waht would be the most efficient way to build a new table off of the describe statement.
If you just want to create a new table that has the same structure as the old table, you can use
create table newTable like oldTable;
See also this sample code here:
data newCars;
seqNr = _n_;
set sashelp.cars;
run;
proc sql;
create index seqNr on newcars;
describe table newCars;
create table newCars2 like newCars;
describe table newCars;
quit;
Bruno
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.