<?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 Difference between putting colon as a format modifier, before or after the informat in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Difference-between-putting-colon-as-a-format-modifier-before-or/m-p/532327#M145859</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;SAP version 9.4&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Data file (data.txt)&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;George
Albert
Bob&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;My SAS program to read the data above:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA Work.names;
	INFILE 
		'/folders/myfolders/exercices/data/data.txt'
		missover
	;
	INPUT name :$ 6.;
RUN;
PROC PRINT DATA = Work.names;
TITLE 'Names';
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;It seems to me that:&lt;/P&gt;&lt;PRE&gt;INPUT name :$ 6.;&lt;/PRE&gt;&lt;P&gt;And (putting the colon after the $ character)&lt;/P&gt;&lt;PRE&gt;INPUT name $: 6.;&lt;/PRE&gt;&lt;P&gt;Both give the same result. As I'm a beginner I just wanted to know why. Is it just the fact that both syntaxes are accepted by SAS or there is some concept that I've missed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;</description>
    <pubDate>Sat, 02 Feb 2019 22:57:28 GMT</pubDate>
    <dc:creator>Odyssey2001</dc:creator>
    <dc:date>2019-02-02T22:57:28Z</dc:date>
    <item>
      <title>Difference between putting colon as a format modifier, before or after the informat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Difference-between-putting-colon-as-a-format-modifier-before-or/m-p/532327#M145859</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;SAP version 9.4&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Data file (data.txt)&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;George
Albert
Bob&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;My SAS program to read the data above:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA Work.names;
	INFILE 
		'/folders/myfolders/exercices/data/data.txt'
		missover
	;
	INPUT name :$ 6.;
RUN;
PROC PRINT DATA = Work.names;
TITLE 'Names';
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;It seems to me that:&lt;/P&gt;&lt;PRE&gt;INPUT name :$ 6.;&lt;/PRE&gt;&lt;P&gt;And (putting the colon after the $ character)&lt;/P&gt;&lt;PRE&gt;INPUT name $: 6.;&lt;/PRE&gt;&lt;P&gt;Both give the same result. As I'm a beginner I just wanted to know why. Is it just the fact that both syntaxes are accepted by SAS or there is some concept that I've missed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;</description>
      <pubDate>Sat, 02 Feb 2019 22:57:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Difference-between-putting-colon-as-a-format-modifier-before-or/m-p/532327#M145859</guid>
      <dc:creator>Odyssey2001</dc:creator>
      <dc:date>2019-02-02T22:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between putting colon as a format modifier, before or after the informat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Difference-between-putting-colon-as-a-format-modifier-before-or/m-p/532332#M145861</link>
      <description>&lt;P&gt;As you have seen, both work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The order doesn't matter much because the colon is instructions for reading in the variable, but the dollar sign is defining characteristics of the variable.&amp;nbsp; So they don't really conflict&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS is pretty flexible in defining characteristics of a variable.&amp;nbsp; This combination should also work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;length name $ 6;
input name : 6.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The one thing that doesn't work is re-defining the length of a character variable after the fact.&amp;nbsp; This would give an error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input name $;
length name $ 6;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The INPUT statement would assign NAME a length of 8, and a later LENGTH statement can't change that.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Feb 2019 23:20:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Difference-between-putting-colon-as-a-format-modifier-before-or/m-p/532332#M145861</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-02-02T23:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between putting colon as a format modifier, before or after the informat</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Difference-between-putting-colon-as-a-format-modifier-before-or/m-p/532379#M145883</link>
      <description>&lt;P&gt;Ok I see. Thank you very much for your help and your attention to my problem.&lt;/P&gt;</description>
      <pubDate>Sun, 03 Feb 2019 12:49:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Difference-between-putting-colon-as-a-format-modifier-before-or/m-p/532379#M145883</guid>
      <dc:creator>Odyssey2001</dc:creator>
      <dc:date>2019-02-03T12:49:13Z</dc:date>
    </item>
  </channel>
</rss>

