<?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: data cleaning from text file in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/data-cleaning-from-text-file/m-p/276731#M7814</link>
    <description>&lt;P&gt;&lt;SPAN&gt;1.what if we have more columns because we cant type all the names if we have more than some 60 variables know.can we directly take the variable names from the datasets?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No. You can't. How do know which word is the variable name, Do you have any pattern to match variable name ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Typing the variable name you want in the following code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt; &lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; temp &lt;SPAN class="token operator"&gt;in&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'id'&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'sponsor_name'&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'company'&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'type'&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'codeno'&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'place'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;group&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;+&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2.if the data consists firstname and last name how to overcome from that?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Give us an example ? Data and Output.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 12 Jun 2016 03:29:30 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-06-12T03:29:30Z</dc:date>
    <item>
      <title>data cleaning from text file</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/data-cleaning-from-text-file/m-p/276705#M7810</link>
      <description>&lt;P&gt;hello guys i need a help here. i am struck here.&lt;/P&gt;&lt;P&gt;i have datasetlike this in text file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;id&lt;/STRONG&gt; &amp;nbsp; &amp;nbsp;12 &amp;nbsp;13 14 15 16 &amp;nbsp; &amp;nbsp; &amp;nbsp; 17 18 19 20 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt; sponsor name&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp; jijo &amp;nbsp;joseph &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; shashank vaibhav &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;STRONG&gt;company&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;mindtree &amp;nbsp; &amp;nbsp; acc wipro infosys&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;type &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/STRONG&gt; analytics Vba &amp;nbsp; &amp;nbsp; &amp;nbsp;sas r &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;codeno&amp;nbsp;&lt;/STRONG&gt; frg7325 &amp;nbsp; &amp;nbsp; &amp;nbsp;aw33 sfsdf34 &amp;nbsp; &amp;nbsp; &amp;nbsp; sdfs5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;place&lt;/STRONG&gt; kormangala &amp;nbsp; &amp;nbsp; &amp;nbsp; mgroad &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mejestic&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where it it not formatted properly.so i want this to be look like&lt;/P&gt;&lt;P&gt;id &amp;nbsp; &amp;nbsp; sponsor name &amp;nbsp; &amp;nbsp; company &amp;nbsp; &amp;nbsp; type &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; code_no &amp;nbsp; &amp;nbsp; place&lt;/P&gt;&lt;P&gt;12 &amp;nbsp; jijo joseph &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mindtree &amp;nbsp; &amp;nbsp; analytics &amp;nbsp; &amp;nbsp; &amp;nbsp;frg7325 &amp;nbsp; &amp;nbsp; &amp;nbsp;kormangala&amp;nbsp;&lt;/P&gt;&lt;P&gt;13 &amp;nbsp; &amp;nbsp;shashank &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; acc &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;vba &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;aw33 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mgroad&lt;/P&gt;&lt;P&gt;so on.............&lt;/P&gt;&lt;P&gt;please someone help me out in this i need this solution&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;&lt;P&gt;i have attached the dataset here someone check it and give me the solution please&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jun 2016 17:21:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/data-cleaning-from-text-file/m-p/276705#M7810</guid>
      <dc:creator>naveen-kumar11</dc:creator>
      <dc:date>2016-06-11T17:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: data cleaning from text file</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/data-cleaning-from-text-file/m-p/276715#M7811</link>
      <description>&lt;P&gt;How do you know what lines up with what in the text file?&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jun 2016 20:21:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/data-cleaning-from-text-file/m-p/276715#M7811</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-11T20:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: data cleaning from text file</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/data-cleaning-from-text-file/m-p/276727#M7812</link>
      <description>&lt;P&gt;That is totally messed up .&lt;/P&gt;
&lt;P&gt;UPDATED.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
infile '/folders/myfolders/test4.txt' recfm=n dlm='200D0A'x;
input temp : $100. @@;
run;

data temp;
 set have;
 if temp in ('id' 'sponsor_name' 'company' 'type' 'codeno' 'place') then group+1;
run;
proc transpose data=temp out=x(rename=(col1=id));
by group;
var temp;
run;
proc transpose data=x out=want(drop=_name_);
id id;
var col:;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 12 Jun 2016 02:46:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/data-cleaning-from-text-file/m-p/276727#M7812</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-06-12T02:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: data cleaning from text file</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/data-cleaning-from-text-file/m-p/276729#M7813</link>
      <description>&lt;P&gt;thankyou for the answer that works fine but i havetwo problems with it.&lt;/P&gt;&lt;P&gt;1.what if we have more columns because we cant type all the names if we have more than some 60 variables know.can we directly take the variable names from the datasets?&lt;/P&gt;&lt;P&gt;2.if the data consists firstname and last name how to overcome from that?&lt;/P&gt;&lt;P&gt;but thakyou for giving the reply&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jun 2016 03:05:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/data-cleaning-from-text-file/m-p/276729#M7813</guid>
      <dc:creator>naveen-kumar11</dc:creator>
      <dc:date>2016-06-12T03:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: data cleaning from text file</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/data-cleaning-from-text-file/m-p/276731#M7814</link>
      <description>&lt;P&gt;&lt;SPAN&gt;1.what if we have more columns because we cant type all the names if we have more than some 60 variables know.can we directly take the variable names from the datasets?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No. You can't. How do know which word is the variable name, Do you have any pattern to match variable name ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Typing the variable name you want in the following code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt; &lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; temp &lt;SPAN class="token operator"&gt;in&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'id'&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'sponsor_name'&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'company'&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'type'&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'codeno'&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'place'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;group&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;+&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2.if the data consists firstname and last name how to overcome from that?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Give us an example ? Data and Output.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jun 2016 03:29:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/data-cleaning-from-text-file/m-p/276731#M7814</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-06-12T03:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: data cleaning from text file</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/data-cleaning-from-text-file/m-p/276732#M7815</link>
      <description>for example sponsor_name jijo joseph naveen kumar&lt;BR /&gt;output:&lt;BR /&gt;sponsor_name&lt;BR /&gt;jijo joseph&lt;BR /&gt;naveen kumar</description>
      <pubDate>Sun, 12 Jun 2016 03:33:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/data-cleaning-from-text-file/m-p/276732#M7815</guid>
      <dc:creator>naveen-kumar11</dc:creator>
      <dc:date>2016-06-12T03:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: data cleaning from text file</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/data-cleaning-from-text-file/m-p/276733#M7816</link>
      <description>&lt;P&gt;No. You have to give us RULES.&lt;/P&gt;
&lt;P&gt;Why not be ?&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;sponsor_name&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;jijo joseph&amp;nbsp;naveen&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;kumar&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If there are always two words for each NAME, that would be easy.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Make a FLAG and transpose.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if mod(_n_,2)=1 then FLAG+1 ;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jun 2016 03:39:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/data-cleaning-from-text-file/m-p/276733#M7816</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-06-12T03:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: data cleaning from text file</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/data-cleaning-from-text-file/m-p/276734#M7817</link>
      <description>thankyou sooo much for your answers.its working great</description>
      <pubDate>Sun, 12 Jun 2016 03:42:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/data-cleaning-from-text-file/m-p/276734#M7817</guid>
      <dc:creator>naveen-kumar11</dc:creator>
      <dc:date>2016-06-12T03:42:32Z</dc:date>
    </item>
  </channel>
</rss>

