<?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: importing CSV file sas dataset in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/importing-CSV-file-sas-dataset/m-p/69636#M6967</link>
    <description>For  Perticular id,For first date status=Approval and for second&lt;BR /&gt;
date status=Refferal we have to swipe the values for status.&lt;BR /&gt;
&lt;BR /&gt;
Here is the results look.&lt;BR /&gt;
&lt;BR /&gt;
33822730 12/27/2007GH COMPETITOR Refferal&lt;BR /&gt;
33822730 2/4/2009 GH COMPETITOR Approval.&lt;BR /&gt;
33822730 1/12/2010 GH COMPETITOR Ship&lt;BR /&gt;
33822730 2/5/2010 GH COMPETITOR Approval&lt;BR /&gt;
33822730 2/11/2010 GH COMPETITOR Ship&lt;BR /&gt;
33822730 3/25/2010 GH COMPETITOR Ship</description>
    <pubDate>Mon, 30 May 2011 02:50:59 GMT</pubDate>
    <dc:creator>reddy19</dc:creator>
    <dc:date>2011-05-30T02:50:59Z</dc:date>
    <item>
      <title>importing CSV file sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/importing-CSV-file-sas-dataset/m-p/69632#M6963</link>
      <description>Hi,&lt;BR /&gt;
    I'm a beginner,i have to import csv file and make some changes and send the output to CSV file.Could somebody send the code.&lt;BR /&gt;
&lt;BR /&gt;
And also we have to apply these conditions,the order should be refferal,approval and ship.If approval comes first, we have to switch the values of approval and refferal(In line 7 of data approval came first,we have to switch the values based on&lt;BR /&gt;
Milestone_Date)&lt;BR /&gt;
&lt;BR /&gt;
Here is example data:&lt;BR /&gt;
&lt;BR /&gt;
DRC_CASE_ID Milestone_Date	Product	MILESTONE_TYPE&lt;BR /&gt;
&lt;BR /&gt;
24386200	1/18/2010	GH COMPETITOR	Referral&lt;BR /&gt;
6200	1/20/2010	GH COMPETITOR	Approval&lt;BR /&gt;
24386200	2/2/2010	GH COMPETITOR	Ship&lt;BR /&gt;
24386200	3/11/2010	GH COMPETITOR	Ship&lt;BR /&gt;
24386200	5/6/2010	GH COMPETITOR	Ship&lt;BR /&gt;
24386200	6/17/2010	GH COMPETITOR	Ship&lt;BR /&gt;
33822730	12/27/2007GH COMPETITOR	Approval&lt;BR /&gt;
33822730	2/4/2009	GH COMPETITOR	Referral&lt;BR /&gt;
33822730	1/12/2010	GH COMPETITOR	Ship&lt;BR /&gt;
33822730	2/5/2010	GH COMPETITOR	Approval&lt;BR /&gt;
33822730	2/11/2010	GH COMPETITOR	Ship&lt;BR /&gt;
33822730	3/25/2010	GH COMPETITOR	Ship</description>
      <pubDate>Wed, 25 May 2011 23:01:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/importing-CSV-file-sas-dataset/m-p/69632#M6963</guid>
      <dc:creator>reddy19</dc:creator>
      <dc:date>2011-05-25T23:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: importing CSV file sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/importing-CSV-file-sas-dataset/m-p/69633#M6964</link>
      <description>In EGuide, you can use file --&amp;gt; import to bring in the .csv file to a SAS dataset, then you can use the Query Builder to manipulate the data, and file--&amp;gt; export to send it back out again.&lt;BR /&gt;
&lt;BR /&gt;
I would recommend "SAS for dummies" or "the Little SAS book for EGuide x.x" to get you going on the data transformations, as it is rather difficult to narrate the interactive process of data transformations.</description>
      <pubDate>Fri, 27 May 2011 20:32:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/importing-CSV-file-sas-dataset/m-p/69633#M6964</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2011-05-27T20:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: importing CSV file sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/importing-CSV-file-sas-dataset/m-p/69634#M6965</link>
      <description>i know how to do that in EG...but i have to know how to apply conditions for above scenario in query builder.</description>
      <pubDate>Fri, 27 May 2011 20:44:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/importing-CSV-file-sas-dataset/m-p/69634#M6965</guid>
      <dc:creator>reddy19</dc:creator>
      <dc:date>2011-05-27T20:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: importing CSV file sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/importing-CSV-file-sas-dataset/m-p/69635#M6966</link>
      <description>You probably need to provide a sample of the desired output.  I can't tell which fields you want to swap values for.  Since you have duplicates of the milestone_type, you need to tell what  you want to do with those too.  This may not be something for query builder; it may need some other combination of procedures and/or data steps.

