<?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: concatenation variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/concatenation-variables/m-p/406257#M98877</link>
    <description>&lt;P&gt;this way u are saying sir ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data =car_sales_new out=car_sales_new NODUPKEY ;&lt;/P&gt;&lt;P&gt;by Manufacturer;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data car_sales_new;&lt;/P&gt;&lt;P&gt;set _class_s.car_sales;&lt;/P&gt;&lt;P&gt;length uniqueID $50;&lt;/P&gt;&lt;P&gt;uniqueID = catx("Manfmod", Model,Manufacturer);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasWarning"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Sat, 21 Oct 2017 15:12:40 GMT</pubDate>
    <dc:creator>mehak</dc:creator>
    <dc:date>2017-10-21T15:12:40Z</dc:date>
    <item>
      <title>concatenation variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenation-variables/m-p/406245#M98872</link>
      <description>&lt;P&gt;can any 1 please tell me is this a correct way to create a unique id using 2 variables??????&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data car_sales_new;&lt;BR /&gt;set _class_s.car_sales;&lt;BR /&gt;length uniqueID $30;&lt;BR /&gt;uniqueID = catx("111", Model,Manufacturer);&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Oct 2017 13:47:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenation-variables/m-p/406245#M98872</guid>
      <dc:creator>mehak</dc:creator>
      <dc:date>2017-10-21T13:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: concatenation variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenation-variables/m-p/406250#M98873</link>
      <description>&lt;P&gt;You'll have to explain the problem in more detail.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We don't know what you mean by "unique".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We don't know what result you want to get.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And what happens when you run this code, why are you dissatisfied with it?&lt;/P&gt;</description>
      <pubDate>Sat, 21 Oct 2017 14:19:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenation-variables/m-p/406250#M98873</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-10-21T14:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: concatenation variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenation-variables/m-p/406251#M98874</link>
      <description>&lt;P&gt;A unique ID depends on the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Concatenation "111" to all observations does not contribute to uniqueness.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If a model has submodels then concatenating model with manufacturer will not give a unique ID.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can check uniqueness by:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have out=test NODUPKEY;
    by &amp;lt;key variables&amp;gt;;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If there are 0 deleted observations then the combination given by &amp;lt;key variables&amp;gt; is unique.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Oct 2017 14:20:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenation-variables/m-p/406251#M98874</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-10-21T14:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: concatenation variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenation-variables/m-p/406257#M98877</link>
      <description>&lt;P&gt;this way u are saying sir ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data =car_sales_new out=car_sales_new NODUPKEY ;&lt;/P&gt;&lt;P&gt;by Manufacturer;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data car_sales_new;&lt;/P&gt;&lt;P&gt;set _class_s.car_sales;&lt;/P&gt;&lt;P&gt;length uniqueID $50;&lt;/P&gt;&lt;P&gt;uniqueID = catx("Manfmod", Model,Manufacturer);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasWarning"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Sat, 21 Oct 2017 15:12:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenation-variables/m-p/406257#M98877</guid>
      <dc:creator>mehak</dc:creator>
      <dc:date>2017-10-21T15:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: concatenation variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenation-variables/m-p/406260#M98878</link>
      <description>&lt;P&gt;Have you run the sort ? Did you get 0 deleted observations ? - Probably NOT&lt;/P&gt;
&lt;P&gt;because you sort by manufacturer only, and most of them have more than one model !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should sort &lt;STRONG&gt;by manufactrer model&lt;/STRONG&gt;; and if you get 0 deleted obs then those two variables&amp;nbsp;&lt;/P&gt;
&lt;P&gt;combine a unique key.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding your 2nd step, the statement:&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;uniqueID = catx("Manfmod", Model,Manufacturer);&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;will result in your 1st row into:&amp;nbsp; "&lt;STRONG&gt;I&lt;/STRONG&gt;ntegra&lt;STRONG&gt;M&lt;/STRONG&gt;anfmod&lt;STRONG&gt;A&lt;/STRONG&gt;cura" - is that what you want ?&lt;/P&gt;
&lt;P&gt;If you cahnge it to:&amp;nbsp;&lt;SPAN&gt;uniqueID = catx(&lt;FONT color="#FF0000"&gt;"&lt;STRONG&gt;-&lt;/STRONG&gt;"&lt;/FONT&gt;, Model,Manufacturer); you will get&amp;nbsp;&amp;nbsp;"&lt;STRONG&gt;I&lt;/STRONG&gt;ntegra&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;-&lt;/FONT&gt;A&lt;/STRONG&gt;cura";&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Or maybe you intended to write:&amp;nbsp;&lt;STRONG&gt; Manfmod = catx('-',Manufacturer,Model);&amp;nbsp;&lt;/STRONG&gt;to get Manfmod = "Acura-Integra" ???&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you want the output to be sorted by the created unique key then&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;sort by same order of variables as in concatenation (left to right).&lt;/SPAN&gt;&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;</description>
      <pubDate>Sat, 21 Oct 2017 15:50:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenation-variables/m-p/406260#M98878</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-10-21T15:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: concatenation variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenation-variables/m-p/406263#M98880</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After&amp;nbsp;&amp;nbsp;sorting&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;by manufactrer model&lt;/STRONG&gt;; &amp;nbsp;getting 0 deleted obs then i have&amp;nbsp; two variables&amp;nbsp;&lt;/P&gt;&lt;P&gt;combine a unique key.&lt;/P&gt;&lt;P&gt;&amp;nbsp;uniqueID = catx("-", Model,Manufacturer);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Solved the answer thankyou so much&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Oct 2017 16:17:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenation-variables/m-p/406263#M98880</guid>
      <dc:creator>mehak</dc:creator>
      <dc:date>2017-10-21T16:17:15Z</dc:date>
    </item>
  </channel>
</rss>

