Date: Wed, 26 Mar 2008 10:19:18 -0500
Reply-To: "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Subject: Re: finding a variable in a dataset that has exactly/almost the
same name that i ask for?
Content-Type: text/plain; charset="iso-8859-15"
b.sarang@gmail.com wrote:
> Hi, the situation is : I have a dataset directory with 3 datasets A,B
> and C. In these datasets there are variables (numeric or char) named
> abc , pqr and xyz . Now, I know I am going to use these variables(or
> variables having familiar content) for some analysis every time, so
> without doing Proc Contents and manually finding the actual names of
> the variables, I wanted to know if there is some procedure which will
> point to the matching variable name I want? Can anyone help me?
> Thanks!
The key phrase to me is:
> abc , pqr and xyz . Now, I know I am going to use these variables
> >>>>>> (or variables having familiar content) <<<<<<<<<
> for some analysis every time, so
Suppose
1. abc, pqr, xyz represent three columns of an arbitrary table X that have
some presume inter-relation or dependencies that are significant to 'some
analysis', A. Call this set of columns 'ac'.
2. Table Y is provided with columns whose names do not match abc, pqr, xyz,
but amongst the columns of Y there are columns foo, bar, snafu that have
values such that they have the same contextual relationship as abc, pqr and
xyz and are suitable to analysis A
CASE1.
Are the 'ac' of Y 'similar' in name to the columns of X ?
- What are the criteria for assigning the 'ac' roles of Y ?
- Their are numerous string functions in SAS to measure the closeness of one
value to another.
CASE2.
Are the 'ac' of Y in the same column position as those of X ?
- In other words, the 'abc' role might always be in the 5th column, the pqr
role in the 3rd, etc..., if so, the VARNAME function applied to an OPEN
table can help, or the DICTIONARY.COLUMNS/SASHELP.VCOLUMN metadata table can
be used.
If neither CASE, what are the characteristics of each column that make it
suitable for a role in analysis A? Call this 'role determination'
You would have to loop over each column of Y and apply the role
determination algorithm to rate a column as to it applicability in the roles
of abc, pqr and xyz.
Solving this problem drives to the heart of automated modeled datamining,
and if you can actually solve it, you might not have to write another line
of code in your lifetime :)
---
Richard A. DeVenezia
http://www.devenezia.com
|