If you only have one of each, this could be done with a combination of transpose (split columns) and query  builder.&lt;BR /&gt;
&lt;BR /&gt;
    &lt;BR /&gt;
Message was edited by: Doc@Duke</description>
      <pubDate>Sat, 28 May 2011 20:40:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/importing-CSV-file-sas-dataset/m-p/69635#M6966</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2011-05-28T20:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: importing CSV file sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/importing-CSV-file-sas-dataset/m-p/69636#M6967</link>
      <description>For  Perticular id,For first date status=Approval and for second&lt;BR /&gt;
date status=Refferal we have to swipe the values for status.&lt;BR /&gt;
&lt;BR /&gt;
Here is the results look.&lt;BR /&gt;
&lt;BR /&gt;
33822730 12/27/2007GH COMPETITOR Refferal&lt;BR /&gt;
33822730 2/4/2009 GH COMPETITOR Approval.&lt;BR /&gt;
33822730 1/12/2010 GH COMPETITOR Ship&lt;BR /&gt;
33822730 2/5/2010 GH COMPETITOR Approval&lt;BR /&gt;
33822730 2/11/2010 GH COMPETITOR Ship&lt;BR /&gt;
33822730 3/25/2010 GH COMPETITOR Ship</description>
      <pubDate>Mon, 30 May 2011 02:50:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/importing-CSV-file-sas-dataset/m-p/69636#M6967</guid>
      <dc:creator>reddy19</dc:creator>
      <dc:date>2011-05-30T02:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: importing CSV file sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/importing-CSV-file-sas-dataset/m-p/69637#M6968</link>
      <description>data have;&lt;BR /&gt;
  infile datalines dsd dlm=' ' truncover;&lt;BR /&gt;
  input DRC_CASE_ID:$8. Milestone_Date:mmddyy. Product:$20. MILESTONE_TYPE:$8.;&lt;BR /&gt;
  format Milestone_Date mmddyy10.;&lt;BR /&gt;
  datalines;&lt;BR /&gt;
24386200 1/18/2010 GH_COMPETITOR Referral&lt;BR /&gt;
6200 1/20/2010 GH_COMPETITOR Approval&lt;BR /&gt;
24386200 2/2/2010 GH_COMPETITOR Ship&lt;BR /&gt;
24386200 3/11/2010 GH_COMPETITOR Ship&lt;BR /&gt;
24386200 5/6/2010 GH_COMPETITOR Ship&lt;BR /&gt;
24386200 6/17/2010 GH_COMPETITOR Ship&lt;BR /&gt;
33822730 12/27/2007 GH_COMPETITOR Approval&lt;BR /&gt;
33822730 2/4/2009 GH_COMPETITOR Referral&lt;BR /&gt;
33822730 1/12/2010 GH_COMPETITOR Ship&lt;BR /&gt;
33822730 2/5/2010 GH_COMPETITOR Approval&lt;BR /&gt;
33822730 2/11/2010 GH_COMPETITOR Ship&lt;BR /&gt;
33822730 3/25/2010 GH_COMPETITOR Ship &lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=have;&lt;BR /&gt;
  by DRC_CASE_ID Milestone_Date;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data ReferralSecond (keep=DRC_CASE_ID);&lt;BR /&gt;
  set have;&lt;BR /&gt;
  by DRC_CASE_ID;&lt;BR /&gt;
  if first.DRC_CASE_ID then counter=0;&lt;BR /&gt;
  counter+1;&lt;BR /&gt;
  if counter=2 and upcase(MILESTONE_TYPE)='REFERRAL' then output;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data want(drop=counter);&lt;BR /&gt;
  merge have ReferralSecond (in=RS);&lt;BR /&gt;
  by DRC_CASE_ID;&lt;BR /&gt;
  if first.DRC_CASE_ID and RS and upcase(MILESTONE_TYPE)='APPROVAL' then&lt;BR /&gt;
  do;&lt;BR /&gt;
    counter=0;&lt;BR /&gt;
    MILESTONE_TYPE=propcase('REFERRAL');&lt;BR /&gt;
  end;&lt;BR /&gt;
  counter+1;&lt;BR /&gt;
  if counter=2 and upcase(MILESTONE_TYPE)='REFERRAL' then MILESTONE_TYPE=propcase('APPROVAL');&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc print data=want;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
HTH&lt;BR /&gt;
Patrick</description>
      <pubDate>Mon, 30 May 2011 10:27:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/importing-CSV-file-sas-dataset/m-p/69637#M6968</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2011-05-30T10:27:56Z</dc:date>
    </item>
  </channel>
</rss>

