<?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: Quickest way to get a single observation from a dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Quickest-way-to-get-a-single-observation-from-a-dataset/m-p/140182#M28267</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah. Maybe, it is random access method. And you can also try this way, compare them who is faster .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;
%let dsid=%sysfunc(open(sashelp.class,i));
%global name;
%syscall set(dsid);
%let rc=%sysfunc(fetchobs(&amp;amp;dsid,10));
%let rc=%sysfunc(close(&amp;amp;dsid));

%put &amp;amp;name;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Oct 2014 15:54:33 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2014-10-24T15:54:33Z</dc:date>
    <item>
      <title>Quickest way to get a single observation from a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Quickest-way-to-get-a-single-observation-from-a-dataset/m-p/140181#M28266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hello!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to create a dataset containing a single observation from a large dataset and create a macro-variable. Is the point option the quickest way to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Options Fullstimer;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;%Let Pos=1000;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Data A (Drop=i);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; Do i=1 To 1000000;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; X=Ranuni(1); Output;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; End;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;Run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Data B;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; Obs=&amp;amp;Pos.;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; Set A Point=Obs;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; Call SymputX('MVB',X);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; Output;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; Stop;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;Run;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;%Put **&amp;amp;MVB.**;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Data D;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; Set A (FirstObs=&amp;amp;Pos. Obs=&amp;amp;Pos.);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; Call SymputX('MVD',X);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;Run;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;%Put **&amp;amp;MVD.**;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&amp;amp;kind regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 06:56:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Quickest-way-to-get-a-single-observation-from-a-dataset/m-p/140181#M28266</guid>
      <dc:creator>user24feb</dc:creator>
      <dc:date>2014-10-24T06:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: Quickest way to get a single observation from a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Quickest-way-to-get-a-single-observation-from-a-dataset/m-p/140182#M28267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah. Maybe, it is random access method. And you can also try this way, compare them who is faster .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;
%let dsid=%sysfunc(open(sashelp.class,i));
%global name;
%syscall set(dsid);
%let rc=%sysfunc(fetchobs(&amp;amp;dsid,10));
%let rc=%sysfunc(close(&amp;amp;dsid));

%put &amp;amp;name;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 15:54:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Quickest-way-to-get-a-single-observation-from-a-dataset/m-p/140182#M28267</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-10-24T15:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: Quickest way to get a single observation from a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Quickest-way-to-get-a-single-observation-from-a-dataset/m-p/140183#M28268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like you've answered your own question.&amp;nbsp; What did the FULLSTIMER stats show in your log.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 16:00:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Quickest-way-to-get-a-single-observation-from-a-dataset/m-p/140183#M28268</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-10-24T16:00:36Z</dc:date>
    </item>
  </channel>
</rss>

