<?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: 0 observations and 18 variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/0-observations-and-18-variables/m-p/471135#M120651</link>
    <description>&lt;P&gt;Which program ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The log message says that SAS has created a dataset DST1 in the work library. This dataset has 18 columns but no row of data, i.e. it's an empty dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you show the code and describe expected output.&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jun 2018 15:46:01 GMT</pubDate>
    <dc:creator>gamotte</dc:creator>
    <dc:date>2018-06-18T15:46:01Z</dc:date>
    <item>
      <title>0 observations and 18 variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/0-observations-and-18-variables/m-p/471122#M120642</link>
      <description>&lt;P&gt;I run the program it come out this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: The data set WORK.DST1 has 0 observations and 18 variables. what does it mean ? Does it mean ? My data is in csv file .&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 15:15:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/0-observations-and-18-variables/m-p/471122#M120642</guid>
      <dc:creator>wguo1</dc:creator>
      <dc:date>2018-06-18T15:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: 0 observations and 18 variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/0-observations-and-18-variables/m-p/471134#M120650</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Observations in SAS are like rows or records of data. The message you are seeing indicates that the SAS data set (table) you have created holds no rows / records.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Share your code and a representative sample of the input data that can be read by your code. Also share the log.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 15:45:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/0-observations-and-18-variables/m-p/471134#M120650</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2018-06-18T15:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: 0 observations and 18 variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/0-observations-and-18-variables/m-p/471135#M120651</link>
      <description>&lt;P&gt;Which program ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The log message says that SAS has created a dataset DST1 in the work library. This dataset has 18 columns but no row of data, i.e. it's an empty dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you show the code and describe expected output.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 15:46:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/0-observations-and-18-variables/m-p/471135#M120651</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2018-06-18T15:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: 0 observations and 18 variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/0-observations-and-18-variables/m-p/471181#M120660</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi Amir,&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp; Thank you for helping me. Sample of data like that:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;please see the attached file.&lt;/DIV&gt;&lt;DIV&gt;&lt;P class="m_4245603946052125639gmail-MsoPlainText"&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;Thanks .&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;also, how should&amp;nbsp; I import data like this. it is a csv file. Thanks.&lt;/DIV&gt;</description>
      <pubDate>Mon, 18 Jun 2018 18:04:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/0-observations-and-18-variables/m-p/471181#M120660</guid>
      <dc:creator>wguo1</dc:creator>
      <dc:date>2018-06-18T18:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: 0 observations and 18 variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/0-observations-and-18-variables/m-p/471188#M120663</link>
      <description>&lt;DIV&gt;The code:&lt;/DIV&gt;&lt;DIV&gt;&lt;P class="m_-8370233395290644325m_342856979694569547gmail-MsoPlainText"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="m_-8370233395290644325m_342856979694569547gmail-MsoPlainText"&gt;&lt;STRONG&gt;&lt;SPAN&gt;COMMENT READ QUALITY DATA;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="m_-8370233395290644325m_342856979694569547gmail-MsoPlainText"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;DATA DST1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="m_-8370233395290644325m_342856979694569547gmail-MsoPlainText"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;INPUT PLOT CLe /*more , input 18 Variable*/&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="m_-8370233395290644325m_342856979694569547gmail-MsoPlainText"&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DATALINES;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 18 Jun 2018 18:28:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/0-observations-and-18-variables/m-p/471188#M120663</guid>
      <dc:creator>wguo1</dc:creator>
      <dc:date>2018-06-18T18:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: 0 observations and 18 variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/0-observations-and-18-variables/m-p/471312#M120705</link>
      <description>&lt;P&gt;You have to describe more precisely your needs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the contents of your csv file :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Trial - 2015,,,,,
,,,,,
food&amp;nbsp; quality data,,,,,
,,,,,
Plot,Cultigen number,Rep,Loc,Std,1
,,,,,
6360,1,1,CIe,6,11
,,,,,
6366,2,1,CIe,6,.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What should the output dataset look like ? What are the names/formats of the columns ?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jun 2018 07:46:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/0-observations-and-18-variables/m-p/471312#M120705</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2018-06-19T07:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: 0 observations and 18 variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/0-observations-and-18-variables/m-p/471320#M120708</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your data is in a separate csv file then there should be no need to use &lt;FONT face="courier new,courier"&gt;datalines&lt;/FONT&gt; as shown in your code. The data step you have shown is incomplete. Please copy and pate the log, showing the SAS code and any messages after it is executed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use the &lt;FONT face="courier new,courier"&gt;infile&lt;/FONT&gt; statement to specify the csv file and path:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=lestmtsref&amp;amp;docsetTarget=n1rill4udj0tfun1fvce3j401plo.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=lestmtsref&amp;amp;docsetTarget=n1rill4udj0tfun1fvce3j401plo.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A simple example template is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dst1;
   infile '&amp;lt;your-path-and-file-name.csv&amp;gt;' dsd;
   input &amp;lt;your-variable-names-and-formats&amp;gt;;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cannot download your file, but from what &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/30622"&gt;@gamotte&lt;/a&gt;&amp;nbsp;has shown it does not appear to have a clear structure which is why it would be helpful to also see the output you expect to see, based on the file you've provided, also as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/30622"&gt;@gamotte&lt;/a&gt;&amp;nbsp;has advised. You might need some extra logic in your data step to help you read in the csv file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jun 2018 09:35:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/0-observations-and-18-variables/m-p/471320#M120708</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2018-06-19T09:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: 0 observations and 18 variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/0-observations-and-18-variables/m-p/471338#M120721</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data FoodQualityData;
