<?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 Using calculations or sas functions? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Using-calculations-or-sas-functions/m-p/170323#M44013</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've got a technical question. What the best to use? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to know the number of days between two dates should I use datedif or just do the math? lastdate-firstdate gives also the number of days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b=put(year(date),z4.)!!put(month(date),z2.)&amp;nbsp; or b=put(date,yymmn6.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;working on dates where I have is stored in two macrovariables. The first one is numeric and the second one is a format (yyyy/mm/dd). If I want to know the day should I use the day(numdate) or do substr(date_char,9,2)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Jul 2014 08:34:31 GMT</pubDate>
    <dc:creator>mojerry_realdolmen</dc:creator>
    <dc:date>2014-07-08T08:34:31Z</dc:date>
    <item>
      <title>Using calculations or sas functions?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-calculations-or-sas-functions/m-p/170323#M44013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've got a technical question. What the best to use? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to know the number of days between two dates should I use datedif or just do the math? lastdate-firstdate gives also the number of days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b=put(year(date),z4.)!!put(month(date),z2.)&amp;nbsp; or b=put(date,yymmn6.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;working on dates where I have is stored in two macrovariables. The first one is numeric and the second one is a format (yyyy/mm/dd). If I want to know the day should I use the day(numdate) or do substr(date_char,9,2)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2014 08:34:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-calculations-or-sas-functions/m-p/170323#M44013</guid>
      <dc:creator>mojerry_realdolmen</dc:creator>
      <dc:date>2014-07-08T08:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using calculations or sas functions?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-calculations-or-sas-functions/m-p/170324#M44014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the datediff, if its just number of days between you want, then - would probably be cheaper although you will hardly see any difference unless you have thousands or rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Macro variables are always text, so to do any calculation you need to input them into numeric.&lt;/P&gt;&lt;P&gt;day=day(input(&amp;amp;MVAR.,yymmdd10.));&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2014 08:46:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-calculations-or-sas-functions/m-p/170324#M44014</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-08T08:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using calculations or sas functions?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-calculations-or-sas-functions/m-p/170325#M44015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;true, as I have multiple calculations I do this in an empty dataset &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2014 08:57:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-calculations-or-sas-functions/m-p/170325#M44015</guid>
      <dc:creator>mojerry_realdolmen</dc:creator>
      <dc:date>2014-07-08T08:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using calculations or sas functions?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-calculations-or-sas-functions/m-p/170326#M44016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Whichever method will be easier to maintain and explain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; numdt=19912 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; chardt=2014/07/08 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; day=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%scan&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(&amp;amp;chardt,-1,/);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; day=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%substr&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(&amp;amp;chardt,9);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; day=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(day(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(inputn(&amp;amp;chardt,yymmdd10.))));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; day=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(day(&amp;amp;numdt));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; day=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(day(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(inputn(&amp;amp;chardt,yymmdd10.))),z2.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; day=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(day(&amp;amp;numdt),z2.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2014 12:15:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-calculations-or-sas-functions/m-p/170326#M44016</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-07-08T12:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using calculations or sas functions?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-calculations-or-sas-functions/m-p/170327#M44017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;to me the last code is the best looking. When you read it you know directly what it's doing.&lt;/P&gt;&lt;P&gt;the previous line is if your data is formatted but works as espected. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2014 12:24:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-calculations-or-sas-functions/m-p/170327#M44017</guid>
      <dc:creator>mojerry_realdolmen</dc:creator>
      <dc:date>2014-07-08T12:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using calculations or sas functions?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-calculations-or-sas-functions/m-p/170328#M44018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you make the character dates use DATE format instead of YYMMDD then you can use them as date literals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt; numdt=19912 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: blue;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt; chardt=08JUL2014 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-weight: inherit; font-style: inherit; font-family: 'Courier New'; color: blue;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-weight: inherit; font-style: inherit; font-family: 'Courier New'; color: black;"&gt; day=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-weight: inherit; font-style: inherit; font-family: 'Courier New'; color: blue;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em; font-weight: inherit; font-style: inherit; font-family: 'Courier New'; color: black;"&gt;(day(&amp;amp;numdt),z2.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-style: inherit; font-weight: inherit; font-family: 'Courier New'; color: blue;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-style: inherit; font-weight: inherit; font-family: 'Courier New'; color: black;"&gt; day=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-style: inherit; font-weight: inherit; font-family: 'Courier New'; color: blue;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-style: inherit; font-weight: inherit; font-family: 'Courier New'; color: black;"&gt;(day("&amp;amp;chardt"d),z2.);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2014 12:33:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-calculations-or-sas-functions/m-p/170328#M44018</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-07-08T12:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using calculations or sas functions?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-calculations-or-sas-functions/m-p/170329#M44019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;%let x=19912 ;&lt;/P&gt;&lt;P&gt;%let y=2014/10/10;&lt;/P&gt;&lt;P&gt;%let z = %sysfunc(inputn(&amp;amp;y,yymmdd10.));&lt;/P&gt;&lt;P&gt;%let a= %sysfunc(intck(day,&amp;amp;x,&amp;amp;z));&lt;/P&gt;&lt;P&gt;%put &amp;amp;x &amp;amp;y &amp;amp;z &amp;amp;a;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jul 2014 13:01:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-calculations-or-sas-functions/m-p/170329#M44019</guid>
      <dc:creator>Aman4SAS</dc:creator>
      <dc:date>2014-07-08T13:01:15Z</dc:date>
    </item>
  </channel>
</rss>

