<?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 Query in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-a-new-variable-with-custom-text/m-p/384877#M91986</link>
    <description>&lt;P&gt;This is the simplest way&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
input staff house car;
cards;
1234 1 0
2234 5 1
3234 2 2
;
run;

data b(drop=house car);
	length staff 8 remarks $17;
	set a;
	remarks=cat(house,' house and ',car,' car');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 02 Aug 2017 08:01:58 GMT</pubDate>
    <dc:creator>ChrisBrooks</dc:creator>
    <dc:date>2017-08-02T08:01:58Z</dc:date>
    <item>
      <title>Create a new variable with custom text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-new-variable-with-custom-text/m-p/384870#M91981</link>
      <description>&lt;P&gt;I have the following codes, may i know how to get the following remarks?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any idea? Thanks.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data a;&lt;BR /&gt;input staff house car;&lt;BR /&gt;cards;&lt;BR /&gt;1234 1 0&lt;BR /&gt;2234 5 1&lt;BR /&gt;3234 2 2&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Desired result&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Staff&amp;nbsp;&amp;nbsp; Remarks&lt;/P&gt;
&lt;P&gt;1234&amp;nbsp; 1 house and 0 car&lt;/P&gt;
&lt;P&gt;2234&amp;nbsp; 5 house and 1 car&lt;/P&gt;
&lt;P&gt;3234&amp;nbsp; 2 house and 2 car&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 14:30:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-new-variable-with-custom-text/m-p/384870#M91981</guid>
      <dc:creator>scb</dc:creator>
      <dc:date>2017-08-02T14:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-new-variable-with-custom-text/m-p/384874#M91984</link>
      <description>&lt;P&gt;This is fairly simple to do in SAS. But I have to ask why you want a variable with a much more complicated string containing information that you already have in your dataset? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 07:59:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-new-variable-with-custom-text/m-p/384874#M91984</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-08-02T07:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-new-variable-with-custom-text/m-p/384875#M91985</link>
      <description>&lt;P&gt;All you need is to concatenate the given data with some literals:&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; remarks = catx(' ',staff,'house and',car,'car');&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; /* or: &amp;nbsp;remarks = left(staf) || ' house and ' || left(car) || ' car'; &amp;nbsp;*/&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 08:00:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-new-variable-with-custom-text/m-p/384875#M91985</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-08-02T08:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-new-variable-with-custom-text/m-p/384877#M91986</link>
      <description>&lt;P&gt;This is the simplest way&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
input staff house car;
cards;
1234 1 0
2234 5 1
3234 2 2
;
run;

data b(drop=house car);
	length staff 8 remarks $17;
	set a;
	remarks=cat(house,' house and ',car,' car');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Aug 2017 08:01:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-new-variable-with-custom-text/m-p/384877#M91986</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2017-08-02T08:01:58Z</dc:date>
    </item>
  </channel>
</rss>

