<?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: Handling '.' as a delimiter in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Handling-as-a-delimiter/m-p/45660#M5217</link>
    <description>For starters, having delimiters that can show up within the data often causes problems. I should try to get your file supplier to have the file delimited with something else.&lt;BR /&gt;
&lt;BR /&gt;
If this is not feasible consider to read the whole record into a single string and then using different SAS character functions to read out your different columns.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Linus</description>
    <pubDate>Fri, 12 Sep 2008 14:24:54 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2008-09-12T14:24:54Z</dc:date>
    <item>
      <title>Handling '.' as a delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Handling-as-a-delimiter/m-p/45659#M5216</link>
      <description>I thought that two below codes should work the same. However the second data step generates 0.175 and 0.1101 for the Grade variable while I assumed it had to generate 17.50 and 11.01 as the first data step does. Any idea why?&lt;BR /&gt;
&lt;BR /&gt;
data StudentsGrades;&lt;BR /&gt;
infile datalines;&lt;BR /&gt;
input StudentName $ &lt;BR /&gt;
      CourseName $ &lt;BR /&gt;
      DateOfExam Date7.&lt;BR /&gt;
      Grade 5.2&lt;BR /&gt;
      Result $;&lt;BR /&gt;
datalines;&lt;BR /&gt;
George Math 19Dec05 1750 P&lt;BR /&gt;
Susan Geography 01Feb05 1101 F&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
data StudentsGradesDot1;&lt;BR /&gt;
infile datalines dlm='.';&lt;BR /&gt;
input StudentName $ &lt;BR /&gt;
      CourseName $ &lt;BR /&gt;
      DateOfExam Date7.&lt;BR /&gt;
      Grade 5.2&lt;BR /&gt;
      Result $;&lt;BR /&gt;
datalines;&lt;BR /&gt;
George.Math.19Dec05.1750.P&lt;BR /&gt;
Susan.Geography.01Feb05.1101.F&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
The results for the first data step:&lt;BR /&gt;
George	Math	16789	17.5	P&lt;BR /&gt;
Susan	Geograph	16468	11.01	F&lt;BR /&gt;
&lt;BR /&gt;
The results for the second data step:&lt;BR /&gt;
George	Math	16789	0.175	P&lt;BR /&gt;
Susan	Geograph	16468	0.1101	F&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Ramin</description>
      <pubDate>Fri, 12 Sep 2008 10:27:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Handling-as-a-delimiter/m-p/45659#M5216</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-09-12T10:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: Handling '.' as a delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Handling-as-a-delimiter/m-p/45660#M5217</link>
      <description>For starters, having delimiters that can show up within the data often causes problems. I should try to get your file supplier to have the file delimited with something else.&lt;BR /&gt;
&lt;BR /&gt;
If this is not feasible consider to read the whole record into a single string and then using different SAS character functions to read out your different columns.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Linus</description>
      <pubDate>Fri, 12 Sep 2008 14:24:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Handling-as-a-delimiter/m-p/45660#M5217</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2008-09-12T14:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: Handling '.' as a delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Handling-as-a-delimiter/m-p/45661#M5218</link>
      <description>You can use the informat statment&lt;BR /&gt;
&lt;BR /&gt;
If i take your example its looks like this:&lt;BR /&gt;
&lt;BR /&gt;
data b;&lt;BR /&gt;
infile datalines dlm='.';&lt;BR /&gt;
input StudentName $&lt;BR /&gt;
CourseName  $ &lt;BR /&gt;
DateOfExam Date7.&lt;BR /&gt;
Grade  &lt;BR /&gt;
Result $;&lt;BR /&gt;
informat Grade 5.2;&lt;BR /&gt;
datalines;&lt;BR /&gt;
George.Math.19Dec05.1750.P&lt;BR /&gt;
Susan.Geography.01Feb05.1101.F&lt;BR /&gt;
;&lt;BR /&gt;
run;</description>
      <pubDate>Fri, 12 Sep 2008 17:05:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Handling-as-a-delimiter/m-p/45661#M5218</guid>
      <dc:creator>yonib</dc:creator>
      <dc:date>2008-09-12T17:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: Handling '.' as a delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Handling-as-a-delimiter/m-p/45662#M5219</link>
      <description>This is yet another anomaly with the "date" related INFORMAT handling.  The fact that there is mixed INPUT processing is a contributing factor.  My recommendation is to open a SAS support track, to let SAS Institute know that this unexpected input handling occurs when there is a date input field, and where the delimiter DOES NOT occur in the input record.&lt;BR /&gt;
