<?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: Help in user created format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322805#M71469</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;When I use format line:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp;other='%n %0H:%0M'(datatype=time);&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I get ERROR message:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;FONT color="#ff0000"&gt;ERROR&lt;/FONT&gt;: An unknown, abnormal error has occured etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt;&amp;nbsp;Sometimes I get artifacts in code copied from the forum that causes similar errors. Sometimes when editing those lines I will attempt to delete a character but it is still there indicating possibly a bad unicode or other character translation to the editor. I did not get any error from the shown format code though.&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jan 2017 21:07:01 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-01-05T21:07:01Z</dc:date>
    <item>
      <title>Help in user created format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322772#M71452</link>
      <description>&lt;P&gt;Dear,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the following format. I am not getting the output for the data values. Please help. Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc format;&lt;BR /&gt;picture fmt(default=10)&lt;BR /&gt;other='%n %0H:%0M'(datatype=time);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;code;&lt;/P&gt;&lt;P&gt;value=strip(put((AEDATE-TRTDATE),fmt.));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;aedate &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;trtdate&lt;/P&gt;&lt;P&gt;29JUL15:15:00&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;28JUL15:08:45&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output getting;&lt;/P&gt;&lt;P&gt;1 30:15&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output need&lt;/P&gt;&lt;P&gt;1 06:15&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 19:38:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322772#M71452</guid>
      <dc:creator>knveraraju91</dc:creator>
      <dc:date>2017-01-05T19:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Help in user created format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322785#M71457</link>
      <description>&lt;P&gt;I suggest rechecking your values of the datetime variables. For your example data I get 06:15&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the code I used to assign values and test:&lt;/P&gt;
&lt;PRE&gt;data junk;
    aedate = "29JUL15:15:00"dt;
    trtdate= "28JUL15:08:45"dt;
    format aedate trtdate datetime20.;
    value=strip(put((AEDATE-TRTDATE),fmt.));
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Jan 2017 20:27:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322785#M71457</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-01-05T20:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help in user created format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322789#M71458</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;I get the result you want

proc format;
picture fmt(default=10)
other='%n %0H:%0M'(datatype=time);
run;

data have;
 aedate = '29JUL15:15:00'dt;
trtdate = '28JUL15:08:45'dt;
dur=AEDATE-TRTDATE;
durc=put(dur,fmt12.);
put durc;
run;quit;

1 06:15&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Jan 2017 20:33:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322789#M71458</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2017-01-05T20:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Help in user created format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322790#M71459</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;I get the result you want

proc format;
picture fmt(default=10)
other='%n %0H:%0M'(datatype=time);
run;

data have;
 aedate = '29JUL15:15:00'dt;
trtdate = '28JUL15:08:45'dt;
dur=AEDATE-TRTDATE;
durc=put(dur,fmt12.);
put durc;
run;quit;

1 06:15&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 20:34:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322790#M71459</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2017-01-05T20:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help in user created format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322796#M71462</link>
      <description>&lt;P&gt;When I use format line:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp;other='%n %0H:%0M'(datatype=time);&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I get ERROR message:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;FONT color="#FF0000"&gt;ERROR&lt;/FONT&gt;: An unknown, abnormal error has occured etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I changed into:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;other='%&lt;STRONG&gt;n&lt;/STRONG&gt; %0H:%0M'(datatype=&lt;STRONG&gt;datetime&lt;/STRONG&gt;);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;then it is running without error but I get&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;result = &lt;STRONG&gt;0 06:01&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Then I changed the line into:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;other='%&lt;STRONG&gt;d&lt;/STRONG&gt; %0H:%0M'(datatype=&lt;STRONG&gt;datetime&lt;/STRONG&gt;);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;and i get : result = &lt;STRONG&gt;2 &amp;nbsp;06:01&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;though when I code&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;diff = '29JUL15:15:00'dt - '28JUL15:08:45'dt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;put diff= &lt;STRONG&gt;time7.&lt;/STRONG&gt; ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;the result is &lt;STRONG&gt;30:15&lt;/STRONG&gt; &amp;nbsp;which is &lt;U&gt;actually&lt;/U&gt; 1 06:15&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have used same data values as posted, that is:&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;29JUL15:15:00 &amp;nbsp; &amp;nbsp; 28JUL15:08:45&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I admit that I could not solve it, using SAS UE on linux.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 20:51:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322796#M71462</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-01-05T20:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help in user created format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322798#M71464</link>
      <description>&lt;P&gt;The correct answers are either:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1 06:15 or 30:15&lt;/P&gt;
