<?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: SAS is not reading my data file correctly in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685637#M207977</link>
    <description>&lt;P&gt;Once you have libraries for locations defined, you can always use them. Translating whole filenames to libname.dataset notation will be a breeze once you've done it a few times.&lt;/P&gt;</description>
    <pubDate>Tue, 22 Sep 2020 09:31:29 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-09-22T09:31:29Z</dc:date>
    <item>
      <title>SAS is not reading my data file correctly/</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685615#M207958</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am really new (and really bad) at SAS, and I am having trouble with having SAS read my data set correctly. Here is the code I wrote:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data 'C:\Users\bamfo\Downloads\bpx_j.sas7bdat';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And this is the log I received:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;1    data 'C:\Users\bamfo\Downloads\bpx_j.sas7bdat';
2    run;

NOTE: The data set C:\Users\bamfo\Downloads\bpx_j.sas7bdat has 1 observations and 0 variables.
NOTE: DATA statement used (Total process time):
      real time           0.13 seconds
      cpu time            0.06 seconds&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I downloaded this dataset from my class website. I know from looking at my data without SAS that the amount of variables in the data set is much more lengthy than just 1 observation and 0 variables. Did I type something wrong?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 08:21:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685615#M207958</guid>
      <dc:creator>ashb</dc:creator>
      <dc:date>2020-09-22T08:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: SAS is not reading my data file correctly/</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685616#M207959</link>
      <description>&lt;P&gt;The DATA statement initiates a data step, and the dataset(s) named in this statement will be&amp;nbsp;&lt;EM&gt;created&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;To use your dataset in a procedure (to print it, make a report, do analysis), you use it in the DATA= option of the respective PROCEDURE statement.&lt;/P&gt;
&lt;P&gt;To &lt;EM&gt;read&lt;/EM&gt; it into a data step, you either use the SET or MERGE statements.&lt;/P&gt;
&lt;P&gt;The preferred way to use a dataset is to specify a LIBNAME and use the library to access it.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname download "C:\Users\bamfo\Downloads";

data test; /* a single-level name will put this new dataset in library WORK */
set download.bpx_j;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Sep 2020 08:41:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685616#M207959</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-22T08:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: SAS is not reading my data file correctly/</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685617#M207960</link>
      <description>&lt;P&gt;PS Since your data step overwrote the dataset, you have to re-download it.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 08:41:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685617#M207960</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-22T08:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS is not reading my data file correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685618#M207961</link>
      <description>&lt;P&gt;1. The &lt;EM&gt;data&lt;/EM&gt; keyword creates a data set, so you not reading anything here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; You have overwritten your data set actually.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Surely you have learnt how to use SAS. What the keyword to start a statement when you want to read a data set?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. I am unsure how you are taught, but the string&amp;nbsp;&amp;nbsp;&lt;EM&gt;sas7bdat&amp;nbsp; &amp;nbsp;&lt;/EM&gt;is normally never seen in a program.&lt;/P&gt;
&lt;P&gt;What does your course say?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 08:44:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685618#M207961</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-09-22T08:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: SAS is not reading my data file correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685625#M207966</link>
      <description>I know the step is libname, but I thought you could use data to directly read a dataset into SAS without specifying a library?&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Sep 2020 09:04:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685625#M207966</guid>
      <dc:creator>ashb</dc:creator>
      <dc:date>2020-09-22T09:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS is not reading my data file correctly/</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685626#M207967</link>
      <description>Thanks for your detailed message. What do you mean by single level name?&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Sep 2020 09:05:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685626#M207967</guid>
      <dc:creator>ashb</dc:creator>
      <dc:date>2020-09-22T09:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS is not reading my data file correctly/</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685627#M207968</link>
      <description>So basically using data instead of libname in the first line of code overwrites the dataset?&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Sep 2020 09:06:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685627#M207968</guid>
      <dc:creator>ashb</dc:creator>
      <dc:date>2020-09-22T09:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS is not reading my data file correctly/</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685628#M207969</link>
      <description>What do your course notes say? &lt;BR /&gt;</description>
      <pubDate>Tue, 22 Sep 2020 09:11:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685628#M207969</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-09-22T09:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS is not reading my data file correctly/</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685630#M207971</link>
      <description>The notes say that libname is used to create a permanent library to access data sets from. This is the preferred way, however in the Little SAS book, I read that the data step can be used to directly read a dataset into SAS without specifying or creating a library using libname. Or perhaps I'm misinterpreting what they mean?&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Sep 2020 09:22:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685630#M207971</guid>
      <dc:creator>ashb</dc:creator>
      <dc:date>2020-09-22T09:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS is not reading my data file correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685631#M207972</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/347474"&gt;@ashb&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I know the step is libname, but I thought you could use data to directly read a dataset into SAS without specifying a library?&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, you can, but no, you don't.&lt;/P&gt;
&lt;P&gt;Using a library definition (LIBNAME) and a two-level name (library.dataset) is much easier than always writing out the complete filename. And if the location changes, you change ONE libname definition instead of a gazillion DATA/SET/MERGE/whatever statements or options.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 09:22:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685631#M207972</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-22T09:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS is not reading my data file correctly/</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685632#M207973</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test; /* no library specified - single level */
set download.bpx_j; /* library specified - two level */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/347474"&gt;@ashb&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks for your detailed message. What do you mean by single level name?&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 09:23:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685632#M207973</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-22T09:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS is not reading my data file correctly/</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685633#M207974</link>
      <description>&lt;P&gt;A dataset named in the DATA statement will be written to. If it exists, it will be overwritten, if not, created.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 09:25:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685633#M207974</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-22T09:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: SAS is not reading my data file correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685634#M207975</link>
      <description>I see. That may be my problem then, because I would have trouble with coding with other assignments after using the data step rather than the libname step.&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Sep 2020 09:26:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685634#M207975</guid>
      <dc:creator>ashb</dc:creator>
      <dc:date>2020-09-22T09:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS is not reading my data file correctly/</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685635#M207976</link>
      <description>Got it, thanks!&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Sep 2020 09:27:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685635#M207976</guid>
      <dc:creator>ashb</dc:creator>
      <dc:date>2020-09-22T09:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS is not reading my data file correctly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685637#M207977</link>
      <description>&lt;P&gt;Once you have libraries for locations defined, you can always use them. Translating whole filenames to libname.dataset notation will be a breeze once you've done it a few times.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Sep 2020 09:31:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-is-not-reading-my-data-file-correctly/m-p/685637#M207977</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-09-22T09:31:29Z</dc:date>
    </item>
  </channel>
</rss>

