<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how to look at a bunch variables with only on digit diff inbeded in  name in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/how-to-look-at-a-bunch-variables-with-only-on-digit-diff-inbeded/m-p/48597#M13148</link>
    <description>Hi Jenn&lt;BR /&gt;
&lt;BR /&gt;
Just read Olivier's answer to your last question:&lt;BR /&gt;
"You can use this shortcut : VAR var2: ; which stands for 'all variables having their name beginning with "VAR2" '&lt;BR /&gt;
&lt;BR /&gt;
So why don't you just write "VAR var:" ?&lt;BR /&gt;
&lt;BR /&gt;
Below my more complicated approach before Olivier reminded me how to do things.&lt;BR /&gt;
&lt;BR /&gt;
You can also use a syntax like "VAR x -- c". This gives you all the variables like they are stored in the table (NOT alphabetically: it's COLNUM! This returns all the vars between Colnum of X to Colnum of C).&lt;BR /&gt;
&lt;BR /&gt;
HTH&lt;BR /&gt;
Patrick&lt;BR /&gt;
&lt;BR /&gt;
data have;&lt;BR /&gt;
  a=1;&lt;BR /&gt;
  c=2;&lt;BR /&gt;
  var1same=97;&lt;BR /&gt;
  b=3;&lt;BR /&gt;
  d1=4;&lt;BR /&gt;
  var3same=98;&lt;BR /&gt;
  d2=5;&lt;BR /&gt;
  d10=6;&lt;BR /&gt;
  var2same=99;&lt;BR /&gt;
  d5=7;&lt;BR /&gt;
  output;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
%let VarList=;&lt;BR /&gt;
proc sql;&lt;BR /&gt;
  select name into :VarList separated by ' '&lt;BR /&gt;
    from dictionary.columns&lt;BR /&gt;
     where libname='WORK' and memname='HAVE' and upcase(name) like upcase('var%same')&lt;BR /&gt;
     order by name;&lt;BR /&gt;
     %put &amp;amp;VarList;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
proc means;&lt;BR /&gt;
  var &amp;amp;VarList;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: Patrick</description>
    <pubDate>Sat, 20 Sep 2008 03:29:39 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2008-09-20T03:29:39Z</dc:date>
    <item>
      <title>how to look at a bunch variables with only on digit diff inbeded in  name</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-look-at-a-bunch-variables-with-only-on-digit-diff-inbeded/m-p/48596#M13147</link>
      <description>data structure:&lt;BR /&gt;
var1same var2same var3same------var100same&lt;BR /&gt;
&lt;BR /&gt;
I donot want to list them all one by one when I look at them like following.&lt;BR /&gt;
proc means;&lt;BR /&gt;
var var1same var2same var3same------var100same;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Is there a short cut way to list these similar variables without typing them all?&lt;BR /&gt;
&lt;BR /&gt;
Thanks.</description>
      <pubDate>Sat, 20 Sep 2008 02:48:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-look-at-a-bunch-variables-with-only-on-digit-diff-inbeded/m-p/48596#M13147</guid>
      <dc:creator>tulip</dc:creator>
      <dc:date>2008-09-20T02:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to look at a bunch variables with only on digit diff inbeded in  name</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-look-at-a-bunch-variables-with-only-on-digit-diff-inbeded/m-p/48597#M13148</link>
      <description>Hi Jenn&lt;BR /&gt;
&lt;BR /&gt;
Just read Olivier's answer to your last question:&lt;BR /&gt;
"You can use this shortcut : VAR var2: ; which stands for 'all variables having their name beginning with "VAR2" '&lt;BR /&gt;
&lt;BR /&gt;
So why don't you just write "VAR var:" ?&lt;BR /&gt;
&lt;BR /&gt;
Below my more complicated approach before Olivier reminded me how to do things.&lt;BR /&gt;
&lt;BR /&gt;
You can also use a syntax like "VAR x -- c". This gives you all the variables like they are stored in the table (NOT alphabetically: it's COLNUM! This returns all the vars between Colnum of X to Colnum of C).&lt;BR /&gt;
&lt;BR /&gt;
HTH&lt;BR /&gt;
Patrick&lt;BR /&gt;
&lt;BR /&gt;
data have;&lt;BR /&gt;
  a=1;&lt;BR /&gt;
  c=2;&lt;BR /&gt;
  var1same=97;&lt;BR /&gt;
  b=3;&lt;BR /&gt;
  d1=4;&lt;BR /&gt;
  var3same=98;&lt;BR /&gt;
  d2=5;&lt;BR /&gt;
  d10=6;&lt;BR /&gt;
  var2same=99;&lt;BR /&gt;
  d5=7;&lt;BR /&gt;
  output;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
%let VarList=;&lt;BR /&gt;
proc sql;&lt;BR /&gt;
  select name into :VarList separated by ' '&lt;BR /&gt;
    from dictionary.columns&lt;BR /&gt;
     where libname='WORK' and memname='HAVE' and upcase(name) like upcase('var%same')&lt;BR /&gt;
     order by name;&lt;BR /&gt;
     %put &amp;amp;VarList;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
proc means;&lt;BR /&gt;
  var &amp;amp;VarList;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: Patrick</description>
      <pubDate>Sat, 20 Sep 2008 03:29:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-look-at-a-bunch-variables-with-only-on-digit-diff-inbeded/m-p/48597#M13148</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2008-09-20T03:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to look at a bunch variables with only on digit diff inbeded in  name</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-look-at-a-bunch-variables-with-only-on-digit-diff-inbeded/m-p/48598#M13149</link>
      <description>Hi, Patrick:&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your reply. &lt;BR /&gt;
&lt;BR /&gt;
By the way, the reason I could not use the olivier's short cut is that if I use var:, it will read more than necessary. There are hundreds of variable started with var.</description>
      <pubDate>Sun, 21 Sep 2008 01:53:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-look-at-a-bunch-variables-with-only-on-digit-diff-inbeded/m-p/48598#M13149</guid>
      <dc:creator>tulip</dc:creator>
      <dc:date>2008-09-21T01:53:24Z</dc:date>
    </item>
  </channel>
</rss>

