<?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: BASE SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/BASE-SAS/m-p/386902#M92720</link>
    <description>&lt;P&gt;Please use some formatting in your post.&lt;/P&gt;
&lt;P&gt;For SAS code or logs, use the "little running man" and {i} buttons to open windows for posting such.&lt;/P&gt;</description>
    <pubDate>Thu, 10 Aug 2017 09:02:28 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-08-10T09:02:28Z</dc:date>
    <item>
      <title>BASE SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/BASE-SAS/m-p/386897#M92718</link>
      <description>&lt;P&gt;Refer to the below sample transaction table, where sales are summarized at every transaction level mapped to a customer ID. Your task to write efficient SAS codes to answer the following questions: --------------------------------------------------------------------------------------a. Summarize sales &amp;amp; number of customers by visit number. For example, customer B made his 1st visit on 14 Jan &amp;amp; 2nd visit on 19 Mar. ------------------------------------------------------------------------------------------b. Summarize sales &amp;amp; number of customers by number of visits . For example, customer A has made 4 visits, Customer B has made 2 visits, etc Your answer for the above scenarios I have written the following code : data test; informat trans_date date9.; input cus_id $ trans_date trans_id sales; format trans_date date9.; cards; A 10-jan-16 102254 166 A 20-jan-16 109690 24 A 05-feb-16 103680 52 A 08-mar-16 116647 99 B 14-jan-16 110551 104 B 19-mar-16 115248 98 C 05-feb-16 111657 163 D 29-jan-16 112647 84 D 29-jan-16 116793 191 D 03-mar-16 116398 116 D 06-feb-16 112700 192 D 04-apr-16 117257 107 E 01-mar-16 118569 195 E 08-mar-16 109485 131 F 22-mar-16 112171 129 F 08-apr-16 113826 44 F 16-apr-16 114416 160 ; run; proc sort data=test; by cus_id; run; data test2(rename=x=visit_number); set test; by cus_id; if first.cus_id then x=1; else x+1; run; *** first scenario***** proc sql; create want1 as select sum(sales) as sales_sum,count(cus_id) as no_of_customers,visit_number from test2 group by visit_number; quit; ** second scenario*** proc sql; create table test3 as select sum(sales) as sale,cus_id,count(visit_number) as count_visit from test2 group by cus_id; quit; proc sql; select sale ,count(cus_id) as no_of_customers,count_visit as no_of_visits from test3 group by count_visit; quit; Could you please tell me whether that code is fine or correct me if anythng is wrong.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 08:51:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/BASE-SAS/m-p/386897#M92718</guid>
      <dc:creator>molla</dc:creator>
      <dc:date>2017-08-10T08:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: BASE SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/BASE-SAS/m-p/386902#M92720</link>
      <description>&lt;P&gt;Please use some formatting in your post.&lt;/P&gt;
&lt;P&gt;For SAS code or logs, use the "little running man" and {i} buttons to open windows for posting such.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 09:02:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/BASE-SAS/m-p/386902#M92720</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-08-10T09:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: BASE SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/BASE-SAS/m-p/386903#M92721</link>
      <description>&lt;P&gt;Several things:&lt;/P&gt;
&lt;P&gt;First setting the Subject of your post "BASE SAS" is totally non-descriptive and useless as a post Subject.&lt;/P&gt;
&lt;P&gt;Secondly your post is one block of unreadable text, try applying some formatting, posting code in the code window (its the {i} above the post area) and using tabs and returns to format the text as you would when reading any material.&lt;/P&gt;
&lt;P&gt;Finally, this looks like some sort of learning excercise. &amp;nbsp;Thus you should be learning this, if you have specific questions about, please be specific about them.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 09:06:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/BASE-SAS/m-p/386903#M92721</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-08-10T09:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: BASE SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/BASE-SAS/m-p/387027#M92749</link>
      <description>&lt;P&gt;And to through something back at whatever source of this project:&lt;/P&gt;
&lt;P&gt;The requirement "Your task to write efficient SAS codes to answer the following questions:" does not provide how you are to measure "efficiency". Efficient could mean: minimize run time, minimize memory and/or disk space, make the code easy to maintain, robust to identify unexpected data conditions so that follow on processes are not started with incomplete/incompatible data and likely a few other things depending on the scope of a project.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 14:38:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/BASE-SAS/m-p/387027#M92749</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-10T14:38:40Z</dc:date>
    </item>
  </channel>
</rss>

