<?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: I am trying to write a macro to calculating days for the all the dataset in libaray in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/I-am-trying-to-write-a-macro-to-calculating-days-for-the-all-the/m-p/198294#M266587</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Would you like to convert the dates to relative day number back into the same variables?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Or make new variables to hold the relative day numbers?&amp;nbsp; If so then how do propose generating names for all of these new variables?&amp;nbsp; Does your proposed algorithm insure that the generated names are unique and do not conflict with any existing variables in the data set?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You first need to show how you would do if for one case.&amp;nbsp; Then you can begin working on a macro that will generate the proper code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Apr 2015 12:04:49 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2015-04-17T12:04:49Z</dc:date>
    <item>
      <title>I am trying to write a macro to calculating days for the all the dataset in libaray</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-am-trying-to-write-a-macro-to-calculating-days-for-the-all-the/m-p/198292#M266585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please find the attached file and code file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Source data library contains two data set&amp;nbsp; : DEMO and AEDATA.&lt;/P&gt;&lt;P&gt;transaction data library contain one data set Metadata (metadata consist of variable information for example&amp;nbsp; action = "DATE" and dy = "Y" then NumDays = intck( 'day', startdate, endday ); )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Want to merge the Demo data with the both data set form Source data library (DEMO and AEDATA.) [aim to add RFSTDTC variable in all the dataset in source library] .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Then want to merge the&amp;nbsp; data with metadata then according to&amp;nbsp; the condition the calculation of the dates should occur action = "DATE" and dy = "Y" then NumDays = intck( 'day', startdate, endday );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Want calculate the date (days) difference using common data set&amp;nbsp;&amp;nbsp; ("DEMO. RFSTDTC").&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Anita&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2015 04:19:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-am-trying-to-write-a-macro-to-calculating-days-for-the-all-the/m-p/198292#M266585</guid>
      <dc:creator>anitapamu2</dc:creator>
      <dc:date>2015-04-17T04:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: I am trying to write a macro to calculating days for the all the dataset in libaray</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-am-trying-to-write-a-macro-to-calculating-days-for-the-all-the/m-p/198293#M266586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="2263" __jive_macro_name="document" class="jive_macro jive_macro_document" href="https://communities.sas.com/" modifiedtitle="true" title="How to ask a question in SAS Support Communities?"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://stackoverflow.com/help/mcve" title="http://stackoverflow.com/help/mcve"&gt;How to create a Minimal, Complete, and Verifiable example - Help Center - Stack Overflow&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2015 04:47:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-am-trying-to-write-a-macro-to-calculating-days-for-the-all-the/m-p/198293#M266586</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-04-17T04:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: I am trying to write a macro to calculating days for the all the dataset in libaray</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-am-trying-to-write-a-macro-to-calculating-days-for-the-all-the/m-p/198294#M266587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Would you like to convert the dates to relative day number back into the same variables?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Or make new variables to hold the relative day numbers?&amp;nbsp; If so then how do propose generating names for all of these new variables?&amp;nbsp; Does your proposed algorithm insure that the generated names are unique and do not conflict with any existing variables in the data set?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You first need to show how you would do if for one case.&amp;nbsp; Then you can begin working on a macro that will generate the proper code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2015 12:04:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-am-trying-to-write-a-macro-to-calculating-days-for-the-all-the/m-p/198294#M266587</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-04-17T12:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: I am trying to write a macro to calculating days for the all the dataset in libaray</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-am-trying-to-write-a-macro-to-calculating-days-for-the-all-the/m-p/198295#M266588</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;Well, a few things.&amp;nbsp; Firstly its not clear what your question is, am not writing a whole program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Secondly, write the code to something once before you try to look at macro.&amp;nbsp; Macro is at the end of the day just a code generator, so you need to know what your code should look like.&amp;nbsp; Also, look at it from another point, is a macro really necessary, can you code or arrange the data in a different way to do something in straight code.&amp;nbsp; There are some circumstances, i.e. if you develop a macro for a team, where creating a macro is good, and then you would follow SDLC anyways which would detail your code more or less.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the points you make, its pretty much all about merging.&amp;nbsp; There are many documents on SAS help about this, various types of merging etc. Or you might consider SQL merges: &lt;A class="active_link" href="http://blog.codinghorror.com/a-visual-explanation-of-sql-joins/" title="http://blog.codinghorror.com/a-visual-explanation-of-sql-joins/"&gt;A Visual Explanation of SQL Joins&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for calculating days difference you have numerous procedures INTCK for example, or if they are both dates just take one from the other.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2015 12:15:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-am-trying-to-write-a-macro-to-calculating-days-for-the-all-the/m-p/198295#M266588</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-04-17T12:15:15Z</dc:date>
    </item>
  </channel>
</rss>

