<?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: Proc format issues: invalue statement ignores length specified with informats in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issues-invalue-statement-ignores-length-specified/m-p/94864#M26830</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Agoldma, the resolution of 8 byte floating point with the offset point of zero 1 Jan 1960 is well documented. The maximum is 15 digits, I would advice not to trust more than 12. This is standard IEE that intel has hard cooked in processors.&lt;/P&gt;&lt;P&gt;SAS is claiming to have solved the interfaces to Datetime stamps as part of their system. Why should TS support of SAS having problems to support their claims?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Jun 2014 14:06:03 GMT</pubDate>
    <dc:creator>jakarman</dc:creator>
    <dc:date>2014-06-30T14:06:03Z</dc:date>
    <item>
      <title>Proc format issues: invalue statement ignores length specified with informats</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issues-invalue-statement-ignores-length-specified/m-p/94857#M26823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to translate our db2 timestamps into a SAS datetime using informats. We now use case statements but I want to try using informats to see if I can increase our performance. We use case statements because of the limitations SAS has dealing with dates below the year 1582 and datetimes below the year 1926 or above the year 2095.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that proc format doenst look at the length I specify with the informats (see code below).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;============== SAS program to test with ================&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;options fmtsearch=(work);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;proc format lib=work;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;&amp;nbsp; invalue sas_datetime_frmt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '0000-00-00-00.00.00.000000' -&amp;lt; '1582-01-01-00.00.00.000000' = "&amp;amp;tvar_sasmindat"dt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '1582-01-01-00.00.00.000000' -&amp;lt; '1926-01-01-00.00.00.000000' = ['ymddttm19.']&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '1926-01-01-00.00.00.000000' -&amp;lt; '2095-01-01-00.00.00.000000' = ['ymddttm26.']&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '2095-01-01-00.00.00.000000' -&amp;nbsp; '9999-12-31-23.59.59.999999' = ['ymddttm19.']&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; other = .;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;data work.format_in;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;&amp;nbsp; attrib db2_datetime length=$26;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;&amp;nbsp; input db2_datetime 1-26;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;&amp;nbsp; datalines;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;1500-05-16-12.11.11.111111&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;1600-05-16-12.22.22.222222&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;1950-05-16-12.33.33.333333&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;9999-05-16-12.44.44.444444&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;data work.format_out;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;&amp;nbsp; set work.format_in;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;&amp;nbsp; attrib sas_datetime &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length =8.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format = datetime26.6;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sas_datetime = input(db2_datetime, sas_datetime_frmt.); &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=========================================================&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Results: &lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;db2_datetime&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;sas_datetime &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;1500-05-16-12.11.11.111111 01JAN1582:00:00:00.000000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;1600-05-16-12.22.22.222222 16MAY1600:12:22:22.222221&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;1950-05-16-12.33.33.333333 16MAY1950:12:33:33.333333&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;9999-05-16-12.44.44.444444 16MAY9999:12:44:44.444458&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second and fourth date should end with .000000, but that didnt happen. I only get the .000000 when I specify a length of 19 when calling the custom &lt;/P&gt;&lt;P&gt;informat in the input statement and all the informats inside the custom informat are specified as ymddttm19.. It's strange because the code below does work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;&amp;nbsp; db2_datetime = '1600-05-16-12.22.22.222222';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;&amp;nbsp; sas_datetime = input(db2_datetime, ymddttm19.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;&amp;nbsp; format sas_datetime datetime26.6;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;&amp;nbsp; put sas_datetime=;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #3366ff;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Results log: &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;sas_datetime=16MAY1600:12:22:22.000000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Questions I have are:&lt;BR /&gt;- Why doesnt proc format use the length I specify in the custom informat?&lt;BR /&gt;- Is there a way I can make this work? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did try to use custom functions using proc fcmp, but the performace seems to be not as good as custom formats and case statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im running these tests in a SAS 9.3 environment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jun 2013 13:55:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issues-invalue-statement-ignores-length-specified/m-p/94857#M26823</guid>
      <dc:creator>Owen</dc:creator>
      <dc:date>2013-06-04T13:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc format issues: invalue statement ignores length specified with informats</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issues-invalue-statement-ignores-length-specified/m-p/94858#M26824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;looks like the lengths that apply are the "external" lengths of the "outer" informat(&lt;SPAN style="color: #008080; font-family: 'Courier New'; background-color: #ffffff;"&gt;sas_datetime_frmt.&lt;/SPAN&gt;) and not the lengths defined in the embedded informats (&lt;SPAN style="color: #3366ff; font-family: 'courier new', courier; background-color: #ffffff;"&gt;ymddttm19.&lt;/SPAN&gt;. or &lt;SPAN style="color: #3366ff; font-family: 'courier new', courier; background-color: #ffffff;"&gt;ymddttm26.)&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used your sample data like:&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; work.format_in;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;attrib&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; db2_datetime &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=$&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;26&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; db2_sas &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;datetime22.3&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;infile&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; datalines &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;truncover&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; db2_datetime &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;$char26.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; @&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; db2_sas :&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;sas_datetime_frmt.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;list&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;datalines&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1500-05-16-12.11.11.111111&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1600-05-16-12.22.22.222222&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;1950-05-16-12.33.33.333333&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;9999-05-16-12.44.44.444444&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;and still the 1600 and 9999 timestamps include their decimal fractions&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jun 2013 22:21:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issues-invalue-statement-ignores-length-specified/m-p/94858#M26824</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2013-06-04T22:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: Proc format issues: invalue statement ignores length specified with informats</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issues-invalue-statement-ignores-length-specified/m-p/94859#M26825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-top: 1.0pt; margin-bottom: 1.0pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;I don't know the definition of "&amp;amp;tvar_sasmindat"dt, so I used the constant "01jan1582 00:00:00"dt&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 1.0pt; margin-bottom: 1.0pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;(it looks like this is your own way of handling date-time constants prior to 1582)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-top: 1.0pt; margin-bottom: 1.0pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;Main idea: if you want to use an [existing-informat] in your value-range-set(s), you have to use the (DEFAULT= ) option. This &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN" style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; font-weight: normal;"&gt;is documented in SAS Help: &lt;A href="http://support.sas.com/documentation/cdl/en/proc/65145/HTML/default/viewer.htm#p1pmw90bl3jzgdn1w4202kclxtho.htm"&gt;FORMAT Procedure &amp;gt; INVALUE Statement&lt;/A&gt; (near the bottom)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-top: 1.0pt; margin-bottom: 1.0pt;"&gt;&lt;SPAN lang="EN" style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;Only one &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;(DEFAULT= ) option is allowed per informat-name (per invalue statement), so if you want multiple lengths, you need either 2 separate informats or use the Function Complier: PROC FCMP (similar to a macro).&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 1.0pt; margin-bottom: 1.0pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;Example #12 in SAS Help for Proc Format "&lt;A href="http://support.sas.com/documentation/cdl/en/proc/65145/HTML/default/viewer.htm#p1gg77jyhc9s42n1f1vjyx2hsg8b.htm"&gt;Creating a Function to Use as a Format&lt;/A&gt;" is a very good example for combining a user-defined format with a user-defined function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10.0pt; font-family: 'Courier New';"&gt;fcmp&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; outlib=work.functions.smd;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; function in19(x $) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return(input(substr(x,&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;,&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10.0pt; font-family: 'Courier New';"&gt;19&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal;"&gt;ymddttm19.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; endsub;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; function in26(x $) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return(input(x,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal;"&gt;ymddttm26.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; endsub;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10.0pt; font-family: 'Courier New';"&gt;format&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; lib=work;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;invalue&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; sas_datetime_frmt&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple;"&gt;'0000-00-00-00.00.00.000000'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; -&amp;lt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple;"&gt;'1582-01-01-00.00.00.000000'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; = &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10.0pt; font-family: 'Courier New';"&gt;'01jan1582 00.00.00'dt&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple;"&gt;'1582-01-01-00.00.00.000000'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; -&amp;lt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple;"&gt;'1926-01-01-00.00.00.000000'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; = [in19()]&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple;"&gt;'1926-01-01-00.00.00.000000'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; -&amp;lt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple;"&gt;'2095-01-01-00.00.00.000000'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; = [in26()]&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple;"&gt;'2095-01-01-00.00.00.000000'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; -&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple;"&gt;'9999-12-31-23.59.59.999999'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; = [in19()]&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; other = &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10.0pt; font-family: 'Courier New';"&gt;.&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-top: 1.0pt; margin-bottom: 1.0pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;The next 2 data steps (&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif'; color: black;"&gt;work.format_in and work.format_out&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;) are the same as yours.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 1.0pt; margin-bottom: 1.0pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;One possible idea for date-time values prior to 1/1/1582 is a special missing value such as A. or _.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Jun 2014 03:05:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issues-invalue-statement-ignores-length-specified/m-p/94859#M26825</guid>
      <dc:creator>agoldma</dc:creator>
      <dc:date>2014-06-29T03:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: Proc format issues: invalue statement ignores length specified with informats</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issues-invalue-statement-ignores-length-specified/m-p/94860#M26826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do not understand the original question.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Datetime stamps should be solved by SAS it is part of the interface &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://support.sas.com/kb/50/275.html"&gt;http://support.sas.com/kb/50/275.html&lt;/A&gt;&lt;SPAN&gt; .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The year 1582 is no SAS issue the calendar has changed that moment by the pope gregorian. This was not followed in the orthodox eastern world or protestants. The oktober revolution is remembered in November. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Jun 2014 10:58:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issues-invalue-statement-ignores-length-specified/m-p/94860#M26826</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-06-29T10:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Proc format issues: invalue statement ignores length specified with informats</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issues-invalue-statement-ignores-length-specified/m-p/94861#M26827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-top: 1.0pt; margin-bottom: 1.0pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;Jaap, please run through Owen's original code and watch the decimals.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 1.0pt; margin-bottom: 1.0pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;From what I understand, Owen would like to skip the decimals (show all zeroes for the decimals) instead of showing incorrect decimals.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 1.0pt; margin-bottom: 1.0pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;That's why he would like to read pre-1926 and post-2095 dates with low precision(ymddttm19.) and contemporary dates with high precision(ymddttm26.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 1.0pt; margin-bottom: 1.0pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;Even though SAS recognizes date-time stamps between 1582 and 1926, it recognizes them only to whole seconds, not to one-millionth of a second.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 1.0pt; margin-bottom: 1.0pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;On the one hand it would be great if SAS would allow 6-decimal precision for all date-time values, but on the other hand, do we really need to know that the "October Revolution" started exactly at '07nov1917 21:45:00.123456'dt? &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;I think that '07nov1917 21:45:00'dt is close enough. Dates prior to 1582 could be off by 10 days, so I don't want to go there.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Jun 2014 17:45:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issues-invalue-statement-ignores-length-specified/m-p/94861#M26827</guid>
      <dc:creator>agoldma</dc:creator>
      <dc:date>2014-06-29T17:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Proc format issues: invalue statement ignores length specified with informats</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issues-invalue-statement-ignores-length-specified/m-p/94862#M26828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Agoldma,&amp;nbsp; reading Owens arguments one was the gregorian argument.&amp;nbsp; Agree with you that this should not be really interesting knowing the background.&lt;/P&gt;&lt;P&gt;The other is the number of decimals on seconds. The SAS note is telling something did change at the dbms site and SAS knows that. Fixing the issue by SAS for all involved users is making life more easy than trying to fix that by yourself. That is my argument.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2014 07:39:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issues-invalue-statement-ignores-length-specified/m-p/94862#M26828</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-06-30T07:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Proc format issues: invalue statement ignores length specified with informats</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issues-invalue-statement-ignores-length-specified/m-p/94863#M26829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-top: 1.0pt; margin-bottom: 1.0pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Arial','sans-serif';"&gt;Jaap, I'm all in favor of improving SAS, but I'm not sure that SAS is doing anything wrong in this case. My best guess is that 8 bytes is not enough precision for 6 decimals in the date-time stamp, and 8 bytes is the largest size of a numeric variable. I would have to do a lot more testing before submitting this to SAS Tech Support.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2014 12:38:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issues-invalue-statement-ignores-length-specified/m-p/94863#M26829</guid>
      <dc:creator>agoldma</dc:creator>
      <dc:date>2014-06-30T12:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc format issues: invalue statement ignores length specified with informats</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issues-invalue-statement-ignores-length-specified/m-p/94864#M26830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Agoldma, the resolution of 8 byte floating point with the offset point of zero 1 Jan 1960 is well documented. The maximum is 15 digits, I would advice not to trust more than 12. This is standard IEE that intel has hard cooked in processors.&lt;/P&gt;&lt;P&gt;SAS is claiming to have solved the interfaces to Datetime stamps as part of their system. Why should TS support of SAS having problems to support their claims?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2014 14:06:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-format-issues-invalue-statement-ignores-length-specified/m-p/94864#M26830</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-06-30T14:06:03Z</dc:date>
    </item>
  </channel>
</rss>

