<?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 Automatic variable for counting the no of obs from pass through SQL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Automatic-variable-for-counting-the-no-of-obs-from-pass-through/m-p/651236#M195370</link>
    <description>&lt;P&gt;Hi SAS users,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are there any automatic variables like SQLOBS for counting the number of observations from pass through SQL ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SQLOBS worked for me for SAS Proc SQL's , but not Pass through.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my code I have count the extraction for each iterations and load those counts into Oracle table for statistics.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ana&lt;/P&gt;</description>
    <pubDate>Wed, 27 May 2020 22:45:03 GMT</pubDate>
    <dc:creator>SASAna</dc:creator>
    <dc:date>2020-05-27T22:45:03Z</dc:date>
    <item>
      <title>Automatic variable for counting the no of obs from pass through SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automatic-variable-for-counting-the-no-of-obs-from-pass-through/m-p/651236#M195370</link>
      <description>&lt;P&gt;Hi SAS users,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are there any automatic variables like SQLOBS for counting the number of observations from pass through SQL ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SQLOBS worked for me for SAS Proc SQL's , but not Pass through.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my code I have count the extraction for each iterations and load those counts into Oracle table for statistics.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ana&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 22:45:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automatic-variable-for-counting-the-no-of-obs-from-pass-through/m-p/651236#M195370</guid>
      <dc:creator>SASAna</dc:creator>
      <dc:date>2020-05-27T22:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic variable for counting the no of obs from pass through SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automatic-variable-for-counting-the-no-of-obs-from-pass-through/m-p/651260#M195384</link>
      <description>&lt;P&gt;What does your SQL look like? It is only populated with a row count if you create a SAS table.&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2020 01:58:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automatic-variable-for-counting-the-no-of-obs-from-pass-through/m-p/651260#M195384</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-05-28T01:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic variable for counting the no of obs from pass through SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automatic-variable-for-counting-the-no-of-obs-from-pass-through/m-p/651286#M195394</link>
      <description>&lt;P&gt;I think you have to derive this count yourself.&lt;/P&gt;
&lt;P&gt;For example with Oracle you can do something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
  connect using ORALIB;
  create table T as
  select * from connection to ORALIB ( 
    with Q as (  .. your oracle query... )
    select * 
    from Q
       , (select count(*) as COUNT from Q) 
  )  ...more SAS code, inner join, where etc....  ;
  select COUNT into :sqloraobs from T(obs=1);
%put &amp;amp;=sqloraobs ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 May 2020 05:13:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automatic-variable-for-counting-the-no-of-obs-from-pass-through/m-p/651286#M195394</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-05-28T05:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic variable for counting the no of obs from pass through SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automatic-variable-for-counting-the-no-of-obs-from-pass-through/m-p/651422#M195452</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;Its Oracle connecting pass through SQL like below.&lt;BR /&gt;&lt;BR /&gt;PROC SQL;&lt;BR /&gt;CONNECT TO ORACLE(PATH="&amp;amp;DB." USER=&amp;amp;ID. ORAPW=&amp;amp;Password.);&lt;BR /&gt;CREATE TABLE dataset AS SELECT * FROM CONNECTION TO ORACLE&lt;BR /&gt;( SELECT&lt;BR /&gt;......&lt;BR /&gt;);&lt;BR /&gt;Disconnect from Oracle;&lt;BR /&gt;Quit;&lt;BR /&gt;&lt;BR /&gt;%let COUNT1=&amp;amp;SQLOBS; %put &amp;amp;=COUNT1; ( sqlobs is coming as 0 , but my table 'dataset' has observations.&lt;BR /&gt;</description>
      <pubDate>Thu, 28 May 2020 15:25:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automatic-variable-for-counting-the-no-of-obs-from-pass-through/m-p/651422#M195452</guid>
      <dc:creator>SASAna</dc:creator>
      <dc:date>2020-05-28T15:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic variable for counting the no of obs from pass through SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automatic-variable-for-counting-the-no-of-obs-from-pass-through/m-p/651430#M195455</link>
      <description>&lt;P&gt;So you aren't trying to count activity done inside of the remote database.&amp;nbsp; You are just waiting too long to capture the value of SQLOBS.&amp;nbsp; You have to get it before SQL runs another statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
CONNECT TO ORACLE(PATH="&amp;amp;DB." USER=&amp;amp;ID. ORAPW=&amp;amp;Password.);
CREATE TABLE dataset AS SELECT * FROM CONNECTION TO ORACLE
( SELECT
......
);
%let COUNT1=&amp;amp;SQLOBS;
disconnect from Oracle;
quit;

%put &amp;amp;=COUNT1; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 May 2020 15:39:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automatic-variable-for-counting-the-no-of-obs-from-pass-through/m-p/651430#M195455</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-05-28T15:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic variable for counting the no of obs from pass through SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automatic-variable-for-counting-the-no-of-obs-from-pass-through/m-p/651448#M195463</link>
      <description>Thanks Tom. It worked well.</description>
      <pubDate>Thu, 28 May 2020 16:09:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automatic-variable-for-counting-the-no-of-obs-from-pass-through/m-p/651448#M195463</guid>
      <dc:creator>SASAna</dc:creator>
      <dc:date>2020-05-28T16:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic variable for counting the no of obs from pass through SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automatic-variable-for-counting-the-no-of-obs-from-pass-through/m-p/651556#M195499</link>
      <description>I thought the data was subsequently subset or joined in the SAS part of the code.Sigh...... &lt;BR /&gt;</description>
      <pubDate>Thu, 28 May 2020 21:27:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automatic-variable-for-counting-the-no-of-obs-from-pass-through/m-p/651556#M195499</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-05-28T21:27:26Z</dc:date>
    </item>
  </channel>
</rss>

