<?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: format and informat? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/format-and-informat/m-p/506029#M135581</link>
    <description>&lt;P&gt;An INFORMAT is instructions for converting text to values. A FORMAT is instructions for converting values to text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need the FORMAT statement so that the dates will display in a human readable way.&amp;nbsp; You do not need to attach the informats for this program since you are not using them anywhere.&amp;nbsp; But it doesn't hurt.&amp;nbsp; And since you are converting from DATETIME to DATE values you probably do want to at least remove whatever INFORMATs were previously attached to those variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;informat &amp;amp;NUMRVAR ; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The informats might be useful later if you want to add observations using FSEDIT for example.&lt;/P&gt;
&lt;P&gt;Or if you want to use the dataset as a template for reading some raw data.&amp;nbsp; You need an informat SAS to read values like '10/17/2018' as a number and not just a string.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;
  if 0 then set test;
  infile 'newdata.csv' dsd truncover ;
  input (_all_) (+0);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Oct 2018 16:39:09 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2018-10-19T16:39:09Z</dc:date>
    <item>
      <title>format and informat?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-and-informat/m-p/505994#M135574</link>
      <description>&lt;P&gt;Hello:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have the following codes by created someone else.&amp;nbsp;&amp;nbsp; Could anyone let me know why use informat and format together?&amp;nbsp; Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data test;
	set test;
	array aa &amp;amp;numrvar;
 	do over aa;
  	aa=datepart(aa);
end;
	informat &amp;amp;NUMRVAR MMDDYY10.; 
	format &amp;amp;NUMRVAR MMDDYY10.; 
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Oct 2018 16:05:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-and-informat/m-p/505994#M135574</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2018-10-19T16:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: format and informat?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-and-informat/m-p/505996#M135575</link>
      <description>&lt;P&gt;Informats are not needed when no external data is read.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 16:08:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-and-informat/m-p/505996#M135575</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-19T16:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: format and informat?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-and-informat/m-p/505997#M135576</link>
      <description>&lt;P&gt;And DO OVER has been deprecated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you see code like this, one of two things likely happened:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. The original author didn't understand informats&lt;/P&gt;
&lt;P&gt;2. At one point the data was being read from a text file and then the process change and code was updated, but this was left in.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 16:09:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-and-informat/m-p/505997#M135576</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-19T16:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: format and informat?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-and-informat/m-p/506029#M135581</link>
      <description>&lt;P&gt;An INFORMAT is instructions for converting text to values. A FORMAT is instructions for converting values to text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need the FORMAT statement so that the dates will display in a human readable way.&amp;nbsp; You do not need to attach the informats for this program since you are not using them anywhere.&amp;nbsp; But it doesn't hurt.&amp;nbsp; And since you are converting from DATETIME to DATE values you probably do want to at least remove whatever INFORMATs were previously attached to those variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;informat &amp;amp;NUMRVAR ; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The informats might be useful later if you want to add observations using FSEDIT for example.&lt;/P&gt;
&lt;P&gt;Or if you want to use the dataset as a template for reading some raw data.&amp;nbsp; You need an informat SAS to read values like '10/17/2018' as a number and not just a string.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;
  if 0 then set test;
  infile 'newdata.csv' dsd truncover ;
  input (_all_) (+0);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 16:39:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-and-informat/m-p/506029#M135581</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-10-19T16:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: format and informat?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-and-informat/m-p/506088#M135595</link>
      <description>&lt;P&gt;Based on your feedback, I found out the original code is like this.&amp;nbsp;&amp;nbsp; Does this means that library RSV is outside source, therefore, informat is used for external file?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ARI18_&amp;amp;tdate.;
	set RSV."18ARI"n;
	array aa &amp;amp;numrvar;
 	do over aa;
  	aa=datepart(aa);
end;
	informat &amp;amp;NUMRVAR MMDDYY10.; 
	format &amp;amp;NUMRVAR MMDDYY10.; 
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Oct 2018 17:54:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-and-informat/m-p/506088#M135595</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2018-10-19T17:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: format and informat?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-and-informat/m-p/506092#M135597</link>
      <description>&lt;P&gt;Yes.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A number of DBMS systems do not have a concept of a date (number of days) and just have a general datetime (or timestamp) data type.&amp;nbsp; So people store dates with either a constant time part (like midnight) or perhaps the system supports some metadata that tells it how precise the timestamp value is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So that SAS code will convert the values form number of seconds to number of days and adjust the formats/informats to those more appropriate for a date value.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 17:59:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-and-informat/m-p/506092#M135597</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-10-19T17:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: format and informat?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/format-and-informat/m-p/506094#M135599</link>
      <description>&lt;P&gt;Thank you so much for all of your valuable&amp;nbsp;information.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 18:10:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/format-and-informat/m-p/506094#M135599</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2018-10-19T18:10:02Z</dc:date>
    </item>
  </channel>
</rss>

