<?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 Data manage in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Data-manage/m-p/388674#M93211</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dear expert,&lt;/P&gt;&lt;P&gt;I got an uneasy task. I have two columns of data say X1 and X2 each in 3 digits but assigned as characters. Each column has over 6000 rows. I need to physically combine X1 and X2 and make them six digits. First X1 with X2 and then X2 with X1. I could do that by CATT function, and the product is like X12 and X21. This is how it becomes:&lt;/P&gt;&lt;P&gt;X1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X2&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; X12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X21&lt;/P&gt;&lt;P&gt;361 &amp;nbsp; 362&amp;nbsp;&amp;nbsp; 361362&amp;nbsp;&amp;nbsp;&amp;nbsp; 362361&lt;/P&gt;&lt;P&gt;845&amp;nbsp; 846&amp;nbsp;&amp;nbsp;&amp;nbsp; 845846&amp;nbsp;&amp;nbsp;&amp;nbsp; 846845&lt;/P&gt;&lt;P&gt;846&amp;nbsp; 845&amp;nbsp;&amp;nbsp;&amp;nbsp; 846845&amp;nbsp;&amp;nbsp;&amp;nbsp; 845846&lt;/P&gt;&lt;P&gt;845&amp;nbsp; 846&amp;nbsp; &amp;nbsp; 845846&amp;nbsp;&amp;nbsp;&amp;nbsp; 846845&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now the problem is, I need to count X12 or X21 in such a way that 845846 and 846845 are considerd exactly same. So in the above example, the entry 845846 should count 3 not 2 or 1. PROC FREQ for X12 or X21 would count only 2 or 1 respectively. I tried defining like:&lt;/P&gt;&lt;P&gt;if X12=845846 and X21=846845 then X21=X12;&lt;/P&gt;&lt;P&gt;it works with PROC FREQ of X21, but to write for each of the 6000 entries is almost impossible, if not impossible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would be very grateful if any kind soul can help me out with an better easier solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Sijansap&lt;/P&gt;</description>
    <pubDate>Thu, 17 Aug 2017 01:56:47 GMT</pubDate>
    <dc:creator>sijansap</dc:creator>
    <dc:date>2017-08-17T01:56:47Z</dc:date>
    <item>
      <title>Data manage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-manage/m-p/388674#M93211</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dear expert,&lt;/P&gt;&lt;P&gt;I got an uneasy task. I have two columns of data say X1 and X2 each in 3 digits but assigned as characters. Each column has over 6000 rows. I need to physically combine X1 and X2 and make them six digits. First X1 with X2 and then X2 with X1. I could do that by CATT function, and the product is like X12 and X21. This is how it becomes:&lt;/P&gt;&lt;P&gt;X1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X2&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; X12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X21&lt;/P&gt;&lt;P&gt;361 &amp;nbsp; 362&amp;nbsp;&amp;nbsp; 361362&amp;nbsp;&amp;nbsp;&amp;nbsp; 362361&lt;/P&gt;&lt;P&gt;845&amp;nbsp; 846&amp;nbsp;&amp;nbsp;&amp;nbsp; 845846&amp;nbsp;&amp;nbsp;&amp;nbsp; 846845&lt;/P&gt;&lt;P&gt;846&amp;nbsp; 845&amp;nbsp;&amp;nbsp;&amp;nbsp; 846845&amp;nbsp;&amp;nbsp;&amp;nbsp; 845846&lt;/P&gt;&lt;P&gt;845&amp;nbsp; 846&amp;nbsp; &amp;nbsp; 845846&amp;nbsp;&amp;nbsp;&amp;nbsp; 846845&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now the problem is, I need to count X12 or X21 in such a way that 845846 and 846845 are considerd exactly same. So in the above example, the entry 845846 should count 3 not 2 or 1. PROC FREQ for X12 or X21 would count only 2 or 1 respectively. I tried defining like:&lt;/P&gt;&lt;P&gt;if X12=845846 and X21=846845 then X21=X12;&lt;/P&gt;&lt;P&gt;it works with PROC FREQ of X21, but to write for each of the 6000 entries is almost impossible, if not impossible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would be very grateful if any kind soul can help me out with an better easier solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Sijansap&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 01:56:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-manage/m-p/388674#M93211</guid>
      <dc:creator>sijansap</dc:creator>
      <dc:date>2017-08-17T01:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Data manage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-manage/m-p/388680#M93212</link>
      <description>&lt;P&gt;Create a sorted version of your concatenated variable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if X1 &amp;lt; X2 then sX12 = catt(X1, X2);
else sX12 = catt(X2, X1); &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;then do your freq count on sX12.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 02:43:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-manage/m-p/388680#M93212</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-08-17T02:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: Data manage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-manage/m-p/388765#M93240</link>
      <description>&lt;P&gt;Thank you very much PGStats. The only problem&amp;nbsp;could be -&amp;nbsp;even though they are digits but they are considered as characters&amp;nbsp;since some of them start like 001, 020 etc. Anyway, I like your idea of sorted CATT and the comparing the values between X1 and X2. I certainly appreciate your suggestion and will try it out.&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 12:56:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-manage/m-p/388765#M93240</guid>
      <dc:creator>sijansap</dc:creator>
      <dc:date>2017-08-17T12:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Data manage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-manage/m-p/389001#M93270</link>
      <description>&lt;P&gt;Thanks again PGStats.&lt;/P&gt;&lt;P&gt;I switched X1 and X2 in the inequality to preseve zeroes, and worked perfectly.&lt;/P&gt;&lt;P&gt;I truly appreciate your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sijansap&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2017 00:12:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-manage/m-p/389001#M93270</guid>
      <dc:creator>sijansap</dc:creator>
      <dc:date>2017-08-18T00:12:04Z</dc:date>
    </item>
  </channel>
</rss>