&lt;P&gt;ie 30 hours and 15 minutes of wait time to treatment - that's horrid by the way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you may be misreading the 30:15 somehow? Slight modification of Roger's answer to show both values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data junk;
    aedate = "29JUL15:15:00"dt;
    trtdate= "28JUL15:08:45"dt;
    format aedate trtdate datetime20. diff myfmt. diff2 time8.;
    diff=AEDATE-TRTDATE;
    diff2=aedate-trtdate;
    diff_char=put(diff, myfmt.);
run;

proc print data=junk NOOBS;
var diff:;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 20:56:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322798#M71464</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-05T20:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: Help in user created format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322800#M71466</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt;&amp;nbsp;There were no errors on BASE SAS. I wonder if it's an artifact. If I use type = datetime the incorrect values are generated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS. I would recommend the word day or something in that format, its not obviously clear how to read that value at all.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
picture myfmt(default=20)
other='%n Day %0H:%0M'(datatype=time);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Jan 2017 20:58:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322800#M71466</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-05T20:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Help in user created format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322803#M71468</link>
      <description>&lt;P&gt;Thanks for the help. You are right.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when I run your code in sas on my desk top , I got the what you got.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I run in sas on my remote desk top, i am getting 1 30:15.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you any suggestions. Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc format;&lt;BR /&gt;picture fmt(default=10)&lt;BR /&gt;other='%n %0H:%0M'(datatype=time);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;aedate = '29JUL15:15:00'dt;&lt;BR /&gt;trtdate = '28JUL15:08:45'dt;&lt;BR /&gt;dur=AEDATE-TRTDATE;&lt;BR /&gt;durc=put(dur,fmt12.);&lt;BR /&gt;put durc;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 21:04:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322803#M71468</guid>
      <dc:creator>knveraraju91</dc:creator>
      <dc:date>2017-01-05T21:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Help in user created format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322805#M71469</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;When I use format line:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp;other='%n %0H:%0M'(datatype=time);&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I get ERROR message:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;FONT color="#ff0000"&gt;ERROR&lt;/FONT&gt;: An unknown, abnormal error has occured etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt;&amp;nbsp;Sometimes I get artifacts in code copied from the forum that causes similar errors. Sometimes when editing those lines I will attempt to delete a character but it is still there indicating possibly a bad unicode or other character translation to the editor. I did not get any error from the shown format code though.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 21:07:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322805#M71469</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-01-05T21:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Help in user created format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322811#M71474</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;- as I wrote I'm using SAS UE on linux in my laptop.&lt;/P&gt;
&lt;P&gt;I use a PC with windows for the forum, so I don't use copy/paste.&lt;/P&gt;
&lt;P&gt;In that specific case I typed data and code, and changing just "time" to "datetime"&amp;nbsp;&lt;/P&gt;
&lt;P&gt;prevented the error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Restarting my SAS session didn't help;&lt;/P&gt;
&lt;P&gt;I'll check it again some day later.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks, again.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 21:19:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322811#M71474</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-01-05T21:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Help in user created format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322818#M71477</link>
      <description>&lt;P&gt;Report this to SAS Tech Support. But I do remember a vague idea of a bug with SAS Studio and creating formats.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 21:44:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322818#M71477</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-05T21:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help in user created format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322891#M71492</link>
      <description>&lt;PRE&gt;
According documentation said, %n can't be used in all the encoding sas session.
e.g. if you are using University Edition ,you will get wrong result due to its utf-8 encoding.
So try other ways.

&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Jan 2017 04:01:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322891#M71492</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-01-06T04:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: Help in user created format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322896#M71495</link>
      <description>&lt;P&gt;Thank you very much&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2017 04:53:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-in-user-created-format/m-p/322896#M71495</guid>
      <dc:creator>knveraraju91</dc:creator>
      <dc:date>2017-01-06T04:53:43Z</dc:date>
    </item>
  </channel>
</rss>

