<?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: Reading half of my dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-half-of-my-dataset/m-p/793841#M254487</link>
    <description>&lt;P&gt;You are not reading the data correctly. Your INFILE and/or INPUT statements need to be modified.&lt;/P&gt;</description>
    <pubDate>Tue, 01 Feb 2022 16:25:11 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-02-01T16:25:11Z</dc:date>
    <item>
      <title>Reading half of my dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-half-of-my-dataset/m-p/793839#M254485</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I am trying to proc print a dataset which contains 8 rows and 9 variables.&lt;/P&gt;&lt;P&gt;it returns ONLY 4 observations for some reason.&lt;/P&gt;&lt;P&gt;thats my first lines of code below...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LIBNAME task2 'mypath';&lt;BR /&gt;/* OPTIONS VALIDVARNAME=v7; */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA fstloadtest;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; INFILE 'mypath/test.csv' DLM=',' FIRSTOBS=2 DSD;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; INPUT Date$:10. Home_Team$:40. Away_Team$:40. Home_Score:2. Away_Score:2. Tournament$:40. City$:40. Country$:40. Neutral$:5. Date2;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only way it returns all 8 observations, is by deleting one of the input variables. For example i have delete Tournament$:40 and it returns all 8 observations but instead of delete the tournaments observations, it deleted the last variables observations and repositioned the variables.&lt;BR /&gt;&lt;BR /&gt;Any thoughts?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 16:16:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-half-of-my-dataset/m-p/793839#M254485</guid>
      <dc:creator>Primohunter</dc:creator>
      <dc:date>2022-02-01T16:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: Reading half of my dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-half-of-my-dataset/m-p/793840#M254486</link>
      <description>&lt;P&gt;So your issue is not with reading a dataset, but with reading a text file into a dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should first try the TRUNCOVER option on the INFILE statement so that SAS will not go to a new line when the current line does not have enough fields to satisfy the INPUT statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then examine the dataset you get and compare it to the CSV file (should be easy with only 72 values) and make sure there are not some issues in the middle of the lines that is confusing the INPUT statement about where the variables should be read.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS It is strange to the : modifier in the middle of the informat on the INPUT statement.&amp;nbsp; Place the : modifier before the informat instead. And do not put a space in the middle of the character informat names.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;INPUT
  Date : $10. 
  Home_Team : $40. 
  Away_Team : $40. 
  Home_Score : 2. 
  Away_Score : 2. 
  Tournament : $40. 
  City : $40. 
  Country : $40. 
  Neutral : $5. 
  Date2
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also is DATE2 really just a number, like 1234?&amp;nbsp; If it is formatted on the lines of CSV so that a human can understand it as a date then you should probably read it with an appropriate DATE informat and also add a FORMAT statement to attach a format to the variable so it will print in a human readable way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 16:25:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-half-of-my-dataset/m-p/793840#M254486</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-02-01T16:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: Reading half of my dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-half-of-my-dataset/m-p/793841#M254487</link>
      <description>&lt;P&gt;You are not reading the data correctly. Your INFILE and/or INPUT statements need to be modified.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 16:25:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-half-of-my-dataset/m-p/793841#M254487</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-02-01T16:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Reading half of my dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-half-of-my-dataset/m-p/793848#M254492</link>
      <description>Thanks a lot. that option solved my issue. and thanks for the (:$10) tip!</description>
      <pubDate>Tue, 01 Feb 2022 17:02:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-half-of-my-dataset/m-p/793848#M254492</guid>
      <dc:creator>Primohunter</dc:creator>
      <dc:date>2022-02-01T17:02:04Z</dc:date>
    </item>
  </channel>
</rss>

