<?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: CAS vs SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/CAS-vs-SAS/m-p/876512#M346285</link>
    <description>&lt;P&gt;One more thing. CAS has a lot of cool new features and advantages (e.g. "parallelism") but you have to be also aware that not all things form SAS (e.g. functions) will run in CAS, see:&amp;nbsp;&lt;A href="https://blogs.sas.com/content/iml/2020/02/19/sas-functions-not-run-in-cas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2020/02/19/sas-functions-not-run-in-cas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
    <pubDate>Thu, 18 May 2023 16:26:16 GMT</pubDate>
    <dc:creator>yabwon</dc:creator>
    <dc:date>2023-05-18T16:26:16Z</dc:date>
    <item>
      <title>CAS vs SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CAS-vs-SAS/m-p/876472#M346266</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm fully aware of the great benefits of in-memory processing provided with CAS, but what exactly makes the following data steps (first in CAS, then typical SAS 9) such a big difference:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;OPTIONS FULLSTIMER;
proc cas;
	data casuser.junk;
		array a [100] a1-a100;
		do i=1 to 5000000;	/*5 million iterations*/
			j = 1 / i;
			k = i / j;
			do m = 1 to 10;
				a[m] = j * k * time();
			end;
			output;
		end;
	run;
run;
quit;

data junk;
	array a [100] a1-a100;
	do i=1 to 5000000;	/*5 million iterations*/
		j = 1 / i;
		k = i / j;
		do m = 1 to 10;
			a[m] = j * k * time();
		end;
		output;
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;proc CAS process: Real Time: 8.15 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Standard SAS&amp;nbsp; &amp;nbsp; : Real Time: 28.48 seconds&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;???&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 14:41:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CAS-vs-SAS/m-p/876472#M346266</guid>
      <dc:creator>YvanHelie</dc:creator>
      <dc:date>2023-05-18T14:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: CAS vs SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CAS-vs-SAS/m-p/876478#M346268</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/415409"&gt;@YvanHelie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm fully aware of the great benefits of in-memory processing provided with CAS, but what exactly makes the following data steps (first in CAS, then typical SAS 9) such a big difference:&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The in-memory processing makes the difference. There is no disk write step in CAS as there is in SAS. Disk write takes longer than in-memory operations.&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 14:58:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CAS-vs-SAS/m-p/876478#M346268</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-05-18T14:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: CAS vs SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CAS-vs-SAS/m-p/876484#M346270</link>
      <description>&lt;P&gt;&lt;U&gt;Everything&lt;/U&gt; in CAS is multi-CPU capable and can spread the load over the grid. SAS 9.4 uses only one computer, and only some procedures (and not the DATA step, AFAIK) are multithreaded.&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 15:08:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CAS-vs-SAS/m-p/876484#M346270</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-05-18T15:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: CAS vs SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CAS-vs-SAS/m-p/876507#M346282</link>
      <description>&lt;P&gt;A side note.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't have to put CAS-enabled dataset in proc cas. The data step will run perfectly fine on it's own.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you look into the log you will see something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;93     proc cas;
NOTE: PROCEDURE CAS used (Total process time):
      real time           0.00 seconds
      user cpu time       0.00 seconds
      system cpu time     0.00 seconds
      memory              10648.53k
      OS Memory           45696.00k
          
94      data casuser.junk;
95       array a [100] a1-a100;
96       do i=1 to 5000000;  /*5 million iterations*/
97         j = 1 / i;
98         k = i / j;
99         do m = 1 to 10;
100          a[m] = j * k * time();
101        end;
102        output;
103      end;
104     run;
NOTE: Running DATA step in Cloud Analytic Services.
NOTE: The DATA step has no input data set and will run in a single thread.
NOTE: The table junk in caslib CASUSER(********************) has 5000000 observations and 104 variables.
NOTE: DATA statement used (Total process time):
      real time           10.73 seconds
      user cpu time       0.00 seconds
      system cpu time     0.01 seconds
      memory              1258.71k
      OS Memory           36888.00k&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which means that proc cas stopped before data step was run.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A side note to the side note:&lt;/P&gt;
