<?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: Create variables and plots for UFOs in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-variables-and-plots-for-UFOs/m-p/462068#M284865</link>
    <description>&lt;P&gt;It appears that your values are actually date times. Maybe. CSV, which the file isn't, is not a SAS data set.&lt;/P&gt;
&lt;P&gt;Extract the Time value into a time variable. If the date time is a SAS date time value then the function TIMEPART will do that.&lt;/P&gt;
&lt;P&gt;Then use a custom format similar to the following with that TIME only variable.&lt;/P&gt;
&lt;PRE&gt;proc format;
value mytime
'19:00't &amp;lt; - '23:59't = 'Night'
'00:00't -   '05:00't = 'Night'
'05:00't &amp;lt; - '07:00't = 'Morning'
'07:00't &amp;lt; - '17:00't = 'Daytime'
'17:00't &amp;lt; - '19:00't = 'Evening'
;
run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest a format as you do not need to add additional variables but create a new format and use that if you decide you want 04:00 to 08:00 to be morning later, or perhaps reduce to 3 categories, or add. SAS will use&lt;/P&gt;</description>
    <pubDate>Mon, 14 May 2018 14:56:56 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-05-14T14:56:56Z</dc:date>
    <item>
      <title>Create variables and plots for UFOs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-variables-and-plots-for-UFOs/m-p/461917#M284863</link>
      <description>&lt;P&gt;&amp;nbsp;I have a data about the Ufo and now I want to study whether the time will influence the sightings,&amp;nbsp; I want to divide time in four parts and assumed that the Morning time is as 5:00-7:00, Daytime 7:00-17:00, Evening time 17:00-19:00 and night time is&amp;nbsp; 19:00-5:00. How can I write a code about that? Should I use the if else statement?&lt;/P&gt;</description>
      <pubDate>Mon, 14 May 2018 05:15:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-variables-and-plots-for-UFOs/m-p/461917#M284863</guid>
      <dc:creator>MichelleKorson</dc:creator>
      <dc:date>2018-05-14T05:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Create variables and plots for UFOs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-variables-and-plots-for-UFOs/m-p/461931#M284864</link>
      <description>&lt;P&gt;Tons of ways to do conditional processing. I would use the &lt;A href="https://blogs.sas.com/content/iml/2016/06/20/select-when-sas-data-step.html" target="_self"&gt;Select Statement&lt;/A&gt; in this case.&lt;/P&gt;</description>
      <pubDate>Mon, 14 May 2018 06:19:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-variables-and-plots-for-UFOs/m-p/461931#M284864</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-05-14T06:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: Create variables and plots for UFOs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-variables-and-plots-for-UFOs/m-p/462068#M284865</link>
      <description>&lt;P&gt;It appears that your values are actually date times. Maybe. CSV, which the file isn't, is not a SAS data set.&lt;/P&gt;
&lt;P&gt;Extract the Time value into a time variable. If the date time is a SAS date time value then the function TIMEPART will do that.&lt;/P&gt;
&lt;P&gt;Then use a custom format similar to the following with that TIME only variable.&lt;/P&gt;
&lt;PRE&gt;proc format;
value mytime
'19:00't &amp;lt; - '23:59't = 'Night'
'00:00't -   '05:00't = 'Night'
'05:00't &amp;lt; - '07:00't = 'Morning'
'07:00't &amp;lt; - '17:00't = 'Daytime'
'17:00't &amp;lt; - '19:00't = 'Evening'
;
run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest a format as you do not need to add additional variables but create a new format and use that if you decide you want 04:00 to 08:00 to be morning later, or perhaps reduce to 3 categories, or add. SAS will use&lt;/P&gt;</description>
      <pubDate>Mon, 14 May 2018 14:56:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-variables-and-plots-for-UFOs/m-p/462068#M284865</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-14T14:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: Create variables and plots for UFOs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-variables-and-plots-for-UFOs/m-p/462089#M284866</link>
      <description>&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/SAS-UFO-sightings-plot/m-p/461889#M15924" target="_blank"&gt;https://communities.sas.com/t5/SAS-GRAPH-and-ODS-Graphics/SAS-UFO-sightings-plot/m-p/461889#M15924&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;One of your classmates is having some difficulty as well.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 May 2018 15:26:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-variables-and-plots-for-UFOs/m-p/462089#M284866</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-05-14T15:26:16Z</dc:date>
    </item>
  </channel>
</rss>

