Help using Base SAS procedures

Column Names -> Table

Reply
N/A
Posts: 0

Column Names -> Table

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
SAS Super FREQ
Posts: 8,742

Re: Column Names -> Table

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]
Ask a Question
Discussion stats
  • 1 reply
  • 94 views
  • 0 likes
  • 2 in conversation