<?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 new variable based on initial values of old variable. in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Create-new-variable-based-on-initial-values-of-old-variable/m-p/597222#M16109</link>
    <description>&lt;P&gt;Do you have a numeric variable formatted as datetime (aka proper sas datetime) or a string containing a datetime-value? When working with date and time data it is almost always useful to convert the data to a sas datetime.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And unfortunately i can't see any connection between the datetimes and the new variables.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Oct 2019 09:34:03 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2019-10-17T09:34:03Z</dc:date>
    <item>
      <title>Create new variable based on initial values of old variable.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-new-variable-based-on-initial-values-of-old-variable/m-p/597220#M16107</link>
      <description>&lt;P&gt;I have a variable with dates and time values such as:&lt;/P&gt;&lt;P&gt;22SEP15:15:10:35&lt;BR /&gt;06JUN16:15:03:53&lt;/P&gt;&lt;P&gt;I would like to create three new variables based on if the value start with 01-10,11-20 or 21-31.&lt;BR /&gt;But I am having problems only picking up the information of the first two digits.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2019 09:29:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-new-variable-based-on-initial-values-of-old-variable/m-p/597220#M16107</guid>
      <dc:creator>Fredron</dc:creator>
      <dc:date>2019-10-17T09:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: Create new variable based on initial values of old variable.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-new-variable-based-on-initial-values-of-old-variable/m-p/597222#M16109</link>
      <description>&lt;P&gt;Do you have a numeric variable formatted as datetime (aka proper sas datetime) or a string containing a datetime-value? When working with date and time data it is almost always useful to convert the data to a sas datetime.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And unfortunately i can't see any connection between the datetimes and the new variables.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2019 09:34:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-new-variable-based-on-initial-values-of-old-variable/m-p/597222#M16109</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-10-17T09:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Create new variable based on initial values of old variable.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-new-variable-based-on-initial-values-of-old-variable/m-p/597223#M16110</link>
      <description>&lt;P&gt;Hi and welcome to the SAS Community &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Are these actual datetime values (numeric) or character values?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2019 09:34:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-new-variable-based-on-initial-values-of-old-variable/m-p/597223#M16110</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-10-17T09:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create new variable based on initial values of old variable.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-new-variable-based-on-initial-values-of-old-variable/m-p/597232#M16114</link>
      <description>&lt;P&gt;I'm not sure to be honest, I just imported a dataset and did proc print to have a look at it.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2019 09:55:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-new-variable-based-on-initial-values-of-old-variable/m-p/597232#M16114</guid>
      <dc:creator>Fredron</dc:creator>
      <dc:date>2019-10-17T09:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Create new variable based on initial values of old variable.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-new-variable-based-on-initial-values-of-old-variable/m-p/597299#M16134</link>
      <description>&lt;P&gt;It seems like I have SAS datetime.&lt;/P&gt;&lt;P&gt;For the regression I am running I would like to see if it matters if it's the beginning, middle or the end of a month.&lt;BR /&gt;So I would like all events that happened during the 01-10 date of the months in one category, the events that happened during day 11-20 of the months in another and the last 21-31 in a third category.&lt;BR /&gt;But I am stuck, I just want SAS to check the first two numbers and sort after that, but can't get it to work.&lt;BR /&gt;&lt;BR /&gt;Thanks for all help&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2019 12:34:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-new-variable-based-on-initial-values-of-old-variable/m-p/597299#M16134</guid>
      <dc:creator>Fredron</dc:creator>
      <dc:date>2019-10-17T12:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Create new variable based on initial values of old variable.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-new-variable-based-on-initial-values-of-old-variable/m-p/597320#M16138</link>
      <description>&lt;P&gt;Sounds like you want to get to the day of the month.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;day(datepart(datetime_var))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And generate a new variable with 3 values.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;day=day(datepart(datetime_var));
if 0&amp;lt;day&amp;lt;=10 then month_part=1;
else if day &amp;lt;=20 then month_part=2;
else if day &amp;lt;=31 then month_part=3;
else month_part=.;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Oct 2019 15:32:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-new-variable-based-on-initial-values-of-old-variable/m-p/597320#M16138</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-10-17T15:32:19Z</dc:date>
    </item>
  </channel>
</rss>

