<?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 Operations on file with datetime in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Operations-on-file-with-datetime/m-p/904525#M357366</link>
    <description>&lt;P&gt;hello&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a question. It is possible to transform file A into file B simply and quickly (the files are relatively large) without using loops.&lt;/P&gt;
&lt;P&gt;Thank you for your answer.&lt;/P&gt;
&lt;P&gt;Best regards.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data A;
informat datetime  datetime19.;
input datetime; 
format datetime  datetime19.;
cards;
01NOV2023:00:00:00
02NOV2023:00:00:00
06NOV2023:00:00:00
13NOV2023:00:00:00
17NOV2023:00:00:00
run;


data B;
informat datetime  datetime19.;
input datetime; 
format datetime  datetime19.;
cards;
01NOV2023:00:00:00
01NOV2023:04:00:00
01NOV2023:08:00:00
01NOV2023:12:00:00
01NOV2023:16:00:00
02NOV2023:00:00:00
02NOV2023:04:00:00
02NOV2023:08:00:00
02NOV2023:12:00:00
02NOV2023:16:00:00
06NOV2023:00:00:00
06NOV2023:04:00:00
06NOV2023:08:00:00
06NOV2023:12:00:00
06NOV2023:16:00:00
13NOV2023:00:00:00
13NOV2023:04:00:00
13NOV2023:08:00:00
13NOV2023:12:00:00
13NOV2023:16:00:00
17NOV2023:00:00:00
17NOV2023:04:00:00
17NOV2023:08:00:00
17NOV2023:12:00:00
17NOV2023:16:00:00
run;&lt;/PRE&gt;</description>
    <pubDate>Sat, 25 Nov 2023 18:23:25 GMT</pubDate>
    <dc:creator>makset</dc:creator>
    <dc:date>2023-11-25T18:23:25Z</dc:date>
    <item>
      <title>Operations on file with datetime</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Operations-on-file-with-datetime/m-p/904525#M357366</link>
      <description>&lt;P&gt;hello&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a question. It is possible to transform file A into file B simply and quickly (the files are relatively large) without using loops.&lt;/P&gt;
&lt;P&gt;Thank you for your answer.&lt;/P&gt;
&lt;P&gt;Best regards.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data A;
informat datetime  datetime19.;
input datetime; 
format datetime  datetime19.;
cards;
01NOV2023:00:00:00
02NOV2023:00:00:00
06NOV2023:00:00:00
13NOV2023:00:00:00
17NOV2023:00:00:00
run;


data B;
informat datetime  datetime19.;
input datetime; 
format datetime  datetime19.;
cards;
01NOV2023:00:00:00
01NOV2023:04:00:00
01NOV2023:08:00:00
01NOV2023:12:00:00
01NOV2023:16:00:00
02NOV2023:00:00:00
02NOV2023:04:00:00
02NOV2023:08:00:00
02NOV2023:12:00:00
02NOV2023:16:00:00
06NOV2023:00:00:00
06NOV2023:04:00:00
06NOV2023:08:00:00
06NOV2023:12:00:00
06NOV2023:16:00:00
13NOV2023:00:00:00
13NOV2023:04:00:00
13NOV2023:08:00:00
13NOV2023:12:00:00
13NOV2023:16:00:00
17NOV2023:00:00:00
17NOV2023:04:00:00
17NOV2023:08:00:00
17NOV2023:12:00:00
17NOV2023:16:00:00
run;&lt;/PRE&gt;</description>
      <pubDate>Sat, 25 Nov 2023 18:23:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Operations-on-file-with-datetime/m-p/904525#M357366</guid>
      <dc:creator>makset</dc:creator>
      <dc:date>2023-11-25T18:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Operations on file with datetime</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Operations-on-file-with-datetime/m-p/904526#M357367</link>
      <description>&lt;P&gt;You can simply do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data b;
set a;
output;
datetime + '04:00't;
output;
datetime + '04:00't;
output;
datetime + '04:00't;
output;
datetime + '04:00't;
output;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But a code with a DO loop will look much cleaner, and be easier to adapt to other requiremments.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Nov 2023 19:11:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Operations-on-file-with-datetime/m-p/904526#M357367</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-11-25T19:11:57Z</dc:date>
    </item>
  </channel>
</rss>

