<?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: How i read  vishal.csv file into SAS ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-i-read-vishal-csv-file-into-SAS/m-p/390703#M93749</link>
    <description>&lt;P&gt;1. Make sure the path is correct, you usually need the full path&lt;/P&gt;
&lt;P&gt;2. You have 4 scores not 5, so trying to read a score5 will mess things up. Remove it from your INPUT list.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Aug 2017 17:41:38 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-08-24T17:41:38Z</dc:date>
    <item>
      <title>How i read  vishal.csv file into SAS ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-i-read-vishal-csv-file-into-SAS/m-p/390692#M93745</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This is my &lt;STRONG&gt;vishal.csv&amp;nbsp;&lt;/STRONG&gt;file. How will i read this file in SAS&amp;nbsp;&amp;nbsp;? I tried to read like below-&lt;/P&gt;&lt;P&gt;data abc;&lt;/P&gt;&lt;P&gt;infile "vishal.csv" dsd ;&lt;/P&gt;&lt;P&gt;input name$ month$ score1 score2 score3 score4 score5 situatuon$ ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;vishal.csv--&lt;/P&gt;&lt;P&gt;JOHN,MAR,11,22,33,44,FINAL&lt;BR /&gt;JOHN,FEB,55,66,77,88,99,CURRENT&lt;BR /&gt;TINA,MAR,12,13,14,15,FINAL&lt;BR /&gt;TINA,FEB,17,18,19,20,21,CURRENT&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2017 17:21:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-i-read-vishal-csv-file-into-SAS/m-p/390692#M93745</guid>
      <dc:creator>Vishal1234</dc:creator>
      <dc:date>2017-08-24T17:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: How i read  vishal.csv file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-i-read-vishal-csv-file-into-SAS/m-p/390694#M93747</link>
      <description>&lt;P&gt;Is there a question here?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please review the guidelines on how to post a question.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-ask-a-question-in-SAS-Analytics-U-Communities/ta-p/221163" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-ask-a-question-in-SAS-Analytics-U-Communities/ta-p/221163&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are video's on the most common tasks here:&lt;/P&gt;
&lt;P&gt;support.sas.com/training/tutorial/&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2017 16:50:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-i-read-vishal-csv-file-into-SAS/m-p/390694#M93747</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-24T16:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: How i read  vishal.csv file into SAS ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-i-read-vishal-csv-file-into-SAS/m-p/390703#M93749</link>
      <description>&lt;P&gt;1. Make sure the path is correct, you usually need the full path&lt;/P&gt;
&lt;P&gt;2. You have 4 scores not 5, so trying to read a score5 will mess things up. Remove it from your INPUT list.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2017 17:41:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-i-read-vishal-csv-file-into-SAS/m-p/390703#M93749</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-24T17:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: How i read  vishal.csv file into SAS ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-i-read-vishal-csv-file-into-SAS/m-p/390708#M93751</link>
      <description>&lt;P&gt;If you did not copy the lines shown directly from the file then what you show will have issues as some records have 4 scores and others have 5.&lt;/P&gt;
&lt;P&gt;If the data is well formed csv the data would look like:&lt;/P&gt;
&lt;P&gt;JOHN,MAR,11,22,33,44,,FINAL&lt;BR /&gt;JOHN,FEB,55,66,77,88,99,CURRENT&lt;BR /&gt;TINA,MAR,12,13,14,15,,FINAL&lt;BR /&gt;TINA,FEB,17,18,19,20,21,CURRENT&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note the inserted extra comma in lines 1 and 3 where there are only 4 scores to idicate Score5 is missing,&lt;/P&gt;
&lt;P&gt;or the extra comma might appear between any score variable and adjacent depending on which score is actually missing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do not have well formed CSV and the actual number of scores varies you will have to do a fair bit of work especially if the number of missing scores is more than 1. It appears that there may be 5 scores only when the situation is "CURRENT" and 4 scores when situation is "FINAL". If that is the case you will have to provide some code to indicate which which line is which.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like this:&lt;/P&gt;
&lt;PRE&gt;data abc;
   infile datalines dlm=',' dsd ;
   input @;
   if findw(_infile_,'CURRENT')&amp;gt;0 then
         input name$ month$ score1 score2 score3 score4 score5 situatuon$ ;
   else  if findw(_infile_,'FINAL')&amp;gt;0 then
         input name$ month$ score1 score2 score3 score4  situatuon$ ;   
   else input;
datalines;
JOHN,MAR,11,22,33,44,FINAL
JOHN,FEB,55,66,77,88,99,CURRENT
TINA,MAR,12,13,14,15,FINAL
TINA,FEB,17,18,19,20,21,CURRENT
;
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Aug 2017 18:07:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-i-read-vishal-csv-file-into-SAS/m-p/390708#M93751</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-24T18:07:31Z</dc:date>
    </item>
  </channel>
</rss>

