<?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 assign the results of a query to a variable in a sas program in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-assign-the-results-of-a-query-to-a-variable-in-a-sas/m-p/29497#M5555</link>
    <description>You can use PROC SQL and generate a SAS macro variable based on your data criteria.  Then in the subsequent DATA step, you can reference this macro variable in one of several ways - likely as a data-constant or possibly as a RETAIN statement variable -- note that either choice must be wrapped in double-quotes, not single-quotes.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search arguments, this topic/post:&lt;BR /&gt;
proc sql macro variable into site:sas.com&lt;BR /&gt;
retain statement macro variable site:sas.com</description>
    <pubDate>Mon, 31 May 2010 20:25:27 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2010-05-31T20:25:27Z</dc:date>
    <item>
      <title>how to assign the results of a query to a variable in a sas program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-assign-the-results-of-a-query-to-a-variable-in-a-sas/m-p/29496#M5554</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I am new to SAS programming. I have a requirement where i need to get the result of a SQL query into a variable and use it in another data step later for validation.&lt;BR /&gt;
&lt;BR /&gt;
Eg:&lt;BR /&gt;
I get the Current YEAR as the RESULT of my query. I need to use this date to validate the accounts that needs to be loaded to the final dattabase. I will be using "if" condition in the datablock to validate this.&lt;BR /&gt;
&lt;BR /&gt;
Kindly let me know how to attain this.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Prashant</description>
      <pubDate>Mon, 31 May 2010 20:21:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-assign-the-results-of-a-query-to-a-variable-in-a-sas/m-p/29496#M5554</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-05-31T20:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to assign the results of a query to a variable in a sas program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-assign-the-results-of-a-query-to-a-variable-in-a-sas/m-p/29497#M5555</link>
      <description>You can use PROC SQL and generate a SAS macro variable based on your data criteria.  Then in the subsequent DATA step, you can reference this macro variable in one of several ways - likely as a data-constant or possibly as a RETAIN statement variable -- note that either choice must be wrapped in double-quotes, not single-quotes.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search arguments, this topic/post:&lt;BR /&gt;
proc sql macro variable into site:sas.com&lt;BR /&gt;
retain statement macro variable site:sas.com</description>
      <pubDate>Mon, 31 May 2010 20:25:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-assign-the-results-of-a-query-to-a-variable-in-a-sas/m-p/29497#M5555</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-05-31T20:25:27Z</dc:date>
    </item>
  </channel>
</rss>

