BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
alepage
Barite | Level 11

Here's the problem.

 

I am dealing with a table which contains 271 variables and 3.5 Millions of observations.

Moreover, I have no information on this table such as the meaning of each variable and the values each variable could take, especially the characters variables.

 

I have made a proc contents to obtain the number of observations and the list of variables.

 

I am interested by the value character variable could take.

 

Usually I made a proc sort nodupkey by variable x and I obtains the list of possible values for a variable could take.

 

My question is: is there a better way to do that with many variables and only the character variables

 

Regards,

 

Alain LePage

 

1 ACCEPTED SOLUTION

Accepted Solutions
collinelliot
Barite | Level 11

It depends on your specific needs, but based on what you describe I'd use something like this:

 

ods select NLevels;

proc freq data = sashelp.class nlevels;
    table _character_;
run;

 

 

View solution in original post

4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Well, first tip, you don't need to run a contents, you can just query sashelp.vtable and vcolumn to find that info.  With regards to the data, if you don't know anything about the data, what do you intend to do with it, without any documentation, data is just a waste of disk space.  If your list comes back with var1 contains XYZ,DEF,OPT, is that going to help?  Anyways, proc freq is probably your best bet here.

A basic example:

proc freq data=sashelp.class;
  tables _character_ / out=temp;
run;
collinelliot
Barite | Level 11

It depends on your specific needs, but based on what you describe I'd use something like this:

 

ods select NLevels;

proc freq data = sashelp.class nlevels;
    table _character_;
run;

 

 

LinusH
Tourmaline | Level 20

If you have a table that is not documented, and none want to/can describe it for you, throw it away. Especially if it has that many variables.

Data never sleeps

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 3053 views
  • 3 likes
  • 4 in conversation