<?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 Reading a messy string. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-messy-string/m-p/327234#M72981</link>
    <description>&lt;P&gt;I have a variable that is named Units.&amp;nbsp; Some of the values the variable takes on are:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;x10E3/uL &amp;nbsp; ---------&amp;gt; /* means "times 10000/uL"&amp;nbsp;&amp;nbsp; It is in E notation here. */&lt;/P&gt;&lt;P&gt;mL/min/1.73&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see there is a mix of letters and numbers as well as slashes in the 2 observations. How can I tell SAS to read the entire string from a raw data file?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also have another variable named Interval with values such as:&lt;/P&gt;&lt;P&gt;3.4 - 10.8&lt;/P&gt;&lt;P&gt;4.14 - 5.80&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I read these from a raw data file as well?&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>Wed, 25 Jan 2017 02:14:16 GMT</pubDate>
    <dc:creator>TommyTea</dc:creator>
    <dc:date>2017-01-25T02:14:16Z</dc:date>
    <item>
      <title>Reading a messy string.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-messy-string/m-p/327234#M72981</link>
      <description>&lt;P&gt;I have a variable that is named Units.&amp;nbsp; Some of the values the variable takes on are:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;x10E3/uL &amp;nbsp; ---------&amp;gt; /* means "times 10000/uL"&amp;nbsp;&amp;nbsp; It is in E notation here. */&lt;/P&gt;&lt;P&gt;mL/min/1.73&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see there is a mix of letters and numbers as well as slashes in the 2 observations. How can I tell SAS to read the entire string from a raw data file?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also have another variable named Interval with values such as:&lt;/P&gt;&lt;P&gt;3.4 - 10.8&lt;/P&gt;&lt;P&gt;4.14 - 5.80&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I read these from a raw data file as well?&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>Wed, 25 Jan 2017 02:14:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-messy-string/m-p/327234#M72981</guid>
      <dc:creator>TommyTea</dc:creator>
      <dc:date>2017-01-25T02:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a messy string.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-messy-string/m-p/327236#M72982</link>
      <description>Consider it as a character variable and it should read the entire string. &lt;BR /&gt;&lt;BR /&gt;Please let me know if it is not clear. &lt;BR /&gt;&lt;BR /&gt;Also let us know how are you importing the raw data file.</description>
      <pubDate>Wed, 25 Jan 2017 02:22:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-messy-string/m-p/327236#M72982</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2017-01-25T02:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a messy string.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-messy-string/m-p/327244#M72985</link>
      <description>&lt;P&gt;You tell SAS to use a specific delimiter or to read for a specific length.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Given what you've posted we can't really suggest solutions beyond this. Reading a text file can be complicated or easy, it depends on multiple factors and we only have a minimal idea of your issue.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you'd like further help please post sample data that accurately reflects your situation.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 03:44:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-messy-string/m-p/327244#M72985</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-25T03:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a messy string.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-messy-string/m-p/327256#M72991</link>
      <description>&lt;P&gt;The only difficulty is the dash between the range values. Use pointer control (here +1) to skip it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data abc;
length units $12;
input id rangeLow +1 rangeHigh units :$12.;
datalines;
1 3.4 - 10.8 x10E3/uL
100 4.14 - 5.80 mL/min/1.73
;

proc print; run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Jan 2017 06:16:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-messy-string/m-p/327256#M72991</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-01-25T06:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a messy string.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-messy-string/m-p/327289#M72999</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To acces the input buffer (whole line of the file) use the automatic variable _INFILE_&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WANT;
        infile "&amp;lt;myfile&amp;gt;" lrecl=200;
        input;
        put _INFILE_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can also check the following paper by Howard Schreier:&amp;nbsp;&lt;A href="http://www.lexjansen.com/nesug/nesug01/cc/cc4018bw.pdf" target="_blank"&gt;http://www.lexjansen.com/nesug/nesug01/cc/cc4018bw.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Daniel Santos&amp;nbsp;@ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 08:44:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-messy-string/m-p/327289#M72999</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2017-01-25T08:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a messy string.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-messy-string/m-p/327398#M73027</link>
      <description>&lt;P&gt;What type of file are you reading from? Most delimited files such as CSV should handle this easily though unmatched quotes might cause other problems. Fixed column has no problem as long as the correct variable type is assigned.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 15:13:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-messy-string/m-p/327398#M73027</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-01-25T15:13:45Z</dc:date>
    </item>
  </channel>
</rss>

