<?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: way to refer multiple sqlobs? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/way-to-refer-multiple-sqlobs/m-p/573608#M12542</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/279765"&gt;@laiguanyu001&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know that I can use sqlobs to refer to the observations in the proc sql step.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;what is I am processing multiple proc sql steps? how do I differentiate the sqlobs from the first step to the sqlobs from the second step? Is there a way to name them?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you currently have multiple SELECT clauses in a single Proc SQL step then you would need to modify the code to one Select per Sql call and assign the resulting sqlobs to a separate macro variable. Something like:&lt;/P&gt;
&lt;PRE&gt;proc sql;
   select clause
   from source
   ;
quit;
%let count1 = &amp;amp;sqlobs.;
proc sql;
   select clause2
   from source2
   ;
quit;
%let count2 = &amp;amp;sqlobs.;
&lt;/PRE&gt;
&lt;P&gt;Possibly more descriptive names than Count1 and Count2 would be good idea to better identify the source.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Jul 2019 17:22:43 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-07-15T17:22:43Z</dc:date>
    <item>
      <title>way to refer multiple sqlobs?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/way-to-refer-multiple-sqlobs/m-p/573604#M12540</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that I can use sqlobs to refer to the observations in the proc sql step.&amp;nbsp;&lt;/P&gt;&lt;P&gt;what is I am processing multiple proc sql steps? how do I differentiate the sqlobs from the first step to the sqlobs from the second step? Is there a way to name them?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2019 17:05:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/way-to-refer-multiple-sqlobs/m-p/573604#M12540</guid>
      <dc:creator>laiguanyu001</dc:creator>
      <dc:date>2019-07-15T17:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: way to refer multiple sqlobs?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/way-to-refer-multiple-sqlobs/m-p/573606#M12541</link>
      <description>&lt;P&gt;Would copying the value to another macro var help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let sql_obs1= &amp;amp;sqlobs;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;on the next proc sql&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you could incremet&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and load %let sql_obs2= &amp;amp;sqlobs;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and so on&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2019 17:10:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/way-to-refer-multiple-sqlobs/m-p/573606#M12541</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-07-15T17:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: way to refer multiple sqlobs?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/way-to-refer-multiple-sqlobs/m-p/573608#M12542</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/279765"&gt;@laiguanyu001&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know that I can use sqlobs to refer to the observations in the proc sql step.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;what is I am processing multiple proc sql steps? how do I differentiate the sqlobs from the first step to the sqlobs from the second step? Is there a way to name them?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you currently have multiple SELECT clauses in a single Proc SQL step then you would need to modify the code to one Select per Sql call and assign the resulting sqlobs to a separate macro variable. Something like:&lt;/P&gt;
&lt;PRE&gt;proc sql;
   select clause
   from source
   ;
quit;
%let count1 = &amp;amp;sqlobs.;
proc sql;
   select clause2
   from source2
   ;
quit;
%let count2 = &amp;amp;sqlobs.;
&lt;/PRE&gt;
&lt;P&gt;Possibly more descriptive names than Count1 and Count2 would be good idea to better identify the source.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2019 17:22:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/way-to-refer-multiple-sqlobs/m-p/573608#M12542</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-07-15T17:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: way to refer multiple sqlobs?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/way-to-refer-multiple-sqlobs/m-p/573612#M12545</link>
      <description>&lt;P&gt;Just store the value.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select distinct name into :male_names separated by ' '
from sashelp.class
where sex='M'
;
%let num_males=&amp;amp;sqlobs;
select distinct age  into :male_ages separated by ' ' 
from sashelp.class 
where sex='M'
;
%let num_male_ages=&amp;amp;sqlobs;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Jul 2019 17:31:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/way-to-refer-multiple-sqlobs/m-p/573612#M12545</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-15T17:31:44Z</dc:date>
    </item>
  </channel>
</rss>

