<?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: Using Datalines in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-Datalines/m-p/264219#M51803</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15410"&gt;@data_null__﻿&lt;/a&gt;&amp;nbsp;Thanks for your help here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The embedded blanks are the spaces between the date and time? And between the last digit of the time and AM/PM?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can I determine, going forward, whether an&amp;nbsp;informat accounts&amp;nbsp;for those blanks, or whether I need the "&amp;amp;"? What exactly does the "&amp;amp;" do?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 15 Apr 2016 16:45:30 GMT</pubDate>
    <dc:creator>_maldini_</dc:creator>
    <dc:date>2016-04-15T16:45:30Z</dc:date>
    <item>
      <title>Using Datalines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Datalines/m-p/264027#M51728</link>
      <description>&lt;P&gt;I'm trying to better understand using the DATALINES statement so that I can use it to quickly test functions, etc. while working on a&amp;nbsp;SAS project. I want to be able to include LENGTH, INFORMATS and FORMATS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following code produces a few errors:&lt;/P&gt;
&lt;PRE&gt;	DATA test;
	INPUT 
		date1 : mmddyy8.
		date2 : mmddyy10.
		date3 : mdyampm25.2;
	DATALINES; 
	6/6/11 4/4/2012 03/26/12 12:58 AM
	7/6/11 3/4/2012 10/26/12 10:58 AM
	;
	FORMAT date1 date2 date3 datetime9.;
	RUN;&lt;/PRE&gt;
&lt;P&gt;I am getting an "invalid data" warning at each row for date1: "NOTE: Invalid data for date1 in line 62 1-7."&lt;/P&gt;
&lt;P&gt;Also, the FORMAT statement is producing an error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a better approach to the one I'm using here?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your assistance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 22:01:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Datalines/m-p/264027#M51728</guid>
      <dc:creator>_maldini_</dc:creator>
      <dc:date>2016-04-14T22:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using Datalines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Datalines/m-p/264030#M51730</link>
      <description>&lt;P&gt;You have a TAB in your data lines you can use INFILE statement option to remove it. &amp;nbsp;Also your FORMAT statement cannot come after datalines statement. Finally&amp;nbsp;and I think this is it you need &amp;amp; INFORMAT modified for date3 to read embedded&amp;nbsp;blanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA test;
   infile datalines expandtabs;
	INPUT 
		date1 : mmddyy10.
		date2 : mmddyy10.
		date3 &amp;amp; mdyampm25.2;
	FORMAT date1 date2 date3 datetime9.;
   DATALINES; 
   6/6/11 4/4/2012 03/26/12 12:58 AM
   7/6/11 3/4/2012 10/26/12 10:58 AM
;;;;
	RUN;
proc print;
   run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Apr 2016 22:21:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Datalines/m-p/264030#M51730</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2016-04-14T22:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using Datalines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Datalines/m-p/264031#M51731</link>
      <description>&lt;P&gt;Similar to what &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15410"&gt;@data_null__﻿&lt;/a&gt;'s suggestion, only add different format to help keeping time part information:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA test;
infile datalines TRUNCOVER EXPANDTABS ;
	INPUT 
		date1 : mmddyy10.
		date2 : mmddyy10.
		date3 : &amp;amp; mdyampm25.2;
FORMAT date1 date2 DATE9.
        date3 dateAMPM25.2;

	DATALINES; 
6/6/11 4/4/2012 03/26/12 12:58 AM
7/6/11 3/4/2012 10/26/12 10:58 AM
	;
	RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Apr 2016 22:28:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Datalines/m-p/264031#M51731</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2016-04-14T22:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using Datalines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Datalines/m-p/264049#M51737</link>
      <description>&lt;P&gt;One more thing, if you want to save typing a line of code. You never need a RUN statement after a datalines (or cards) block. Execution starts as soon as the block ends.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 01:18:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Datalines/m-p/264049#M51737</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-04-15T01:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using Datalines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Datalines/m-p/264219#M51803</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15410"&gt;@data_null__﻿&lt;/a&gt;&amp;nbsp;Thanks for your help here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The embedded blanks are the spaces between the date and time? And between the last digit of the time and AM/PM?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can I determine, going forward, whether an&amp;nbsp;informat accounts&amp;nbsp;for those blanks, or whether I need the "&amp;amp;"? What exactly does the "&amp;amp;" do?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 16:45:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Datalines/m-p/264219#M51803</guid>
      <dc:creator>_maldini_</dc:creator>
      <dc:date>2016-04-15T16:45:30Z</dc:date>
    </item>
  </channel>
</rss>

