<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr - sarathannapareddy</title>
<link>http://snipplr.com/users/sarathannapareddy/tags/SASHELP</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Thu, 20 Jun 2013 11:27:14 GMT</pubDate>
<item>
<title>(SAS) Dictionary Tables and SASHELP Views (SAS metadata)</title>
<link>http://snipplr.com/view/17697/dictionary-tables-and-sashelp-views-sas-metadata/</link>
<description><![CDATA[ <p>Most of the SAS programmers think that the Metadata concepts (Dictionary tables and SASHELP views) are advanced SAS topics, in fact it is not.

I tried here to explain the concept precise and clear……

Here, I will cover the following topics……

Introduction to SAS metadata
How to see what’s in the tables
How to use the tables, using several real-world examples
Advantages

What are Dictionary Tables4?</p> ]]></description>
<pubDate>Thu, 30 Jul 2009 13:06:03 GMT</pubDate>
<guid>http://snipplr.com/view/17697/dictionary-tables-and-sashelp-views-sas-metadata/</guid>
</item>
<item>
<title>(SAS) Renaming All Variables in a SAS Data Set Using the SASHELP VIEWS</title>
<link>http://snipplr.com/view/17378/renaming-all-variables-in-a-sas-data-set-using-the-sashelp-views/</link>
<description><![CDATA[ <p>*Create a temporary dataset... DSN;
data dsn;
a=1;
b=2;
c=3;
d=4;
e=5;
f=6;
run;


%macro test(lib,dsn);

*/1)*/ data _null_;
set sashelp.vtable(where=(libname="&amp;LIB" and memname="&amp;DSN"));
call symput('nvars',nvar);
run;

*/2)*/ data dsn;
set sashelp.vcolumn(where=(libname="&amp;LIB" and memname="&amp;DSN"));
call symput(cats("var",_n_),name);
run;

*/3)*/ proc datasets library=&amp;LIB;
modify &amp;DSN;
rename
%do i = 1 %to &amp;nvars;
&amp;&amp;var&amp;i=Rename_&amp;&amp;var&amp;i.
%end;
;
quit;
run;
%mend;

%test(WORK,DSN);

After submitting the above program... the output looks like this....


Output:
Rename_a Rename_b Rename_c Rename_d Rename_e Rename_f
1 2 3 4 5 6</p> ]]></description>
<pubDate>Thu, 23 Jul 2009 09:29:51 GMT</pubDate>
<guid>http://snipplr.com/view/17378/renaming-all-variables-in-a-sas-data-set-using-the-sashelp-views/</guid>
</item>
</channel>
</rss>