<?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 How to reject variables in SAS Model Studio via code (without using Manage Variables manually) in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/How-to-reject-variables-in-SAS-Model-Studio-via-code-without/m-p/972889#M2966</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I spent quite some time searching for a way to &lt;U&gt;reject&lt;/U&gt; variables in SAS Model Studio using code, but I couldn’t find anything that explained it directly. That’s why I’m sharing it here.&lt;/P&gt;&lt;P&gt;It turns out the solution is actually very simple. You can change the &lt;EM&gt;role&lt;/EM&gt; of variables without altering the original dataset or going through &lt;STRONG&gt;&lt;EM&gt;Manage Variables&lt;/EM&gt;&lt;/STRONG&gt;.&amp;nbsp; It’s also much easier to reject &lt;STRONG&gt;dozens&lt;/STRONG&gt; of variables this way, instead of manually selecting them one by one in &lt;EM&gt;Manage Variables&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;Just use the following macro for each variable you want to adjust:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;PRE class=""&gt;&lt;CODE class=""&gt;&lt;SPAN&gt;%dmcas_metaChange(NAME=var_1, ROLE=REJECTED);&lt;/SPAN&gt;&lt;/CODE&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This makes it possible to reuse the same table across different pipelines while still controlling which variables are included or excluded in each specific flow.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="beatrizlima_0-1755622439584.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/109100i1DAC87B36DBC294C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="beatrizlima_0-1755622439584.png" alt="beatrizlima_0-1755622439584.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this image, it is possible to see a simple pipeline that compares two models: one with all variables and the other with some rejected variables.&lt;BR /&gt;Hope this helps some one!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Aug 2025 16:57:18 GMT</pubDate>
    <dc:creator>beatrizlima</dc:creator>
    <dc:date>2025-08-19T16:57:18Z</dc:date>
    <item>
      <title>How to reject variables in SAS Model Studio via code (without using Manage Variables manually)</title>
      <link>https://communities.sas.com/t5/SAS-Viya/How-to-reject-variables-in-SAS-Model-Studio-via-code-without/m-p/972889#M2966</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I spent quite some time searching for a way to &lt;U&gt;reject&lt;/U&gt; variables in SAS Model Studio using code, but I couldn’t find anything that explained it directly. That’s why I’m sharing it here.&lt;/P&gt;&lt;P&gt;It turns out the solution is actually very simple. You can change the &lt;EM&gt;role&lt;/EM&gt; of variables without altering the original dataset or going through &lt;STRONG&gt;&lt;EM&gt;Manage Variables&lt;/EM&gt;&lt;/STRONG&gt;.&amp;nbsp; It’s also much easier to reject &lt;STRONG&gt;dozens&lt;/STRONG&gt; of variables this way, instead of manually selecting them one by one in &lt;EM&gt;Manage Variables&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;Just use the following macro for each variable you want to adjust:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;PRE class=""&gt;&lt;CODE class=""&gt;&lt;SPAN&gt;%dmcas_metaChange(NAME=var_1, ROLE=REJECTED);&lt;/SPAN&gt;&lt;/CODE&gt;&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This makes it possible to reuse the same table across different pipelines while still controlling which variables are included or excluded in each specific flow.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="beatrizlima_0-1755622439584.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/109100i1DAC87B36DBC294C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="beatrizlima_0-1755622439584.png" alt="beatrizlima_0-1755622439584.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this image, it is possible to see a simple pipeline that compares two models: one with all variables and the other with some rejected variables.&lt;BR /&gt;Hope this helps some one!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Aug 2025 16:57:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/How-to-reject-variables-in-SAS-Model-Studio-via-code-without/m-p/972889#M2966</guid>
      <dc:creator>beatrizlima</dc:creator>
      <dc:date>2025-08-19T16:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to reject variables in SAS Model Studio via code (without using Manage Variables manually)</title>
      <link>https://communities.sas.com/t5/SAS-Viya/How-to-reject-variables-in-SAS-Model-Studio-via-code-without/m-p/972894#M2967</link>
      <description>&lt;P&gt;&lt;A href="https://support.sas.com/kb/54/620.html" target="_blank"&gt;54620 - Use a Manage Variables node or a %dmcas_metaChange macro invocation instead of dropping variables using a DATA step in a SAS® Code node&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Aug 2025 18:25:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/How-to-reject-variables-in-SAS-Model-Studio-via-code-without/m-p/972894#M2967</guid>
      <dc:creator>beatrizlima</dc:creator>
      <dc:date>2025-08-19T18:25:45Z</dc:date>
    </item>
  </channel>
</rss>

