<?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: SAS Intelligent Decisioning: How to dynamically increment numeric datagrid variable in Developers</title>
    <link>https://communities.sas.com/t5/Developers/SAS-Intelligent-Decisioning-How-to-dynamically-increment-numeric/m-p/773322#M1304</link>
    <description>&lt;P&gt;In this case, the grid variable is the only result.&lt;/P&gt;&lt;P&gt;My original question tends to change to how to properly implement a _N_ equivalent using DS2...&lt;/P&gt;</description>
    <pubDate>Mon, 11 Oct 2021 07:41:08 GMT</pubDate>
    <dc:creator>KidCat</dc:creator>
    <dc:date>2021-10-11T07:41:08Z</dc:date>
    <item>
      <title>SAS Intelligent Decisioning: How to dynamically increment numeric datagrid variable</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Intelligent-Decisioning-How-to-dynamically-increment-numeric/m-p/772395#M1300</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote some DS2 package code, working fine except for one tiny thing.&lt;/P&gt;&lt;P&gt;The "method execute" part creates a datagrid variable MYRESULT.&lt;/P&gt;&lt;P&gt;Depending on some if-then-elses, I would like to populate this datagrid variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dcl double Row_Num ;&lt;/P&gt;&lt;P&gt;datagrid_addcharactercolumn(MYRESULT, '1st_Col');&lt;/P&gt;&lt;P&gt;datagrid_addcharactercolumn(MYRESULT, '2nd_Col');&lt;/P&gt;&lt;P&gt;datagrid_addcharactercolumn(MYRESULT, '3rd_Col');&lt;/P&gt;&lt;P&gt;datagrid_addnumericcolumn(MYRESULT, 'Row_Num');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(...)&lt;/P&gt;&lt;P&gt;if doh-doh-doh then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Row_num=datagrid_addrow("MYRESULT");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; datagrid_set('MYRESULT', '1st_Col', Row_Num, 'MyEntry1'));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; datagrid_set('MYRESULT', '2nd_Col', Row_Num, 'MyEntry2');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; datagrid_set('MYRESULT', '3rd_Col', Row_Num, 'MyEntry3');&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;(...)&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;if dah-dah-dah then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Row_num=datagrid_addrow("MYRESULT");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; datagrid_set('MYRESULT', '1st_Col', Row_Num, 'MyEntry1'));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; datagrid_set('MYRESULT', '2nd_Col', Row_Num, 'MyEntry2');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; datagrid_set('MYRESULT', '3rd_Col', Row_Num, 'MyEntry3');&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DS2 creates MYRESULT and four columns.&lt;/P&gt;&lt;P&gt;Assuming these two conditions apply,&amp;nbsp; I'd expect Row_Num to be populated with 1 and 2.&lt;/P&gt;&lt;P&gt;However, it's empty. Any idea why?&lt;/P&gt;&lt;P&gt;Any pointer appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 10:21:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Intelligent-Decisioning-How-to-dynamically-increment-numeric/m-p/772395#M1300</guid>
      <dc:creator>KidCat</dc:creator>
      <dc:date>2021-10-06T10:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Intelligent Decisioning: How to dynamically increment numeric datagrid variable</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Intelligent-Decisioning-How-to-dynamically-increment-numeric/m-p/772402#M1301</link>
      <description>&lt;P&gt;Return data type for&amp;nbsp;DATAGRID_ADDROW function is integer. You have declared&amp;nbsp;Row_Num variable as a double. Please change data type and try again.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 11:30:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Intelligent-Decisioning-How-to-dynamically-increment-numeric/m-p/772402#M1301</guid>
      <dc:creator>alexal</dc:creator>
      <dc:date>2021-10-06T11:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Intelligent Decisioning: How to dynamically increment numeric datagrid variable</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Intelligent-Decisioning-How-to-dynamically-increment-numeric/m-p/772961#M1302</link>
      <description>&lt;P&gt;Adjusting to integer didn't solve the issue.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 08:47:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Intelligent-Decisioning-How-to-dynamically-increment-numeric/m-p/772961#M1302</guid>
      <dc:creator>KidCat</dc:creator>
      <dc:date>2021-10-08T08:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Intelligent Decisioning: How to dynamically increment numeric datagrid variable</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Intelligent-Decisioning-How-to-dynamically-increment-numeric/m-p/773020#M1303</link>
      <description>&lt;P&gt;Try to print it before inserting to the data grid. Do you see anything there?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 12:27:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Intelligent-Decisioning-How-to-dynamically-increment-numeric/m-p/773020#M1303</guid>
      <dc:creator>alexal</dc:creator>
      <dc:date>2021-10-08T12:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Intelligent Decisioning: How to dynamically increment numeric datagrid variable</title>
      <link>https://communities.sas.com/t5/Developers/SAS-Intelligent-Decisioning-How-to-dynamically-increment-numeric/m-p/773322#M1304</link>
      <description>&lt;P&gt;In this case, the grid variable is the only result.&lt;/P&gt;&lt;P&gt;My original question tends to change to how to properly implement a _N_ equivalent using DS2...&lt;/P&gt;</description>
      <pubDate>Mon, 11 Oct 2021 07:41:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-Intelligent-Decisioning-How-to-dynamically-increment-numeric/m-p/773322#M1304</guid>
      <dc:creator>KidCat</dc:creator>
      <dc:date>2021-10-11T07:41:08Z</dc:date>
    </item>
  </channel>
</rss>

