<?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: Date and timezone causing invalid and preventing export in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-and-timezone-causing-invalid-and-preventing-export/m-p/742650#M232350</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5629"&gt;@Q1983&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Can you post your functional code with a sample data?&lt;/P&gt;</description>
    <pubDate>Thu, 20 May 2021 13:26:09 GMT</pubDate>
    <dc:creator>Sajid01</dc:creator>
    <dc:date>2021-05-20T13:26:09Z</dc:date>
    <item>
      <title>Date and timezone causing invalid and preventing export</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-and-timezone-causing-invalid-and-preventing-export/m-p/742534#M232292</link>
      <description>&lt;PRE&gt;/*I was presente a file with the similar structure*/
data have;
informat "Completion Date"N mmddyy10. ;
format "Completion Date"N mmddyy10. ;
input
"Completion Date"N;
run;

here is the output
1/11/2016 01:50 PM America/New York
NOTE: Invalid data for 'Completion Date'n
&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;i believe I get this invalid message due to the Completion Date not actually&lt;BR /&gt;being a format mmddyy10. It has some text in it&lt;/P&gt;
&lt;P&gt;Is there a way to reconfigure the informat or format to account for the &lt;BR /&gt;desired mmddyy10 date and the timezone that accompanies this???&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 23:43:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-and-timezone-causing-invalid-and-preventing-export/m-p/742534#M232292</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2021-05-19T23:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Date and timezone causing invalid and preventing export</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-and-timezone-causing-invalid-and-preventing-export/m-p/742539#M232296</link>
      <description>&lt;P&gt;Please post an example of your input data and the SAS log from your program run.&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 00:10:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-and-timezone-causing-invalid-and-preventing-export/m-p/742539#M232296</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-05-20T00:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Date and timezone causing invalid and preventing export</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-and-timezone-causing-invalid-and-preventing-export/m-p/742580#M232321</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5629"&gt;@Q1983&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;/*I was presente a file with the similar structure*/
data have;
informat "Completion Date"N mmddyy10. ;
format "Completion Date"N mmddyy10. ;
input
"Completion Date"N;
run;

here is the output
1/11/2016 01:50 PM America/New York
NOTE: Invalid data for 'Completion Date'n
&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;i believe I get this invalid message due to the Completion Date not actually&lt;BR /&gt;being a format mmddyy10. It has some text in it&lt;/P&gt;
&lt;P&gt;Is there a way to reconfigure the informat or format to account for the &lt;BR /&gt;desired mmddyy10 date and the timezone that accompanies this???&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You don't show a source for what you are reading with the INPUT. You should have either an INFILE statement or/and a cards/datalines block.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This does not shown any error when the Validvarname=any option is in effect:&lt;/P&gt;
&lt;PRE&gt;data have;
informat "Completion Date"N mmddyy10. ;
format "Completion Date"N mmddyy10. ;
input "Completion Date"N;
datalines;
1/11/2016 01:50 PM America/New York
;&lt;/PRE&gt;
&lt;P&gt;So you need to provide the actual stuff you ran, from the log that is showing the error. Copy the text from your log, open a text box on the forum with the &amp;lt;/&amp;gt; and then paste the copied text. The text box in important because the typical error messages with invalid data will show several lines in the log that use a monospace font for layout and that is important. The message windows will reformat text making the diagnostics from the log less useful and hard to read.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 01:48:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-and-timezone-causing-invalid-and-preventing-export/m-p/742580#M232321</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-05-20T01:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Date and timezone causing invalid and preventing export</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-and-timezone-causing-invalid-and-preventing-export/m-p/742650#M232350</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5629"&gt;@Q1983&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Can you post your functional code with a sample data?&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 13:26:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-and-timezone-causing-invalid-and-preventing-export/m-p/742650#M232350</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2021-05-20T13:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: Date and timezone causing invalid and preventing export</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-and-timezone-causing-invalid-and-preventing-export/m-p/742783#M232418</link>
      <description>&lt;P&gt;Lets try this a different way.&amp;nbsp; I attempted to replicate the issue in a sample dataset&lt;/P&gt;
&lt;PRE&gt;Data have;
infile cards truncover;
input email $20. first $30. last $30. age $3. completion_date $40.;
cards;
joesmith@email.com charles smith 1/11/2016 01:50 PM America/New York
ryna@email.com dennis jones 22 1/1/2016 01:50 PM America/Washington
;
run;&lt;/PRE&gt;
&lt;P&gt;Is there a way to bring in the data and account for the variations in the character size without having to specify the length (ie email $20. what if I get a longer email address)&amp;nbsp; I inserted truncover to account for missing data.&amp;nbsp; As for the date the character size may vary.&amp;nbsp; is there a way to account for this without having to estimate the character size&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 20:27:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-and-timezone-causing-invalid-and-preventing-export/m-p/742783#M232418</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2021-05-20T20:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Date and timezone causing invalid and preventing export</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-and-timezone-causing-invalid-and-preventing-export/m-p/742814#M232435</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5629"&gt;@Q1983&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;While there could be multiple approaches to address the issue, with the sample data you have provided,&lt;/P&gt;
&lt;P&gt;I would follow the following approach, I would like to have the data as csv.&lt;BR /&gt;My code would be as follows:&lt;BR /&gt;Please note I have reordered your variables. We would need to define a length for the Email column.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have (drop=_completion_date);
infile cards DLM=',' dsd;
Retain First Last Age Completion_date Email;
length Email $ 50  _completion_date $ 50;
format Completion_date mmddyy10.;
input  Email $ First $ Last $ Age   _completion_date $ ;
Completion_date=input(scan(_completion_date,1,''),mmddyy10.);
cards;
joesmith@email.com,	Charles,	Smith ,, 1/11/2016 01:50 PM America/New York
ryna@email.com	,	Dennis	,Jones , 22, 1/1/2016 01:50 PM America/Washington
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 02:29:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-and-timezone-causing-invalid-and-preventing-export/m-p/742814#M232435</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2021-05-21T02:29:58Z</dc:date>
    </item>
  </channel>
</rss>

