<?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: Editing data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Editing-data/m-p/453162#M114476</link>
    <description>&lt;P&gt;I would suggest you follow the SAS provided video help and read some tutorials.&amp;nbsp; You create variables in datasteps, applying data is simple, and depends very much on what you want to do, which you haven't told us.&amp;nbsp; Say I want to create a variable b based on a, 1=a, 2=b then:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  if a=1 then b="a";
  if a=2 then b="b";
run;&lt;/PRE&gt;</description>
    <pubDate>Wed, 11 Apr 2018 12:19:40 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-04-11T12:19:40Z</dc:date>
    <item>
      <title>Editing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Editing-data/m-p/453153#M114472</link>
      <description>&lt;P&gt;Hi! i'm new to sas.&lt;/P&gt;&lt;P&gt;So if I have a data set, but I want to add a new variable with user defined values, how can I do that?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 11:57:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Editing-data/m-p/453153#M114472</guid>
      <dc:creator>Saurabh247</dc:creator>
      <dc:date>2018-04-11T11:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: Editing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Editing-data/m-p/453157#M114474</link>
      <description>&lt;P&gt;Just define LENGTH and name of the new varaible, then assign the value you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; length new_var&amp;nbsp; &amp;lt;$d&amp;nbsp; or d - where d is length in digits, $ for char variable&amp;gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;new_var = &amp;lt;any value&amp;gt;;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or you can use sql:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;create tabe want&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;as select *,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;lt;value&amp;gt; as new_var&lt;/P&gt;
&lt;P&gt;from have;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 12:17:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Editing-data/m-p/453157#M114474</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-04-11T12:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Editing data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Editing-data/m-p/453162#M114476</link>
      <description>&lt;P&gt;I would suggest you follow the SAS provided video help and read some tutorials.&amp;nbsp; You create variables in datasteps, applying data is simple, and depends very much on what you want to do, which you haven't told us.&amp;nbsp; Say I want to create a variable b based on a, 1=a, 2=b then:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  if a=1 then b="a";
  if a=2 then b="b";
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Apr 2018 12:19:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Editing-data/m-p/453162#M114476</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-04-11T12:19:40Z</dc:date>
    </item>
  </channel>
</rss>

