<?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 DI studio: User written code - Adding a couple of new variables that do not get added to out in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-studio-User-written-code-Adding-a-couple-of-new-variables/m-p/820515#M20413</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/428067"&gt;@Zeus_Olympus&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The columns in SAS metadata (what you see in DI Studio) has no direct connection to the actual columns in the physical data set. When you open a table in DI Studio, if fails if any metadata column is not present in the physical data set, but if all columns exist, the values are shown. But there might be opher columns in the physical data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suppose you have mapped the columns in the User Written transformation, added the code and run the job. So you see the input vaiables, but not the new variables.&amp;nbsp;After first run of a user written transformation, ALWAYS right click on the output table and select "&lt;STRONG&gt;update metadata&lt;/STRONG&gt;". Then you should have the new variables as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jun 2022 12:24:25 GMT</pubDate>
    <dc:creator>ErikLund_Jensen</dc:creator>
    <dc:date>2022-06-27T12:24:25Z</dc:date>
    <item>
      <title>SAS DI studio: User written code - Adding a couple of new variables that do not get added to output</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-studio-User-written-code-Adding-a-couple-of-new-variables/m-p/820503#M20412</link>
      <description>&lt;P&gt;Hi dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I import CARS_NEW into SAS DI.&lt;/P&gt;&lt;P&gt;I need a couple of variables to be added to the output table.&lt;/P&gt;&lt;P&gt;I add the below code to the "User-Written Transformation".&lt;/P&gt;&lt;P&gt;====&lt;/P&gt;&lt;P&gt;data &amp;amp;_output;&lt;BR /&gt;retain Ex_Date dsname;&lt;BR /&gt;set &amp;amp;_input indsname=source;&lt;/P&gt;&lt;P&gt;dsname=scan(source,2,'.');&lt;/P&gt;&lt;P&gt;format Ex_Date yymmddn8.;&lt;BR /&gt;Ex_Date=mdy(6,20,2020);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;====&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The transformation runs without errors but the new variables are not getting added to the output table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate any suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&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="Zeus_Olympus_0-1656329161469.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72756i0B8FDBB0FB3960AE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Zeus_Olympus_0-1656329161469.png" alt="Zeus_Olympus_0-1656329161469.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Zeus_Olympus_0-1656329651051.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72757iA23944B58B1489FA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Zeus_Olympus_0-1656329651051.png" alt="Zeus_Olympus_0-1656329651051.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 11:34:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-studio-User-written-code-Adding-a-couple-of-new-variables/m-p/820503#M20412</guid>
      <dc:creator>Zeus_Olympus</dc:creator>
      <dc:date>2022-06-27T11:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI studio: User written code - Adding a couple of new variables that do not get added to out</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-studio-User-written-code-Adding-a-couple-of-new-variables/m-p/820515#M20413</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/428067"&gt;@Zeus_Olympus&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The columns in SAS metadata (what you see in DI Studio) has no direct connection to the actual columns in the physical data set. When you open a table in DI Studio, if fails if any metadata column is not present in the physical data set, but if all columns exist, the values are shown. But there might be opher columns in the physical data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suppose you have mapped the columns in the User Written transformation, added the code and run the job. So you see the input vaiables, but not the new variables.&amp;nbsp;After first run of a user written transformation, ALWAYS right click on the output table and select "&lt;STRONG&gt;update metadata&lt;/STRONG&gt;". Then you should have the new variables as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 12:24:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-studio-User-written-code-Adding-a-couple-of-new-variables/m-p/820515#M20413</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2022-06-27T12:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI studio: User written code - Adding a couple of new variables that do not get added to out</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-studio-User-written-code-Adding-a-couple-of-new-variables/m-p/820536#M20414</link>
      <description>&lt;P&gt;One downside of using user written is the manual management of metdata, like&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12887"&gt;@ErikLund_Jensen&lt;/a&gt;&amp;nbsp;points out.&lt;/P&gt;
&lt;P&gt;For your use case, I see no point of using user written, an Extract could suffice (by using &amp;amp;_input instead of indsname in the mapping). By doing so, you get the metadata updated OOTB.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 15:11:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-studio-User-written-code-Adding-a-couple-of-new-variables/m-p/820536#M20414</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2022-06-27T15:11:16Z</dc:date>
    </item>
  </channel>
</rss>

