<?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: Datalines clarification in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Datalines-clarification/m-p/516306#M3118</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for the suggestion.&lt;/P&gt;</description>
    <pubDate>Tue, 27 Nov 2018 13:57:37 GMT</pubDate>
    <dc:creator>AshokD</dc:creator>
    <dc:date>2018-11-27T13:57:37Z</dc:date>
    <item>
      <title>Datalines clarification</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Datalines-clarification/m-p/516263#M3111</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi , Below code is working fine when we have two spaces before Score column values.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;data example1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;input ID Name &amp;amp; $30. Score;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cards;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1 Deepanshu Bhalla &amp;nbsp;22&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2 Atta Pat &amp;nbsp;21&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3 Xonxiangnam Samnuelnarayan &amp;nbsp;33&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When we have single space before score column value , it's not working properly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;data example1;&lt;BR /&gt;input ID Name &amp;amp; $30. Score;&lt;BR /&gt;cards;&lt;BR /&gt;1 Deepanshu Bhalla 22&lt;BR /&gt;2 Atta Pat 21&lt;BR /&gt;3 Xonxiangnam Samnuelnarayan 33&lt;BR /&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any suggestion to resolve this ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 09:55:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Datalines-clarification/m-p/516263#M3111</guid>
      <dc:creator>AshokD</dc:creator>
      <dc:date>2018-11-27T09:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Datalines clarification</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Datalines-clarification/m-p/516267#M3112</link>
      <description>&lt;P&gt;Maxim 1: Read the Documentation.&lt;/P&gt;
&lt;P&gt;From the &lt;A href="http://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lestmtsref&amp;amp;docsetTarget=n0lrz3gb7m9e4rn137op544ddg0v.htm&amp;amp;locale=en" target="_blank"&gt;documentation of list input&lt;/A&gt;:&lt;/P&gt;
&lt;H4 class="xis-argument"&gt;&amp;amp;&lt;/H4&gt;
&lt;DIV class="xis-argumentDescription"&gt;
&lt;P class="xis-paraSimpleFirst"&gt;indicates that a character value can have one or more &lt;STRONG&gt;single&lt;/STRONG&gt; embedded blanks. This format modifier reads the value from the next non-blank column until the pointer reaches &lt;STRONG&gt;two consecutive blanks&lt;/STRONG&gt;, the defined length of the variable, or the end of the input line, whichever comes first.&lt;/P&gt;
&lt;P class="xis-paraSimpleFirst"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="xis-paraSimpleFirst"&gt;(emphasis by me)&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 27 Nov 2018 10:17:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Datalines-clarification/m-p/516267#M3112</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-27T10:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: Datalines clarification</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Datalines-clarification/m-p/516274#M3113</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the link.&lt;/P&gt;&lt;P&gt;Any other input technique to read the below content ? I need to get the first name and last name in one column while reading the data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;cards;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1 Deepanshu Bhalla 22&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2 Atta Pat 21&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3 Xonxiangnam Samnuelnarayan 33&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 11:05:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Datalines-clarification/m-p/516274#M3113</guid>
      <dc:creator>AshokD</dc:creator>
      <dc:date>2018-11-27T11:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: Datalines clarification</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Datalines-clarification/m-p/516277#M3114</link>
      <description>&lt;P&gt;Not without coding it yourself.&amp;nbsp; If you have data which is delimited, then the delimiter must not appear in the data, otherwise it is invalid, simple fact.&amp;nbsp; Return this broken data to be fixed at source, or spend your life trying to fix it:&lt;/P&gt;
&lt;PRE&gt;data want;
  length line $200;
  infile "...";
  input line $;
  id=input(scan(line,1," "),best.);
  line=scan(line,2," ");
  age=input(substr(line,lengthn(line)-2,2),best.);
  name=tranwrd(line,strip(put(age,best.)),"");
run;&lt;/PRE&gt;
&lt;P&gt;Not tested, just to show you how much of mess having bad data is.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 11:13:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Datalines-clarification/m-p/516277#M3114</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-11-27T11:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: Datalines clarification</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Datalines-clarification/m-p/516286#M3115</link>
      <description>&lt;P&gt;You can use the automatic variable _infile_ to dissect the input line on your own:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
length
  id $2
  name $30
  score 8
;
input;
id = scan(_infile_,1);
score = input(scan(_infile_,-1),best.);
do i = 2 to countw(_infile_) - 1;
  name = catx(' ',name,scan(_infile_,i));
end;
drop i;
cards;
1 Deepanshu Bhalla 22
2 Atta Pat 21
3 Xonxiangnam Samnuelnarayan 33
4 first middle last 55
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But frankly, this has to be dealt with through the data format itself:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;fixed-width columns or&lt;/LI&gt;
&lt;LI&gt;a delimiter that is not present in the data items (eg the pipe character |)&lt;/LI&gt;
&lt;LI&gt;or by enclosing data items in quotes (and using the dsd option in SAS)&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 27 Nov 2018 12:11:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Datalines-clarification/m-p/516286#M3115</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-27T12:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: Datalines clarification</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Datalines-clarification/m-p/516296#M3116</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
infile cards truncover;
input id temp $80.;
call scan(temp,-1,p,l,' ');
name=substr(temp,1,p-1);
score=scan(temp,-1,' ');
drop temp p l;
cards;
1 Deepanshu Bhalla 22
2 Atta Pat 21
3 Xonxiangnam Samnuelnarayan 33
4 first middle last 55
;


proc print;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Nov 2018 12:54:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Datalines-clarification/m-p/516296#M3116</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-11-27T12:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: Datalines clarification</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Datalines-clarification/m-p/516306#M3118</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for the suggestion.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 13:57:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Datalines-clarification/m-p/516306#M3118</guid>
      <dc:creator>AshokD</dc:creator>
      <dc:date>2018-11-27T13:57:37Z</dc:date>
    </item>
  </channel>
</rss>