&lt;BR /&gt;
For illustration purposes, the two different input record types are processed, one containing a date field within the record and a second type without a date.  SAS seems to handle the record not containing the date with no problem.  See the code below:&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
infile datalines dlm='\';&lt;BR /&gt;
format numdtvar1 date9.;&lt;BR /&gt;
input type $  @;&lt;BR /&gt;
if type ne ' ' then do; &lt;BR /&gt;
  if type = '1' then input charvar1 $ numdtvar1 anydtdte. numvar1 4.2 charvar2 $;&lt;BR /&gt;
  else&lt;BR /&gt;
  if type = '2' then input charvar1 $ numvar1 4.2 charvar2 $;&lt;BR /&gt;
  putlog _all_;&lt;BR /&gt;
end;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1\aaaa\01jan2008\2222\bbbb&lt;BR /&gt;
2\aaaa\2222\bbbb&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Like I suggested, open a support track and stand your ground.  Good luck.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 12 Sep 2008 17:11:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Handling-as-a-delimiter/m-p/45662#M5219</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2008-09-12T17:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: Handling '.' as a delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Handling-as-a-delimiter/m-p/45663#M5220</link>
      <description>To: RaminR&lt;BR /&gt;
&lt;BR /&gt;
Use the informat modifier ':'. &lt;BR /&gt;
&lt;BR /&gt;
This will read the variable content up to the next delimeter and then move the pointer to the next position after the delimeter. For some reason in your code SAS appears to be reading the '.' delimeter that separates values as part of the grade value. &lt;BR /&gt;
&lt;BR /&gt;
In any event the following code works to read in the grade correctly. Be aware that you need to set your informats wide enough to accomodate the largest possible input to be read.&lt;BR /&gt;
&lt;BR /&gt;
data StudentsGradesDot1;&lt;BR /&gt;
 infile datalines   dlm='.';&lt;BR /&gt;
 input  StudentName :$8. &lt;BR /&gt;
        CourseName  :$9. &lt;BR /&gt;
        DateOfExam  :Date7.&lt;BR /&gt;
        Grade       :5.2&lt;BR /&gt;
        Result      :$;&lt;BR /&gt;
datalines;&lt;BR /&gt;
George.Math.19Dec05.1750.P&lt;BR /&gt;
Susan.Geography.01Feb05.1101.F&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
&lt;BR /&gt;
BPD</description>
      <pubDate>Fri, 19 Sep 2008 13:00:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Handling-as-a-delimiter/m-p/45663#M5220</guid>
      <dc:creator>BPD</dc:creator>
      <dc:date>2008-09-19T13:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: Handling '.' as a delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Handling-as-a-delimiter/m-p/45664#M5221</link>
      <description>Thanks BPD. That seems like a better way to handle these kind of ambiguities.&lt;BR /&gt;
Ramin</description>
      <pubDate>Mon, 22 Sep 2008 11:23:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Handling-as-a-delimiter/m-p/45664#M5221</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-09-22T11:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: Handling '.' as a delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Handling-as-a-delimiter/m-p/45665#M5222</link>
      <description>In this statement [pre]  input StudentName :$8. &lt;BR /&gt;
        CourseName :$9. &lt;BR /&gt;
        DateOfExam :Date7.&lt;BR /&gt;
        Grade :5.2&lt;BR /&gt;
        Result :$; [/pre] remove the explicit/implied decimal 2 from the grade informat. Then it would be like[pre]        Grade :5. [/pre]&lt;BR /&gt;
Much safer I feel,is to predefine stored variable lengths (and then informats) before the INPUT statement, which won't then need informats defined at all.&lt;BR /&gt;
&lt;BR /&gt;
Good Luck&lt;BR /&gt;
&lt;BR /&gt;
PeterC

just spelling!&lt;BR /&gt;
    &lt;BR /&gt;
Message was edited by: Peter.C</description>
      <pubDate>Tue, 23 Sep 2008 19:22:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Handling-as-a-delimiter/m-p/45665#M5222</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2008-09-23T19:22:20Z</dc:date>
    </item>
  </channel>
</rss>

