<?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 How to insert a blank when needed in a date/time field in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-insert-a-blank-when-needed-in-a-date-time-field/m-p/768586#M39552</link>
    <description>&lt;P&gt;I have two types of events (Event_A , Event_B) and their associated timestamps.&amp;nbsp; There can be multiple timestamps for the same event.&amp;nbsp; I want to check the event for each row and create a computed field related to the timestamp field.&amp;nbsp; My "CASE" statement was originally:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CASE&lt;/P&gt;&lt;P&gt;WHEN event = EVENT_A&lt;/P&gt;&lt;P&gt;THEN timestamp&lt;/P&gt;&lt;P&gt;ELSE ' '&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This would give me an error that the second datatype doesn't match the first.&amp;nbsp; So, I changed it to:&lt;/P&gt;&lt;P&gt;CASE&lt;/P&gt;&lt;P&gt;WHEN event = EVENT_A&lt;/P&gt;&lt;P&gt;THEN timestamp&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works fine, but it puts a period when the test is false.&amp;nbsp; Is there a way to just leave the result blank?&amp;nbsp; I'll have two computed fields, EVENT_A_TMPSTP and EVENT_B_TMSTP.&amp;nbsp; I'll then find the minimum of each occurrence and move forward with those results.&amp;nbsp; I'm not sure how the period will play into this next step...&lt;/P&gt;&lt;P&gt;Thanks for any help!!&lt;/P&gt;&lt;P&gt;RPYee&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Sep 2021 15:32:33 GMT</pubDate>
    <dc:creator>RPYee</dc:creator>
    <dc:date>2021-09-20T15:32:33Z</dc:date>
    <item>
      <title>How to insert a blank when needed in a date/time field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-insert-a-blank-when-needed-in-a-date-time-field/m-p/768586#M39552</link>
      <description>&lt;P&gt;I have two types of events (Event_A , Event_B) and their associated timestamps.&amp;nbsp; There can be multiple timestamps for the same event.&amp;nbsp; I want to check the event for each row and create a computed field related to the timestamp field.&amp;nbsp; My "CASE" statement was originally:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CASE&lt;/P&gt;&lt;P&gt;WHEN event = EVENT_A&lt;/P&gt;&lt;P&gt;THEN timestamp&lt;/P&gt;&lt;P&gt;ELSE ' '&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This would give me an error that the second datatype doesn't match the first.&amp;nbsp; So, I changed it to:&lt;/P&gt;&lt;P&gt;CASE&lt;/P&gt;&lt;P&gt;WHEN event = EVENT_A&lt;/P&gt;&lt;P&gt;THEN timestamp&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works fine, but it puts a period when the test is false.&amp;nbsp; Is there a way to just leave the result blank?&amp;nbsp; I'll have two computed fields, EVENT_A_TMPSTP and EVENT_B_TMSTP.&amp;nbsp; I'll then find the minimum of each occurrence and move forward with those results.&amp;nbsp; I'm not sure how the period will play into this next step...&lt;/P&gt;&lt;P&gt;Thanks for any help!!&lt;/P&gt;&lt;P&gt;RPYee&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 15:32:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-insert-a-blank-when-needed-in-a-date-time-field/m-p/768586#M39552</guid>
      <dc:creator>RPYee</dc:creator>
      <dc:date>2021-09-20T15:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert a blank when needed in a date/time field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-insert-a-blank-when-needed-in-a-date-time-field/m-p/768589#M39553</link>
      <description>&lt;P&gt;You cannot store a character string, like a space, into a numeric variable.&lt;/P&gt;
&lt;P&gt;But you can change the way numeric missing values are printed by using the MISSING option.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  row=1;
  now=datetime();
  format now datetime19.;
  output;
  row=2;
  now=.;
  output;
run;

proc print data=test;
run;

options missing=' ';
proc print data=test;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 287px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63744iE4BD83D2646416A0/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 15:38:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-insert-a-blank-when-needed-in-a-date-time-field/m-p/768589#M39553</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-09-20T15:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert a blank when needed in a date/time field</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-insert-a-blank-when-needed-in-a-date-time-field/m-p/768616#M39554</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I'll have two computed fields, EVENT_A_TMPSTP and EVENT_B_TMSTP.&amp;nbsp; I'll then find the minimum of each occurrence and move forward with those results.&amp;nbsp; I'm not sure how the period will play into this next step...&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'm not sure how the blank will play into this next step. But it would be better, in my mind, to leave the missing there because for all arithmetic and functions and boolean comparisons, we know exactly how SAS will handle the missing value. You can use the MIN function, for example, and this will return the minimum of the non-missing values.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;min(event_a_tmpstp,event_b_tmstp)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So, when you are finding the minimum, and one of the two values is missing, what do YOU want as the result?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 17:15:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-insert-a-blank-when-needed-in-a-date-time-field/m-p/768616#M39554</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-09-20T17:15:22Z</dc:date>
    </item>
  </channel>
</rss>