infile "path/filename.csv" firstobs = 6 dsd;
input Plot Cultigen number Rep Loc $ Std _1;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Jun 2018 13:43:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/0-observations-and-18-variables/m-p/471338#M120721</guid>
      <dc:creator>MadhuKorni</dc:creator>
      <dc:date>2018-06-19T13:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: 0 observations and 18 variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/0-observations-and-18-variables/m-p/471358#M120733</link>
      <description>HI , I try your code , but it is only read the first line of data which is&lt;BR /&gt;empty.&lt;BR /&gt;&lt;BR /&gt;here is the note form the lot:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;NOTE: The infile "C:\Users\Guo\Desktop\trail 2015.csv" is:&lt;BR /&gt;Filename=C:\Users\Guo\Desktop\trail 2015.csv,&lt;BR /&gt;RECFM=V,LRECL=32767,File Size (bytes)=145,&lt;BR /&gt;Last Modified=18Jun2018:13:56:50,&lt;BR /&gt;Create Time=18Jun2018:13:56:49&lt;BR /&gt;&lt;BR /&gt;NOTE: Invalid data for Plot in line 2 1-5.&lt;BR /&gt;NOTE: Invalid data for Cultigennumber in line 3 1-20.&lt;BR /&gt;NOTE: Invalid data for Rep in line 4 1-5.&lt;BR /&gt;NOTE: Invalid data for Loc in line 5 1-8.&lt;BR /&gt;NOTE: Invalid data for Std in line 5 9-16.&lt;BR /&gt;NOTE: Invalid data for _1 in line 5 17-24.&lt;BR /&gt;RULE:&lt;BR /&gt;----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+---&lt;BR /&gt;1 Trial - 2015,,,,, 17&lt;BR /&gt;2 ,,,,, 5&lt;BR /&gt;3 food quality data,,,,, 23&lt;BR /&gt;4 ,,,,, 5&lt;BR /&gt;5 Plot,Cultigen number,Rep,Loc,Std,1 34&lt;BR /&gt;Plot=. Cultigennumber=. Rep=. Loc=. Std=. _1=. _ERROR_=1 _N_=1&lt;BR /&gt;NOTE: 6 records were read from the infile "C:\Users\Guo\Desktop\\trail&lt;BR /&gt;2015.csv".&lt;BR /&gt;The minimum record length was 5.&lt;BR /&gt;The maximum record length was 34.&lt;BR /&gt;NOTE: SAS went to a new line when INPUT statement reached past the end of a&lt;BR /&gt;line.&lt;BR /&gt;NOTE: The data set WORK.FOODQUALITYDATA has 1 observations and 6 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.34 seconds&lt;BR /&gt;cpu time 0.32 seconds&lt;BR /&gt;&lt;BR /&gt;The output is like this :&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;SAS Output&lt;BR /&gt;The SAS System&lt;BR /&gt;Obs Plot Cultigennumber Rep Loc Std _1&lt;BR /&gt;1 . . . . . .&lt;BR /&gt;&lt;BR /&gt;do you know why? hoe can I fix it thanks.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Jun 2018 13:10:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/0-observations-and-18-variables/m-p/471358#M120733</guid>
      <dc:creator>wguo1</dc:creator>
      <dc:date>2018-06-19T13:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: 0 observations and 18 variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/0-observations-and-18-variables/m-p/471364#M120738</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data FoodQualityData;
infile "path/filename.csv" firstobs = 6 dsd;
input Plot Cultigen number Rep Loc $ Std _1;
run;

open your file and check from which line the data starts and mention it in firstobs option.&lt;BR /&gt;I found only 7 variables in the files. So, I mentioned only 7 variables in the input statement.

Ex : if the data starts from 6th line mention firstobs = 6
if it starts from 10th line then firstobs = 10&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Jun 2018 13:42:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/0-observations-and-18-variables/m-p/471364#M120738</guid>
      <dc:creator>MadhuKorni</dc:creator>
      <dc:date>2018-06-19T13:42:48Z</dc:date>
    </item>
  </channel>
</rss>

