<?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: Reading a &amp;quot;complex&amp;quot; data file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135760#M27542</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much, Tom. I learned a lot from your code! Actually, your code did not print MSA code for some large areas. But it is just because of a data problem. For example,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Norfolk-Virginia Beach-Newport News, VA-NC MSA.&lt;/STRONG&gt; --&amp;gt; Here, the whole name is in one line. But,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;New York-Northern New Jersey-Long Island,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; NY-NJ-CT-PA CMSA &lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Philadelphia-Wilmington-Atlantic City,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; PA-NJ-DE-MD CMSA&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NY and Philadelphia each takes two lines. I erased the second lines and got it right in the end.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 May 2014 02:44:48 GMT</pubDate>
    <dc:creator>tesu</dc:creator>
    <dc:date>2014-05-01T02:44:48Z</dc:date>
    <item>
      <title>Reading a "complex" data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135743#M27525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem in reading the following data file in SAS. I have tried ... like for 2 hours but no luck. Any help will be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.census.gov/population/metro/files/lists/historical/cencty.txt" title="https://www.census.gov/population/metro/files/lists/historical/cencty.txt"&gt;https://www.census.gov/population/metro/files/lists/historical/cencty.txt&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data file and its layout are attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bill&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 05:13:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135743#M27525</guid>
      <dc:creator>tesu</dc:creator>
      <dc:date>2014-04-28T05:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a "complex" data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135744#M27526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why don't you attach what you achieved so far, with comments/log?&lt;/P&gt;&lt;P&gt;You can't expect the community to create a whole program for you from scratch...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 06:45:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135744#M27526</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2014-04-28T06:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a "complex" data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135745#M27527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working on it.&lt;/P&gt;&lt;P&gt;But if you are a US citizen, do something for your country: get ahold of the idiot who created that file and use a LART on him/her.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 07:20:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135745#M27527</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-04-28T07:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a "complex" data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135746#M27528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Seems pretty straight-forward, the file structure is given at the end of the document.&amp;nbsp; So read the whole thing in as $2000.&amp;nbsp; Then post process the string into the separate parts as given by (drop everything after File layout and before Metropolitan Area/Central City&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :&lt;/P&gt;&lt;P&gt;File Layout:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Character&amp;nbsp; Length&amp;nbsp; Field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1-48&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 48&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Metropolitan Area/Central City &lt;/P&gt;&lt;P&gt;49-52&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4-Digit FIPS MSA/CMSA code&lt;/P&gt;&lt;P&gt;53-56&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Blank&lt;/P&gt;&lt;P&gt;57-60&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4-Digit FIPS PMSA code (blank for MSAs)&lt;/P&gt;&lt;P&gt;61-64&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Blank&lt;/P&gt;&lt;P&gt;65-66&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2-Digit FIPS Alternative CMSA code&lt;/P&gt;&lt;P&gt;67-72&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Blank&lt;/P&gt;&lt;P&gt;73-74&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2-Digit FIPS State code (blank for MSAs and CMSAs)&lt;/P&gt;&lt;P&gt;75-80&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Blank&lt;/P&gt;&lt;P&gt;81-85&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5-Digit FIPS Entity code (blank for MSAs and CMSAs)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 08:50:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135746#M27528</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-04-28T08:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a "complex" data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135747#M27529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;His problem seem to be the tabstops in the file. They need to be expanded to the next column where mod(column,8) = 0.&lt;/P&gt;&lt;P&gt;At least I don't know of a simple SAS mechanism to do that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 09:04:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135747#M27529</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-04-28T09:04:57Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a "complex" data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135748#M27530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yep, can't think of anything myself right at the moment.&amp;nbsp; You could find replace in Word then save that.&amp;nbsp; So go into Word, show special characters, highlight the '-&amp;gt;' and replace that with a pipe.&amp;nbsp; Then you could also remove the '.' at the same time, both special charcters.&amp;nbsp; Save it and it should look something like:&lt;/P&gt;&lt;P&gt;Abilene,TXMSA0040||&lt;/P&gt;&lt;P&gt;Abilene(part),TX||||48|01000&lt;/P&gt;&lt;P&gt;Aguadilla,PRMSA|0060||||&lt;/P&gt;&lt;P&gt;Aguadillazonaurbana,PR||||72|00745&lt;/P&gt;&lt;P&gt;Albany,GAMSA|0120||||&lt;/P&gt;&lt;P&gt;Albany,GA||||13|01052&lt;/P&gt;&lt;P&gt;Albany-Schenectady-Troy,NYMSA|0160&lt;/P&gt;&lt;P&gt;Albany,NY||||36|01000&lt;/P&gt;&lt;P&gt;Schenectady,NY||||36|65508&lt;/P&gt;&lt;P&gt;Troy,NY||||36|75484&lt;/P&gt;&lt;P&gt;SaratogaSprings,NY||||36|65255&lt;/P&gt;&lt;P&gt;Albuquerque,NMMSA|0200||||&lt;/P&gt;&lt;P&gt;Albuquerque,NM||||35|02000&lt;/P&gt;&lt;P&gt;Alexandria,LAMSA|0220||||&lt;/P&gt;&lt;P&gt;Alexandria,LA||||22|00975&lt;/P&gt;&lt;P&gt;Allentown-Bethlehem-Easton,PAMSA|0240||||&lt;/P&gt;&lt;P&gt;Allentown,PA||||42|02000&lt;/P&gt;&lt;P&gt;Bethlehem,PA||||42|06088&lt;/P&gt;&lt;P&gt;Altoona,PAMSA|0280||||&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 10:04:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135748#M27530</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-04-28T10:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a "complex" data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135749#M27531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data cencty;&lt;/P&gt;&lt;P&gt;infile '$HOME/sascommunity/cencty.txt' truncover lrecl=100;&lt;/P&gt;&lt;P&gt;length inp_line $ 100;&lt;/P&gt;&lt;P&gt;input;&lt;/P&gt;&lt;P&gt;inp_line = _infile_; *have to do this, or the first 2 blanks are eaten;&lt;/P&gt;&lt;P&gt;*expand the tabs;&lt;/P&gt;&lt;P&gt;i = indexc(inp_line,byte(9));&lt;/P&gt;&lt;P&gt;do while (i ne 0);&lt;/P&gt;&lt;P&gt;&amp;nbsp; x = mod(i-1,8);&lt;/P&gt;&lt;P&gt;&amp;nbsp; inp_line = substr(inp_line,1,i-1) !! repeat(' ',7-x) !! substr(inp_line,i+1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; i = indexc(inp_line,byte(9));&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;area = substr(inp_line,1,48);&lt;/P&gt;&lt;P&gt;cmsa = substr(inp_line,49,4);&lt;/P&gt;&lt;P&gt;pmsa = substr(inp_line,57,4);&lt;/P&gt;&lt;P&gt;cm = substr(inp_line,65,2);&lt;/P&gt;&lt;P&gt;ss = substr(inp_line,73,2);&lt;/P&gt;&lt;P&gt;eeeee = substr(inp_line,81,5);&lt;/P&gt;&lt;P&gt;drop i x inp_line;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may want do some grouping along the cmsa-level cities&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 10:47:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135749#M27531</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-04-28T10:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a "complex" data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135750#M27532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can say this file as an unorganized or formatted instead of complex file. You can ask the data provider to give the data with a proper delimiter (tab, ^,* etc..). OR else you have to do the data manipulation on formatting this data and then you can use infile or import statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 10:50:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135750#M27532</guid>
      <dc:creator>Vish33</dc:creator>
      <dc:date>2014-04-28T10:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a "complex" data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135751#M27533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;RTM.&amp;nbsp; Why don't you try the INFILE statement option EXPANDTABS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 11:15:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135751#M27533</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-04-28T11:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a "complex" data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135752#M27534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Because google didn't find it for me &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OTOH, my method can be adapted for different tab lengths. EXPANDTABS only does 8-character tabs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 11:32:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135752#M27534</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-04-28T11:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a "complex" data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135753#M27535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote" modifiedtitle="true"&gt;
