<?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 PROC PYTHON vs. PROC LUA question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-PYTHON-vs-PROC-LUA-question/m-p/836498#M330741</link>
    <description>&lt;P&gt;Hi experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Question is for SAS Viya 2022.9&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In PROC LUA one could invoke SAS functions directly for example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc lua;&lt;BR /&gt;submit;&lt;BR /&gt;local dsid = sas.open("sashelp.class")&lt;BR /&gt;for row in dsid:rows() do&lt;BR /&gt;print(row.age, row.height)&lt;BR /&gt;end&lt;BR /&gt;dsid:close()&lt;BR /&gt;endsubmit;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am struggling to do the same with PROC PYTHON. For example to invoke the "sas.open" function I found only this way which is kind of cumbersome compared to PROC LUA:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dsid = SAS.sasfnc("open","sashelp.class")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I could not find the equivalent of "dsid:rows()" in PROC PYTHON.&lt;/P&gt;
&lt;P&gt;Am I missing something?&lt;/P&gt;</description>
    <pubDate>Mon, 03 Oct 2022 11:53:06 GMT</pubDate>
    <dc:creator>EyalGonen</dc:creator>
    <dc:date>2022-10-03T11:53:06Z</dc:date>
    <item>
      <title>PROC PYTHON vs. PROC LUA question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-PYTHON-vs-PROC-LUA-question/m-p/836498#M330741</link>
      <description>&lt;P&gt;Hi experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Question is for SAS Viya 2022.9&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In PROC LUA one could invoke SAS functions directly for example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc lua;&lt;BR /&gt;submit;&lt;BR /&gt;local dsid = sas.open("sashelp.class")&lt;BR /&gt;for row in dsid:rows() do&lt;BR /&gt;print(row.age, row.height)&lt;BR /&gt;end&lt;BR /&gt;dsid:close()&lt;BR /&gt;endsubmit;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am struggling to do the same with PROC PYTHON. For example to invoke the "sas.open" function I found only this way which is kind of cumbersome compared to PROC LUA:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dsid = SAS.sasfnc("open","sashelp.class")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I could not find the equivalent of "dsid:rows()" in PROC PYTHON.&lt;/P&gt;
&lt;P&gt;Am I missing something?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 11:53:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-PYTHON-vs-PROC-LUA-question/m-p/836498#M330741</guid>
      <dc:creator>EyalGonen</dc:creator>
      <dc:date>2022-10-03T11:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PYTHON vs. PROC LUA question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-PYTHON-vs-PROC-LUA-question/m-p/836508#M330746</link>
      <description>&lt;P&gt;For actions specific to working with a data table, I think you would use&amp;nbsp;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_031/proc/n1x71i41z1ewqsn19j6k9jxoi5fa.htm" target="_self"&gt;&lt;STRONG&gt;SAS.sd2df&lt;/STRONG&gt; to convert the data set&lt;/A&gt; into a pandas data frame, and then use the Python friendly data frame methods.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise, yes -- I think the way to invoke SAS functions generically from Python is the SAS.sasfnc method -- there isn't a Python-specific wrapper for each SAS function (or even the most commonly used ones).&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 13:01:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-PYTHON-vs-PROC-LUA-question/m-p/836508#M330746</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2022-10-03T13:01:00Z</dc:date>
    </item>
  </channel>
</rss>

