<?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: Import selective records in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Import-selective-records/m-p/293301#M61000</link>
    <description>?? Once you import that CSV file correctly and there is a DATE type variable date , you can use my code ,just replace SASHELP.CLASS with your HAVE dataset.</description>
    <pubDate>Tue, 23 Aug 2016 02:34:24 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-08-23T02:34:24Z</dc:date>
    <item>
      <title>Import selective records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-selective-records/m-p/292968#M60897</link>
      <description>&lt;P&gt;I've a CSV file which has last one year (Aug'15 to Jul'16) data. Now my requirement is to import only last 3 months (Jul'16 , Jun'16 &amp;amp; May'16) records without hardcoding. File has a date variable which has values like 21JUN2016 , 20JUL2016 , 31DEC2015 alongside other variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Appreciate if someone guide me with the code.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Aug 2016 09:12:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-selective-records/m-p/292968#M60897</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2016-08-21T09:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: Import selective records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-selective-records/m-p/292970#M60898</link>
      <description>&lt;P&gt;can you post some sample have dataset and what columns you want that would be helpful to give better solution. Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 21 Aug 2016 09:27:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-selective-records/m-p/292970#M60898</guid>
      <dc:creator>kumarK</dc:creator>
      <dc:date>2016-08-21T09:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: Import selective records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-selective-records/m-p/292971#M60899</link>
      <description>Since it is a interview question I don't have any example dataset. I need&lt;BR /&gt;to import all the variables including the key variable date.&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Sun, 21 Aug 2016 09:43:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-selective-records/m-p/292971#M60899</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2016-08-21T09:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: Import selective records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-selective-records/m-p/292975#M60900</link>
      <description>&lt;P&gt;How about this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
    create table want as
        select * from have
        where month(datevar) + 3 &amp;gt; (
           select max(month(datevar) from have));
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;- Jan.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Aug 2016 10:26:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-selective-records/m-p/292975#M60900</guid>
      <dc:creator>jklaverstijn</dc:creator>
      <dc:date>2016-08-21T10:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Import selective records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-selective-records/m-p/292980#M60901</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo﻿&lt;/a&gt;&amp;nbsp;Shouldnt you complete interview questions on your own? It's not a fair representation of your skill set otherwise.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Aug 2016 12:02:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-selective-records/m-p/292980#M60901</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-21T12:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Import selective records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-selective-records/m-p/293073#M60922</link>
      <description>&lt;PRE&gt;
You'd better post some data to let us test code:


proc sql;
create table want as
 select *
  from sashelp.air
   having date ge intnx('month',max(date),-2) ;
quit;


&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Aug 2016 09:11:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-selective-records/m-p/293073#M60922</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-08-22T09:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Import selective records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-selective-records/m-p/293148#M60937</link>
      <description>&lt;P&gt;Thanks for the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code subsetting the data from master SAS dataset (sashelp.air). But my question is to creating a master datset with subset of records. i.e.&amp;nbsp;I will need to create a SAS dataset by importing only selective records.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2016 14:16:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-selective-records/m-p/293148#M60937</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2016-08-22T14:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Import selective records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-selective-records/m-p/293301#M61000</link>
      <description>?? Once you import that CSV file correctly and there is a DATE type variable date , you can use my code ,just replace SASHELP.CLASS with your HAVE dataset.</description>
      <pubDate>Tue, 23 Aug 2016 02:34:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-selective-records/m-p/293301#M61000</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-08-23T02:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: Import selective records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-selective-records/m-p/293345#M61029</link>
      <description>I need to filter the records while importing not after importing&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Tue, 23 Aug 2016 05:28:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-selective-records/m-p/293345#M61029</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2016-08-23T05:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: Import selective records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-selective-records/m-p/293560#M61125</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt; wrote:&lt;BR /&gt;I need to filter the records while importing not after importing&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Good luck with that. If you are supposed to determine the last three months from the contents of the data file without reading it first then I suspect that you may have partially misunderstood the question.&lt;/P&gt;
&lt;P&gt;Generically I would have looked at&lt;/P&gt;
&lt;P&gt;1) read the data&lt;/P&gt;
&lt;P&gt;2) determine the last date in the data set&lt;/P&gt;
&lt;P&gt;3) then build a filter and subset the original data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or possibly the purpose of the question would be to get you to request clarification of the process.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2016 19:52:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-selective-records/m-p/293560#M61125</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-08-23T19:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: Import selective records</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-selective-records/m-p/293583#M61135</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;I suspect that you may have partially misunderstood the question.&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Interview questions are meant to test both understanding and technical ability so this is a good question according to that.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And yes, it's being misunderstood.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The solution is a single line of code (WHERE clause) in the data input step based on todays date and intnx function.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2016 21:23:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-selective-records/m-p/293583#M61135</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-23T21:23:40Z</dc:date>
    </item>
  </channel>
</rss>