&lt;P&gt;KurtBremser wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Because google didn't find it for me &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;I reckon that's the new, "the dog ate my homework".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 12:46:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135753#M27535</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-04-28T12:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a "complex" data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135754#M27536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah right. But have you tried to search for "expand tabstops" in the SAS Product Documentation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result is revealing (empty).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Most of the time, it is easier to find the right SAS documents through google than through the search function on the SAS website.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On top of that, I entered the wrong phrase in google, searching for "replace tabs" instead of "expanding tabs" (I'm not a native English speaker).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 13:00:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135754#M27536</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-04-28T13:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a "complex" data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135755#M27537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry . I just realize you should use COLUMN input method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data x;
infile 'c:\temp\cencty.txt' truncover expandtabs;
input v1 $ 1-48&amp;nbsp;&amp;nbsp; 
 v2 $ 49-52&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
 v3 $ 57-60&amp;nbsp;&amp;nbsp; 
 v4 $ 65-66&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
 v5 $ 73-74&amp;nbsp;&amp;nbsp; 
 v6 $ 81-85&amp;nbsp;&amp;nbsp; ;
run;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: xia keshan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: xia keshan Really not easy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: xia keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 13:15:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135755#M27537</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-04-28T13:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a "complex" data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135756#M27538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmm. That puts a lot of values in the wrong columns. v3 and v6 are always empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: saw you made some changes.&lt;/P&gt;&lt;P&gt;cm(v4)=07 is missing in the line for Boston_Worcester or Chicago-Gary...&lt;/P&gt;&lt;P&gt;pmsa (v3) is read into v2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 13:29:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135756#M27538</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-04-28T13:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a "complex" data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135757#M27539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My $.02: Blaim a webmaster. The file description is fixed column text but since the data doesn't match the descriptor someone has jiggered the data part of the file and I suspect a web publishing system.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 15:40:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135757#M27539</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-04-28T15:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a "complex" data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135758#M27540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you guys. I thought I was dumb enough to fail to read this data. But it turns out that in fact this task is not an easy one. I will try your suggestions and get back to you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 23:06:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135758#M27540</guid>
      <dc:creator>tesu</dc:creator>
      <dc:date>2014-04-28T23:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a "complex" data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135759#M27541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does not look that hard. Just retain the MSA/CMSA level variables onto the records for the CITY/ENTITY level variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data msa_cty ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile 'c:\downloads\cencty.txt' expandtabs&amp;nbsp; truncover;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input @ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _infile_ ^=: ' ' then input MSANAME $1-48 MSA $49-52 CMSA $65-66 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else input CCNAME $1-48 PMSA $57-60 state $73-74 entity $81-85 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; retain msaname msa cmsa ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 01:08:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135759#M27541</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-04-29T01:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a "complex" data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135760#M27542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much, Tom. I learned a lot from your code! Actually, your code did not print MSA code for some large areas. But it is just because of a data problem. For example,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Norfolk-Virginia Beach-Newport News, VA-NC MSA.&lt;/STRONG&gt; --&amp;gt; Here, the whole name is in one line. But,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;New York-Northern New Jersey-Long Island,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; NY-NJ-CT-PA CMSA &lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Philadelphia-Wilmington-Atlantic City,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; PA-NJ-DE-MD CMSA&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NY and Philadelphia each takes two lines. I erased the second lines and got it right in the end.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 May 2014 02:44:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135760#M27542</guid>
      <dc:creator>tesu</dc:creator>
      <dc:date>2014-05-01T02:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a "complex" data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135761#M27543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a way to handle that without modifying the input file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data msa_cty ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length MSANAME $80 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile 'c:\downloads\cencty.txt' expandtabs&amp;nbsp; truncover;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input @ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if _infile_ ^=: ' ' then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input MSANAME $1-48 MSA $49-52 CMSA $65-66 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if msa||cmsa=' ' then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input CCNAME $1-48 MSA $49-52 CMSA $65-66 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MSANAME = catx(' ',msaname,ccname);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CCNAME=' ';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else input CCNAME $1-48 PMSA $57-60 state $73-74 entity $81-85 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; retain msaname msa cmsa ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 May 2014 17:24:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135761#M27543</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-05-01T17:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a "complex" data file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135762#M27544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something the Lord made...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 May 2014 21:27:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-quot-complex-quot-data-file/m-p/135762#M27544</guid>
      <dc:creator>tesu</dc:creator>
      <dc:date>2014-05-01T21:27:22Z</dc:date>
    </item>
  </channel>
</rss>

