<?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: problem with time duration in caslib table in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/problem-with-time-duration-in-caslib-table/m-p/929151#M2406</link>
    <description>here is my problem :&lt;BR /&gt;&lt;BR /&gt;data montest;&lt;BR /&gt;format tp1 time8. ;&lt;BR /&gt;tp1= 109320;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc fedsql;&lt;BR /&gt;create table montest2 as select * from montest ;&lt;BR /&gt;quit;</description>
    <pubDate>Tue, 21 May 2024 13:48:03 GMT</pubDate>
    <dc:creator>ajulio4</dc:creator>
    <dc:date>2024-05-21T13:48:03Z</dc:date>
    <item>
      <title>problem with time duration in caslib table</title>
      <link>https://communities.sas.com/t5/SAS-Viya/problem-with-time-duration-in-caslib-table/m-p/928250#M2394</link>
      <description>&lt;P&gt;Please can someone help me. I have SAS 9 table with colonne TPS whixh specify the duration. Eg i can have in this variable modality like&amp;nbsp;&lt;SPAN&gt;30:22:00. After chargin this table in my CASLIB, for the same record&amp;nbsp; this variable shows 6:22:00.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Seems like SAS ignore the 24 hours . After 24hours&amp;nbsp; SAS set to null the duration.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;How can i find issue to this problem ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2024 09:07:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/problem-with-time-duration-in-caslib-table/m-p/928250#M2394</guid>
      <dc:creator>ajulio4</dc:creator>
      <dc:date>2024-05-14T09:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: problem with time duration in caslib table</title>
      <link>https://communities.sas.com/t5/SAS-Viya/problem-with-time-duration-in-caslib-table/m-p/928283#M2396</link>
      <description>&lt;P&gt;What format was assigned to the variable? It sounds like you have an unwanted TimeAMPM type format assigned which would display 30:22:00 as 06:22:00 AM.&lt;/P&gt;
&lt;P&gt;Perhaps changing to the format to a simple TIME format would be what is needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2024 13:52:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/problem-with-time-duration-in-caslib-table/m-p/928283#M2396</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-05-14T13:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: problem with time duration in caslib table</title>
      <link>https://communities.sas.com/t5/SAS-Viya/problem-with-time-duration-in-caslib-table/m-p/928293#M2397</link>
      <description>&lt;P&gt;Not sure about CAS but in normal SAS that could just mean you have used TOD instead of TIME as the display format.&lt;/P&gt;
&lt;PRE&gt;5    data test;
6      duration = '30:22:00't ;
7      put duration= time12. duration=tod8.;
8    run;

duration=30:22:00 duration=06:22:00
&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 May 2024 14:55:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/problem-with-time-duration-in-caslib-table/m-p/928293#M2397</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-05-14T14:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: problem with time duration in caslib table</title>
      <link>https://communities.sas.com/t5/SAS-Viya/problem-with-time-duration-in-caslib-table/m-p/928423#M2398</link>
      <description>&lt;P&gt;It's the same with CAS.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.demo_compute;
  format dt_1 tod. dt_2 time.;
  dt_1='30:22:00't ;
  dt_2='30:22:00't ;
run;

title 'demo_compute';
proc print data=work.demo_compute;
run;

data casuser.demo_cas;
  set work.have;
run;

title 'demo_cas';
proc print data=casuser.demo_cas;
run;

proc casutil;
  alterTable
    casdata="demo_cas"
    columns={{name="dt_1" format="time."}}
  ;
quit;

title 'demo_cas after changing format'; 
proc print data=casuser.demo_cas;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1715738619520.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96534i0EC6ACFCCBB179FD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1715738619520.png" alt="Patrick_0-1715738619520.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 02:03:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/problem-with-time-duration-in-caslib-table/m-p/928423#M2398</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-05-15T02:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: problem with time duration in caslib table</title>
      <link>https://communities.sas.com/t5/SAS-Viya/problem-with-time-duration-in-caslib-table/m-p/929151#M2406</link>
      <description>here is my problem :&lt;BR /&gt;&lt;BR /&gt;data montest;&lt;BR /&gt;format tp1 time8. ;&lt;BR /&gt;tp1= 109320;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc fedsql;&lt;BR /&gt;create table montest2 as select * from montest ;&lt;BR /&gt;quit;</description>
      <pubDate>Tue, 21 May 2024 13:48:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/problem-with-time-duration-in-caslib-table/m-p/929151#M2406</guid>
      <dc:creator>ajulio4</dc:creator>
      <dc:date>2024-05-21T13:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: problem with time duration in caslib table</title>
      <link>https://communities.sas.com/t5/SAS-Viya/problem-with-time-duration-in-caslib-table/m-p/929161#M2407</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/337099"&gt;@ajulio4&lt;/a&gt;&amp;nbsp;Using your code which executes under compute (not CAS) and creates tables in work (not CAS) I can replicate what you describe. ...and I can also replicate what you describe under SAS9.4M8.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here the code I executed both under a recent Viya environment and under a local laptop install of SAS9.4M8&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc datasets lib=work nolist nowarn;
  delete montest montest2;
quit;

data montest;
  format tp1 time8. ;
  tp1= 109320;
  tp2= 109320;
run;

proc fedsql;
  create table montest2 as select * from montest ;
quit;

title 'montest';
proc print data=montest;
  format tp1 tp2 best32.;
run;
title 'montest2';
proc print data=montest2;
  format tp1 tp2 best32.;
run;
title;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1716301949461.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96650i7D9CF43C657D824F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1716301949461.png" alt="Patrick_0-1716301949461.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you can see the actual internal value got changed so it's not a simple display issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks to my like FedSQL doesn't deal correctly with a SAS source column that's numeric with a time format attached. Given that FedSQL then actually changes the internal value but only writes a Note (=no error condition) I consider this a bug and suggest you raise it with SAS Tech Support.&lt;/P&gt;
&lt;PRE&gt;NOTE: BASE driver, creation of a TIME column has been requested, but is not supported by the BASE driver. A DOUBLE PRECISION column 
      has been created instead. A format has been associated with each column.&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your source and target tables are both SAS tables (files) then just don't use FedSQL but Proc SQL or a data step instead.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 14:39:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/problem-with-time-duration-in-caslib-table/m-p/929161#M2407</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-05-21T14:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: problem with time duration in caslib table</title>
      <link>https://communities.sas.com/t5/SAS-Viya/problem-with-time-duration-in-caslib-table/m-p/929167#M2408</link>
      <description>&lt;P&gt;Is there some reason to use FEDSQL?&amp;nbsp; It seems to be the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't attach the TIME format you won't have the problem. (you can always attach it when you are actually producing output).&amp;nbsp; Or you can attach the DATETIME format instead.&amp;nbsp; FEDSQL does not appear to modify those values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;202  data _null_;
203   set montest;
204   put (_all_) (=) / (_all_) (=:best32.);
205  run;

tp1=30:22:00 tp2=02JAN1960:06:22:00 tp3=109320
tp1=109320 tp2=109320 tp3=109320
NOTE: There were 1 observations read from the data set WORK.MONTEST.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


206
207  data _null_;
208   set montest2;
209   put (_all_) (=) / (_all_) (=:best32.);
210  run;

tp1=6:22:00 tp2=02JAN1960:06:22:00 tp3=109320
tp1=22920 tp2=109320 tp3=109320
NOTE: There were 1 observations read from the data set WORK.MONTEST2.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 May 2024 15:48:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/problem-with-time-duration-in-caslib-table/m-p/929167#M2408</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-05-21T15:48:22Z</dc:date>
    </item>
  </channel>
</rss>

