<?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: converting a sas dataset into a variable value in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/converting-a-sas-dataset-into-a-variable-value/m-p/42733#M11125</link>
    <description>After you create the PID dataset (with one column, called "pid") that Scott recommends, the sort of SQL that you would need using the CREATE statement might look like&lt;BR /&gt;
&lt;BR /&gt;
create table all as select * from abc where pid in (SELECT pid from PID');&lt;BR /&gt;
&lt;BR /&gt;
It's called a subquery and you will find out a lot about it with the Google query that Scott provided.&lt;BR /&gt;
&lt;BR /&gt;
Doc Muhlbaier&lt;BR /&gt;
Duke</description>
    <pubDate>Thu, 01 Jul 2010 02:47:47 GMT</pubDate>
    <dc:creator>Doc_Duke</dc:creator>
    <dc:date>2010-07-01T02:47:47Z</dc:date>
    <item>
      <title>converting a sas dataset into a variable value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/converting-a-sas-dataset-into-a-variable-value/m-p/42731#M11123</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
In my project, I'm supposed to convert the a raw data into a sas value.&lt;BR /&gt;
&lt;BR /&gt;
the raw data looks like this.  It's in the .csv format.&lt;BR /&gt;
&lt;BR /&gt;
pid&lt;BR /&gt;
aa101&lt;BR /&gt;
aa102&lt;BR /&gt;
aa103&lt;BR /&gt;
aa104&lt;BR /&gt;
&lt;BR /&gt;
I want to write a query to pick all the variables from the table where the pid is equal to the list.  Like&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
&lt;BR /&gt;
  create table all as select * from abc where pid in ('aa101', 'aa102', 'aa103', 'aa104');&lt;BR /&gt;
&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
What is the optimal way of doing this?&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance.&lt;BR /&gt;
Sandhya.</description>
      <pubDate>Wed, 30 Jun 2010 19:55:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/converting-a-sas-dataset-into-a-variable-value/m-p/42731#M11123</guid>
      <dc:creator>Sandhya</dc:creator>
      <dc:date>2010-06-30T19:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: converting a sas dataset into a variable value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/converting-a-sas-dataset-into-a-variable-value/m-p/42732#M11124</link>
      <description>From your "list", create a SAS file using a DATA step with INFILE / INPUT and then use PROC SQL with a SELECT / JOIN.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Recommended Google advanced search arguments, this topic/post:&lt;BR /&gt;
&lt;BR /&gt;
proc sql select match list values site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
data step programming input data values infile input site:sas.com</description>
      <pubDate>Wed, 30 Jun 2010 20:52:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/converting-a-sas-dataset-into-a-variable-value/m-p/42732#M11124</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-06-30T20:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: converting a sas dataset into a variable value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/converting-a-sas-dataset-into-a-variable-value/m-p/42733#M11125</link>
      <description>After you create the PID dataset (with one column, called "pid") that Scott recommends, the sort of SQL that you would need using the CREATE statement might look like&lt;BR /&gt;
&lt;BR /&gt;
create table all as select * from abc where pid in (SELECT pid from PID');&lt;BR /&gt;
&lt;BR /&gt;
It's called a subquery and you will find out a lot about it with the Google query that Scott provided.&lt;BR /&gt;
&lt;BR /&gt;
Doc Muhlbaier&lt;BR /&gt;
Duke</description>
      <pubDate>Thu, 01 Jul 2010 02:47:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/converting-a-sas-dataset-into-a-variable-value/m-p/42733#M11125</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2010-07-01T02:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: converting a sas dataset into a variable value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/converting-a-sas-dataset-into-a-variable-value/m-p/42734#M11126</link>
      <description>one way to do is to use filter in the data step.&lt;BR /&gt;
&lt;BR /&gt;
if pid in ('aa101', 'aa102', 'aa103', 'aa104');</description>
      <pubDate>Thu, 01 Jul 2010 14:38:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/converting-a-sas-dataset-into-a-variable-value/m-p/42734#M11126</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-07-01T14:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: converting a sas dataset into a variable value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/converting-a-sas-dataset-into-a-variable-value/m-p/42735#M11127</link>
      <description>Thank you.  The suggestions really helped.  I used proc sql and used a sub-query.&lt;BR /&gt;
&lt;BR /&gt;
Thanks once again.&lt;BR /&gt;
Sandy.</description>
      <pubDate>Fri, 02 Jul 2010 20:10:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/converting-a-sas-dataset-into-a-variable-value/m-p/42735#M11127</guid>
      <dc:creator>Sandhya</dc:creator>
      <dc:date>2010-07-02T20:10:12Z</dc:date>
    </item>
  </channel>
</rss>

