How to search variables in SAS?

Reply
N/A
Posts: 0

How to search variables in SAS?

The data set I use is very large. There are hundreds of variables and I want to search whether some variable like "FIN" is included in the data set.
How can I do?

Another question is that: There are 40,000 observations and I want to choose some observations with "FIN=10181" and "FIN=10182" and "FIN=10183" and so on. How can I do that?

Thanks so much for your help.
Super Contributor
Super Contributor
Posts: 3,174

Re: How to search variables in SAS?

Explore using DICTIONARY.COLUMNS with PROC SQL to analyze any SAS data library and/or member that has been declared with the LIBNAME statement.

If using PROC SQL or DATA/PROC step, you can select/filter using the IN operator in your WHERE statement/clause. Or you can string out the data-values as constants using IF OR OR THEN DO;

Scott Barry
SBBWorks, Inc.

Recommended Google advanced search arguments, this topic/post:

dictionary columns site:sas.com

where in operator site:sas.com
Contributor
Posts: 74

Re: How to search variables in SAS?

other approaches in addition to using dictionary:

1. right-click on the dataset and choose 'view columns'
2. use proc contents
Super Contributor
Super Contributor
Posts: 3,174

Re: How to search variables in SAS?

Agreed - also, PROCs like MEANS and FREQ can be quite useful for SAS database/variable/column "discovery".

Scott Barry
SBBWorks, Inc.
Post a Question
Discussion Stats
  • 3 replies
  • 394 views
  • 0 likes
  • 3 in conversation