&lt;P&gt;When I executed "sas" data step it worked half the time:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;82      data work.junk;
83       array a [100] a1-a100;
84       do i=1 to 5000000;  /*5 million iterations*/
85         j = 1 / i;
86         k = i / j;
87         do m = 1 to 10;
88           a[m] = j * k * time();
89         end;
90         output;
91       end;
92      run;
NOTE: The data set WORK.JUNK has 5000000 observations and 104 variables.
NOTE: DATA statement used (Total process time):
      real time           5.09 seconds
      user cpu time       3.21 seconds
      system cpu time     1.89 seconds
      memory              643.78k
      OS Memory           35604.00k&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But it used more CPU time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 16:16:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CAS-vs-SAS/m-p/876507#M346282</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-05-18T16:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: CAS vs SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CAS-vs-SAS/m-p/876509#M346284</link>
      <description>&lt;P&gt;One more side note.&amp;nbsp; Both data steps, the CAS one and the SPRE one are running in a single thread here so you won't be able to see potential of "parallel" datastep.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 16:20:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CAS-vs-SAS/m-p/876509#M346284</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-05-18T16:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: CAS vs SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CAS-vs-SAS/m-p/876512#M346285</link>
      <description>&lt;P&gt;One more thing. CAS has a lot of cool new features and advantages (e.g. "parallelism") but you have to be also aware that not all things form SAS (e.g. functions) will run in CAS, see:&amp;nbsp;&lt;A href="https://blogs.sas.com/content/iml/2020/02/19/sas-functions-not-run-in-cas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2020/02/19/sas-functions-not-run-in-cas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 16:26:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CAS-vs-SAS/m-p/876512#M346285</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-05-18T16:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: CAS vs SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CAS-vs-SAS/m-p/876520#M346288</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;One more thing. CAS has a lot of cool new features and advantages (e.g. "parallelism") but you have to be also aware that not all things form SAS (e.g. functions) will run in CAS, see:&amp;nbsp;&lt;A href="https://blogs.sas.com/content/iml/2020/02/19/sas-functions-not-run-in-cas.html" target="_blank" rel="noopener"&gt;https://blogs.sas.com/content/iml/2020/02/19/sas-functions-not-run-in-cas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And even more interestingly, things like RETAIN will work in CAS, but they work within a thread, not across threads.&amp;nbsp; There's good documentation on this, e.g.&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/v_039/casdspgm/p0ujjmynr82tfsn1pyp475bhvaib.htm#n1ais5ys5mivqpn1a7kw7swjxao2" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/v_039/casdspgm/p0ujjmynr82tfsn1pyp475bhvaib.htm#n1ais5ys5mivqpn1a7kw7swjxao2&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I think ( &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;&amp;nbsp;- I didn't know you had CAS, can you confirm?) that in CAS if you do:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have end=eof;
  if eof;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and if it runs multi-threaded,&amp;nbsp; want will have as many records as there are threads.&amp;nbsp; Because each thread will have one record where eof=1.&amp;nbsp; My mental map is that each thread gets it's own PDV.&amp;nbsp; I think, haven't tested, as I don't have access to CAS.&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 17:39:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CAS-vs-SAS/m-p/876520#M346288</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-05-18T17:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: CAS vs SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CAS-vs-SAS/m-p/876555#M346295</link>
      <description>&lt;P&gt;Yes &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt;&amp;nbsp;, it works as you wrote, and does have multiple observations.&lt;/P&gt;
&lt;P&gt;Code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data casuser.have ;
  set sashelp.cars;
  do i=1 to 100;
    output;
  end;
run;


data casuser.want1;
  set casuser.have end=eof;
  if eof;
  sum+invoice;
  t=_threadid_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Log:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;82     data casuser.have ;
83       set sashelp.cars;
84       do i=1 to 100;
85         output;
86       end;
87     run;
NOTE: There were 428 observations read from the data set SASHELP.CARS.
NOTE: The data set CASUSER.HAVE has 42800 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      user cpu time       0.01 seconds
      system cpu time     0.02 seconds
      memory              1532.90k
      OS Memory           37404.00k

88     
89     
90     data casuser.want1;
91       set casuser.have end=eof;
92       if eof;
93       sum+invoice;
94       t=_threadid_;
95     run;
NOTE: Running DATA step in Cloud Analytic Services.
NOTE: &lt;STRONG&gt;The DATA step will run in multiple threads.&lt;/STRONG&gt;
NOTE: There were 42800 observations read from the table HAVE in caslib CASUSER(************************).
NOTE: The table want1 in caslib CASUSER(************************) &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;has 36 observations&lt;/STRONG&gt;&lt;/FONT&gt; and 18 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      user cpu time       0.01 seconds
      system cpu time     0.00 seconds
      memory              1328.34k
      OS Memory           37400.00k&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2023 19:59:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CAS-vs-SAS/m-p/876555#M346295</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-05-18T19:59:36Z</dc:date>
    </item>
  </channel>
</rss>

