<?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: Reading a date format 2020-07-14 11:00 EDT from a text file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-date-format-2020-07-14-11-00-EDT-from-a-text-file/m-p/698364#M213575</link>
    <description>&lt;P&gt;See this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
invalue ustz
  "AST" = 14400 /* ATLANTIC STANDARD TIME UTC - 4 */
  "EST" = 18000 /* EASTERN STANDARD TIME  UTC - 5 */
  "EDT" = 14400 /* EASTERN DAYLIGHT TIME  UTC - 4 */
  "CST" = 21600 /* CENTRAL STANDARD TIME UTC - 6 */
  "CDT" = 18000 /* CENTRAL DAYLIGHT TIME UTC - 5 */
  "MST" = 25200 /* MOUNTAIN STANDARD TIME  UTC - 7 */
  "MDT" = 21600 /* MOUNTAIN DAYLIGHT TIME  UTC - 6 */
  "PST" = 28800 /* PACIFIC STANDARD TIME UTC - 8 */
  "PDT" = 25200 /* PACIFIC DAYLIGHT TIME UTC - 7 */
  "AKST" = 32400 /* ALASKA TIME UTC - 9 */
  "AKDT" = 28800 /* ALASKA DAYLIGHT TIME  UTC - 8 */
  "HST" = 36000 /* HAWAII STANDARD TIME  UTC - 10 */
  "HAST" = 36000 /* HAWAII-ALEUTIAN STANDARD TIME UTC - 10 */
  "HADT" = 32400 /* HAWAII-ALEUTIAN DAYLIGHT TIME UTC - 9 */
  "SST" = 39600  /* SAMOA STANDARD TIME UTC - 11 */
  "SDT" = 36000 /* SAMOA DAYLIGHT TIME UTC - 10 */
  "CHST" = -36000 /* CHAMORRO STANDARD TIME  UTC +10 */
  other = 0
;

data want;
infile datalines;
input dttime e8601dt16. zone :$4.;
format dttime e8601dt19.;
dttime = dttime + input(zone,ustz.);
drop zone;
datalines;
2020-07-14 11:00 EDT
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The result will be the datetime in UTC.&lt;/P&gt;</description>
    <pubDate>Thu, 12 Nov 2020 12:25:34 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-11-12T12:25:34Z</dc:date>
    <item>
      <title>Reading a date format 2020-07-14 11:00 EDT from a text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-date-format-2020-07-14-11-00-EDT-from-a-text-file/m-p/698330#M213558</link>
      <description>&lt;P&gt;I am trying to import a pipe '|' delimited text file in SAS using PROC IMPORT. Though I am able to get most of the variable values except the date variable having value as '2020-07-14 11:00 EDT'. Please guide on how to handle this data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also please guide on various must use options while importing a text file so that no variables or values get missed out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 08:32:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-date-format-2020-07-14-11-00-EDT-from-a-text-file/m-p/698330#M213558</guid>
      <dc:creator>San_rise</dc:creator>
      <dc:date>2020-11-12T08:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a date format 2020-07-14 11:00 EDT from a text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-date-format-2020-07-14-11-00-EDT-from-a-text-file/m-p/698336#M213561</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;please guide on various must use options while importing a text file so that no variables or values get missed out.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;This means not using proc import, but rather using a data step and an INFILE statement.&lt;/P&gt;
&lt;P&gt;This will also allow you to process the date and time correctly.&lt;/P&gt;
&lt;P&gt;Many resources on the web such as since one&amp;nbsp;&lt;A href="https://support.sas.com/techsup/technote/ts673.pdf" target="_blank"&gt;https://support.sas.com/techsup/technote/ts673.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 09:17:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-date-format-2020-07-14-11-00-EDT-from-a-text-file/m-p/698336#M213561</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-11-12T09:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a date format 2020-07-14 11:00 EDT from a text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-date-format-2020-07-14-11-00-EDT-from-a-text-file/m-p/698338#M213563</link>
      <description>&lt;P&gt;Please help by specifying the format and informat for the date value&amp;nbsp;2020-07-14 11:00 EDT (YYYY-MM-DD HH:MM ZONE)&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 09:18:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-date-format-2020-07-14-11-00-EDT-from-a-text-file/m-p/698338#M213563</guid>
      <dc:creator>San_rise</dc:creator>
      <dc:date>2020-11-12T09:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: Reading a date format 2020-07-14 11:00 EDT from a text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-a-date-format-2020-07-14-11-00-EDT-from-a-text-file/m-p/698364#M213575</link>
      <description>&lt;P&gt;See this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
invalue ustz
  "AST" = 14400 /* ATLANTIC STANDARD TIME UTC - 4 */
  "EST" = 18000 /* EASTERN STANDARD TIME  UTC - 5 */
  "EDT" = 14400 /* EASTERN DAYLIGHT TIME  UTC - 4 */
  "CST" = 21600 /* CENTRAL STANDARD TIME UTC - 6 */
  "CDT" = 18000 /* CENTRAL DAYLIGHT TIME UTC - 5 */
  "MST" = 25200 /* MOUNTAIN STANDARD TIME  UTC - 7 */
  "MDT" = 21600 /* MOUNTAIN DAYLIGHT TIME  UTC - 6 */
  "PST" = 28800 /* PACIFIC STANDARD TIME UTC - 8 */
  "PDT" = 25200 /* PACIFIC DAYLIGHT TIME UTC - 7 */
  "AKST" = 32400 /* ALASKA TIME UTC - 9 */
  "AKDT" = 28800 /* ALASKA DAYLIGHT TIME  UTC - 8 */
  "HST" = 36000 /* HAWAII STANDARD TIME  UTC - 10 */
  "HAST" = 36000 /* HAWAII-ALEUTIAN STANDARD TIME UTC - 10 */
  "HADT" = 32400 /* HAWAII-ALEUTIAN DAYLIGHT TIME UTC - 9 */
  "SST" = 39600  /* SAMOA STANDARD TIME UTC - 11 */
  "SDT" = 36000 /* SAMOA DAYLIGHT TIME UTC - 10 */
  "CHST" = -36000 /* CHAMORRO STANDARD TIME  UTC +10 */
  other = 0
;

data want;
infile datalines;
input dttime e8601dt16. zone :$4.;
format dttime e8601dt19.;
dttime = dttime + input(zone,ustz.);
drop zone;
datalines;
2020-07-14 11:00 EDT
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The result will be the datetime in UTC.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 12:25:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-a-date-format-2020-07-14-11-00-EDT-from-a-text-file/m-p/698364#M213575</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-12T12:25:34Z</dc:date>
    </item>
  </channel>
</rss>

