BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi all,

I'm trying to get column names into a SAS table. For example if my Table A has the following columns:

T100 T200 T300 T400 T500

I would like to create Table B, that contains only column names, i.e.:

Columns
T100
T200
T300
T400
T500

Thank you ahead of time for your help!
Rich
1 REPLY 1
Cynthia_sas
Diamond | Level 26
Hi:
There are -many- previous forum postings on the use of the DICTIONARY information to perform tasks like this. In addition, you can search on Google for user group papers on the use of the DICTIONARY tables. Here's just one example.

cynthia
[pre]
proc sql;
** make table to use later;
create table work.shoecols as
select name
from dictionary.columns
where upcase(libname) = "SASHELP" and
upcase(memname) = "SHOES";
quit;

ods listing;
proc print data=work.shoecols;
title 'after proc sql';
run;
[/pre]

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

Register now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 978 views
  • 0 likes
  • 2 in conversation