<?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 Model Studio: How to access Interactive Grouping tables using code in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/Model-Studio-How-to-access-Interactive-Grouping-tables-using/m-p/706222#M8534</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We're converting material from Enterprise Miner over to Viya Model Studio. We have a custom SAS code node that reads information from a preceding Interactive Grouping node, to get the group labels for the groups created by the IG node.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To get this info in Miner, we use a table called something like &lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;ign_stats&lt;/FONT&gt;&lt;/STRONG&gt;.&amp;nbsp;I know this exists at least temporarily in Viya but I can't access it in code. Any ideas how I might find it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In Miner we used the code below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom.&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;PRE&gt;&lt;CODE class=" language-sas"&gt;%EM_PATH (nodeid=&amp;amp;em_nodeid. , outds=all_nodes , nodes=PATH);
data ign_node;
set all_nodes (where=(component="IGN"));
run;
data ign_node;
set ign_node;
by component;
if last.component;
run;
proc sql;
select nodelabel into :ign_nodeid from ign_node;
quit;
proc print data=&amp;amp;em_lib..%sysfunc(cats(%CMPRES(&amp;amp;ign_nodeid.),_stats));
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Dec 2020 06:47:41 GMT</pubDate>
    <dc:creator>tom_evans_79</dc:creator>
    <dc:date>2020-12-16T06:47:41Z</dc:date>
    <item>
      <title>Model Studio: How to access Interactive Grouping tables using code</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Model-Studio-How-to-access-Interactive-Grouping-tables-using/m-p/706222#M8534</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We're converting material from Enterprise Miner over to Viya Model Studio. We have a custom SAS code node that reads information from a preceding Interactive Grouping node, to get the group labels for the groups created by the IG node.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To get this info in Miner, we use a table called something like &lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;ign_stats&lt;/FONT&gt;&lt;/STRONG&gt;.&amp;nbsp;I know this exists at least temporarily in Viya but I can't access it in code. Any ideas how I might find it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In Miner we used the code below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom.&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;PRE&gt;&lt;CODE class=" language-sas"&gt;%EM_PATH (nodeid=&amp;amp;em_nodeid. , outds=all_nodes , nodes=PATH);
data ign_node;
set all_nodes (where=(component="IGN"));
run;
data ign_node;
set ign_node;
by component;
if last.component;
run;
proc sql;
select nodelabel into :ign_nodeid from ign_node;
quit;
proc print data=&amp;amp;em_lib..%sysfunc(cats(%CMPRES(&amp;amp;ign_nodeid.),_stats));
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 06:47:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Model-Studio-How-to-access-Interactive-Grouping-tables-using/m-p/706222#M8534</guid>
      <dc:creator>tom_evans_79</dc:creator>
      <dc:date>2020-12-16T06:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: Model Studio: How to access Interactive Grouping tables using code</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Model-Studio-How-to-access-Interactive-Grouping-tables-using/m-p/706328#M8535</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* SAS code */
/* Retrieve the id of the last Interactive Grouping node */
%let cs_guid=;
data _null_;
   set &amp;amp;dm_predecessors end=eof;
   where component='cs_ign';
   if eof then call symputx('cs_guid', guid);
run;
data _null_;
   folder = dcreate(strip(symget('cs_guid')), "&amp;amp;dmcas_workpath"); /* Create a folder to put all the files registered */
run;

/* Fetch all registered files under that node */
%dmcas_fetchRegistered(&amp;amp;cs_guid, &amp;amp;dmcas_workpath.&amp;amp;dm_dsep.&amp;amp;cs_guid);

/* Fetch from the dmcas_report table on the data sets */
libname cslib "&amp;amp;dmcas_workpath.&amp;amp;dm_dsep.&amp;amp;cs_guid";
data work.reportTables; 
   set cslib.dmcas_report;
    where upcase(name) in('DATASET', 'FILE');
run;
proc sort data=work.reportTables NODUPKEY;
   by VALUE;
run;
/* view the registered files for the node */
proc print data=work.reportTables;
run;

/* this is ign_stats data set */
proc print data=cslib.ign_stats; 
run;

libname cslib;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hi Tom - this code might be a bit of overkill since you know the data set that you want to access, but this should get you what you want I think.&lt;/P&gt;
&lt;P&gt;Hope that helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 15:25:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Model-Studio-How-to-access-Interactive-Grouping-tables-using/m-p/706328#M8535</guid>
      <dc:creator>WendyCzika</dc:creator>
      <dc:date>2020-12-16T15:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Model Studio: How to access Interactive Grouping tables using code</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Model-Studio-How-to-access-Interactive-Grouping-tables-using/m-p/706423#M8536</link>
      <description>&lt;P&gt;Since this question has come up before, this prompted me to add some example code to our GitHub repo:&amp;nbsp;&lt;A href="https://github.com/sassoftware/sas-viya-dmml-pipelines/tree/master/sas_code_node/access_data_from_predecessor" target="_blank" rel="noopener"&gt;https://github.com/sassoftware/sas-viya-dmml-pipelines/tree/master/sas_code_node/access_data_from_predecessor&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom, you can use the &lt;STRONG&gt;&lt;A class="js-navigation-open link-gray-dark" title="use_data_from_predecessor.sas" href="https://github.com/sassoftware/sas-viya-dmml-pipelines/blob/master/sas_code_node/access_data_from_predecessor/use_data_from_predecessor.sas" target="_blank"&gt;use_data_from_predecessor.sas&lt;/A&gt;&lt;/STRONG&gt;&amp;nbsp;one since you know the name of your data set is ign_stats, so just substitute that for &lt;STRONG&gt;xyz&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 19:37:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Model-Studio-How-to-access-Interactive-Grouping-tables-using/m-p/706423#M8536</guid>
      <dc:creator>WendyCzika</dc:creator>
      <dc:date>2020-12-16T19:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: Model Studio: How to access Interactive Grouping tables using code</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Model-Studio-How-to-access-Interactive-Grouping-tables-using/m-p/706540#M8537</link>
      <description>Super - thanks very much. It's that %dmcas_fetchRegistered macro that's the magic part.</description>
      <pubDate>Thu, 17 Dec 2020 06:54:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Model-Studio-How-to-access-Interactive-Grouping-tables-using/m-p/706540#M8537</guid>
      <dc:creator>tom_evans_79</dc:creator>
      <dc:date>2020-12-17T06:54:20Z</dc:date>
    </item>
  </channel>
</rss>

