<?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: Formatted Input why are the two results not equivalent? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Formatted-Input-why-are-the-two-results-not-equivalent/m-p/463167#M117954</link>
    <description>&lt;P&gt;Thanks. That is&amp;nbsp; correct. I wanted to know why it didn't work. Now I better understand the colon in this context. Thanks.&lt;/P&gt;</description>
    <pubDate>Thu, 17 May 2018 21:19:53 GMT</pubDate>
    <dc:creator>ManitobaMoose</dc:creator>
    <dc:date>2018-05-17T21:19:53Z</dc:date>
    <item>
      <title>Formatted Input why are the two results not equivalent?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Formatted-Input-why-are-the-two-results-not-equivalent/m-p/463134#M117936</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the first code, the two missing values are properly displayed, but not in the second. Why not?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the raw data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;90 80 98
78 88
65 66 69
92 94 96
78    79&lt;/PRE&gt;&lt;P&gt;First code.&lt;/P&gt;&lt;PRE&gt;Libname Learn'/folders/myfolders/Learn' ;

Data Problem_21_4 ; 
	infile '/folders/myfolders/Learn/Scores_List.sas' truncover ;   /*or Missover*/
	input (Score1-Score3) (2. + 1) ; 
run ; 	
	
proc print data=Problem_21_4 noobs ; 
run ; &lt;/PRE&gt;&lt;P&gt;First Code results:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Score1 	Score2 	Score3
90 	80 	98
78 	88 	.
65 	66 	69
92 	94 	96
78 	. 	79&lt;/PRE&gt;&lt;P&gt;Second Code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Libname Review'/folders/myfolders/Review' ;
Libname Learn'/folders/myfolders/Learn' ; 

data review.Prob21_4 ;
	infile '/folders/myfolders/Learn/Scores_List.sas' truncover ; 
	input @1 Score1 : 2.
		  @4 Score2 : 2.
		  @7 Score3 : 2. ;
run ; 

proc print data=review.Prob21_4 ; 
run ; &lt;/PRE&gt;&lt;P&gt;Second Code Results&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Obs 	Score1 	Score2 	Score3
1 	90 	80 	98
2 	78 	88 	.
3 	65 	66 	69
4 	92 	94 	96
5 	78 	79 	79&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 20:09:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Formatted-Input-why-are-the-two-results-not-equivalent/m-p/463134#M117936</guid>
      <dc:creator>ManitobaMoose</dc:creator>
      <dc:date>2018-05-17T20:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: Formatted Input why are the two results not equivalent?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Formatted-Input-why-are-the-two-results-not-equivalent/m-p/463140#M117939</link>
      <description>&lt;P&gt;Get rid of the colon format modifier if you are using formatter input and NOT modified list input like this in your 2nd to work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Prob21_4 ;
	infile cards truncover ; 
	input @1 Score1  2.
		  @4 Score2  2.
		  @7 Score3  2. ;
cards;
90 80 98
78 88
65 66 69
92 94 96
78    79
;
run ; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 May 2018 20:14:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Formatted-Input-why-are-the-two-results-not-equivalent/m-p/463140#M117939</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-17T20:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Formatted Input why are the two results not equivalent?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Formatted-Input-why-are-the-two-results-not-equivalent/m-p/463146#M117943</link>
      <description>&lt;P&gt;While &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;has the right "fix" to the problem, I think your question isn't how to fix it.&amp;nbsp; It looks like the question is, "Why does this happen?"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since removing the colon impacts the results, it must be having an impact on how SAS reads the data.&amp;nbsp; More specifically, the colon means, "Scan across the data from left to right.&amp;nbsp; Once you find something, apply the instructions (2. in this case)."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So on the 5th line of data, SAS begins at column 4 and starts looking for a value.&amp;nbsp; It doesn't find anything until it gets to column 7 where it finds "79" (in columns 7 and 8).&amp;nbsp; So column 7 is where the INPUT statement starts applying the instructions = 2. = read the next two characters to get a value for SCORE2.&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 20:22:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Formatted-Input-why-are-the-two-results-not-equivalent/m-p/463146#M117943</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-05-17T20:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Formatted Input why are the two results not equivalent?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Formatted-Input-why-are-the-two-results-not-equivalent/m-p/463167#M117954</link>
      <description>&lt;P&gt;Thanks. That is&amp;nbsp; correct. I wanted to know why it didn't work. Now I better understand the colon in this context. Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 21:19:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Formatted-Input-why-are-the-two-results-not-equivalent/m-p/463167#M117954</guid>
      <dc:creator>ManitobaMoose</dc:creator>
      <dc:date>2018-05-17T21:19:53Z</dc:date>
    </item>
  </channel>
</rss>

