<?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: No observations in data set in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/No-observations-in-data-set/m-p/450133#M113337</link>
    <description>&lt;P&gt;The NOTEs are from the proc print, which is irrelevant here. Please post the log of the data step that reads the csv.&lt;/P&gt;</description>
    <pubDate>Sat, 31 Mar 2018 14:18:33 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-03-31T14:18:33Z</dc:date>
    <item>
      <title>No observations in data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-observations-in-data-set/m-p/450131#M113336</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting the following message:&lt;/P&gt;&lt;DIV class="sasNote"&gt;NOTE: No observations in data set PANKAJ.CAR_SALES.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: PROCEDURE PRINT used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.01 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.00 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;This is the code i wrote:&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;libname Pankaj '/folders/myfolders/Pankaj';&lt;BR /&gt;filename carsales '/folders/myfolders/Pankaj/Car sales.csv';&lt;BR /&gt;run;&lt;BR /&gt;data Pankaj.car_sales;&lt;BR /&gt;infile carsales dlm=',' missover dsd;&lt;BR /&gt;input manufacturer: $10.&lt;BR /&gt;model: $10.&lt;BR /&gt;sales: 4.3.;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;proc print data=Pankaj.car_sales (obs=5);&lt;BR /&gt;run;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;The file is located on my desktop under myfolder/pankaj and it is named Car sales and in csv format. Please help? Also, attached is the file. Thanks.&lt;/DIV&gt;</description>
      <pubDate>Sat, 31 Mar 2018 14:12:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-observations-in-data-set/m-p/450131#M113336</guid>
      <dc:creator>jhapankaj</dc:creator>
      <dc:date>2018-03-31T14:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: No observations in data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-observations-in-data-set/m-p/450133#M113337</link>
      <description>&lt;P&gt;The NOTEs are from the proc print, which is irrelevant here. Please post the log of the data step that reads the csv.&lt;/P&gt;</description>
      <pubDate>Sat, 31 Mar 2018 14:18:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-observations-in-data-set/m-p/450133#M113337</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-03-31T14:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: No observations in data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-observations-in-data-set/m-p/450135#M113338</link>
      <description>&lt;P&gt;You have multiple mistakes with the INPUT statement.&lt;/P&gt;
&lt;P&gt;The critical one is a syntactical mistake is you have two periods in the last informat specification.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;562   data car_sales;
563     infile carsales dlm=',' missover dsd;
564     input manufacturer: $10. model: $10. sales: 4.3.;
                                                       -
                                                       22
                                                       200
ERROR 22-322: Syntax error, expecting one of the following: a name, arrayname, #, (, +, -, /, //, ;, @, @@.

ERROR 200-322: The symbol is not recognized and will be ignored.

565   run;

&lt;/PRE&gt;
&lt;P&gt;You also should not have the decimal part on an INFORMAT. For an INFORMAT that means that SAS should assume that there is an implied decimal point when there is no decimal point in the text being read.&amp;nbsp; So if you read '1234' using 4.3 informat then the result is the number 1.234 and not the 1234.&lt;/P&gt;
&lt;P&gt;You do not need to provide any informat for SAS to understand how to read a number, especially when you are using list mode to read from a delimited file where there is no need to tell SAS how many characters to read.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input manufacturer :$10. model :$10. sales ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 31 Mar 2018 14:29:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-observations-in-data-set/m-p/450135#M113338</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-03-31T14:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: No observations in data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-observations-in-data-set/m-p/450137#M113340</link>
      <description>&lt;P&gt;Three things to add to what&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;said. You don't need a run statement after a filename statement. You should get into the practice of adding a run statement to end all datasteps. Your data contains a header record, thus you have to include a firstobs option to skip that record. e.g.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;libname Pankaj '/folders/myfolders/Pankaj';
filename carsales '/folders/myfolders/Pankaj/Car sales.csv';
data Pankaj.car_sales;
  infile carsales dlm=',' firstobs=2 missover dsd;
  input manufacturer: $10.
        model: $10.
        sales
        ;
run;

proc print data=Pankaj.car_sales (obs=5);
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 31 Mar 2018 14:39:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-observations-in-data-set/m-p/450137#M113340</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-03-31T14:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: No observations in data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-observations-in-data-set/m-p/450138#M113341</link>
      <description>&lt;P&gt;Thank you everyone!!! I will include these details in my programming.&lt;/P&gt;</description>
      <pubDate>Sat, 31 Mar 2018 14:45:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-observations-in-data-set/m-p/450138#M113341</guid>
      <dc:creator>jhapankaj</dc:creator>
      <dc:date>2018-03-31T14:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: No observations in data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-observations-in-data-set/m-p/450142#M113343</link>
      <description>&lt;P&gt;Personally I would just take the first line from the text file.&lt;/P&gt;
&lt;PRE&gt;Manufacturer,Model,Sales ,4-year resale value,Vehicle type,Price in thousands,Engine size,Horsepower,Wheelbase,Width,Length,Curb weight,Fuel capacity,Fuel efficiency,Latest Launch
&lt;/PRE&gt;
&lt;P&gt;Copy it into the SAS editor and convert it to a LENGTH statement to define the variables.&amp;nbsp; Some of the values will need to be changed to be valid SAS names. (Replace/remove spaces, start with letter or underscore, not too long for humans to type)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  length Manufacturer $15 Model $15 Sales 8 Resale4yr 8 
         Vehicle_type $20 PriceK 8 Engine_size 8
         Horsepower 8 Wheelbase 8 Width 8 Length 8 Curb_weight 8
         Fuel_capacity 8 Fuel_efficiency 8 Latest_Launch 8
  ;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Only the date value needs to have an informat for SAS to know how to read it.&amp;nbsp; Also the date value is the only one that needs a format attached so that its value will display in human readable format.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data car_sales;
  infile carsales dlm=',' truncover dsd firstobs=2 ;
  length Manufacturer $15 Model $15 Sales 8 Resale4yr 8 
         Vehicle_type $20 PriceK 8 Engine_size 8
         Horsepower 8 Wheelbase 8 Width 8 Length 8 Curb_weight 8
         Fuel_capacity 8 Fuel_efficiency 8 Latest_Launch 8
  ;
  informat Latest_Launch date.;
  format Latest_Launch yymmdd10. ;
  input Manufacturer -- Latest_Launch ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 31 Mar 2018 15:03:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-observations-in-data-set/m-p/450142#M113343</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-03-31T15:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: No observations in data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/No-observations-in-data-set/m-p/450148#M113344</link>
      <description>&lt;P&gt;Like&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;said, we all have our personal preferences. Mine, in this case, would be to run proc import. i.e.:&lt;/P&gt;
&lt;PRE&gt;proc import datafile='/folders/myfolders/Pankaj/Car sales.csv'
            out=have
            dbms=csv
            replace
  ;
run;
&lt;/PRE&gt;
&lt;P&gt;Doesn't always work perfectly, but does all of the grunt work and provides code that one can modify and, if necessary, re-run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 31 Mar 2018 15:24:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/No-observations-in-data-set/m-p/450148#M113344</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-03-31T15:24:03Z</dc:date>
    </item>
  </channel>
</rss>

