<?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: Proc SQL Query to create and store macro value in table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Query-to-create-and-store-macro-value-in-table/m-p/270616#M53797</link>
    <description>&lt;P&gt;You can either create a macro or store it into a table, not both in a PROC SQL step.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use two separate steps but it doesn't make a lot of sense given your current query, since you have a single value which is accessible in the macro variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
create table t as
select count(*) as c 
from sashelp.cars;

select c into :car from t;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 16 May 2016 00:17:58 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-05-16T00:17:58Z</dc:date>
    <item>
      <title>Proc SQL Query to create and store macro value in table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Query-to-create-and-store-macro-value-in-table/m-p/270615#M53796</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am &amp;nbsp;trying to create a macro variable using Proc SQL and store it in a table. &amp;nbsp;but I am getting the above warning&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WARNING: INTO clause is ignored in the CREATE TABLE statement.&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table t as select count(*) as c into :car from sashelp.cars;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Nitesh&lt;/P&gt;</description>
      <pubDate>Sun, 15 May 2016 23:55:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Query-to-create-and-store-macro-value-in-table/m-p/270615#M53796</guid>
      <dc:creator>nit123</dc:creator>
      <dc:date>2016-05-15T23:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL Query to create and store macro value in table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Query-to-create-and-store-macro-value-in-table/m-p/270616#M53797</link>
      <description>&lt;P&gt;You can either create a macro or store it into a table, not both in a PROC SQL step.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use two separate steps but it doesn't make a lot of sense given your current query, since you have a single value which is accessible in the macro variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
create table t as
select count(*) as c 
from sashelp.cars;

select c into :car from t;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 May 2016 00:17:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Query-to-create-and-store-macro-value-in-table/m-p/270616#M53797</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-05-16T00:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL Query to create and store macro value in table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Query-to-create-and-store-macro-value-in-table/m-p/774131#M245986</link>
      <description>&lt;P&gt;Try this query to initialize the macro variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select count(*) as c&lt;BR /&gt;into :car&lt;BR /&gt;from &lt;SPAN&gt;sashelp.cars&lt;/SPAN&gt;;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%put &amp;amp;car.;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 07:26:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Query-to-create-and-store-macro-value-in-table/m-p/774131#M245986</guid>
      <dc:creator>DimaFrank</dc:creator>
      <dc:date>2021-10-14T07:26:09Z</dc:date>
    </item>
  </channel>
</rss>

