<?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: Libname and libref/ import in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Libname-and-libref-import/m-p/625347#M20229</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/284322"&gt;@98ighcfdvxcghjk&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if your dataset is already a SAS dataset, there is no need to run a proc import -&amp;gt; just mention drug_a.h188a to refer to it&lt;/P&gt;
&lt;P&gt;e.g.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname drug_a "c:\NidiaSAS\SASLearn\";

Data test;
Set drug_a.h188a;
Run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;NB there is no need to put RUN after the libname statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if your dataset is a file (e.g. csv file), then do :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname drug_a "c:\NidiaSAS\SASLearn\";

PROC IMPORT DATAFILE= "c:\NidiaSAS\SASLearn\h188a.csv"
out=drug_a.h188a
dbms = csv
replace;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Feb 2020 16:54:58 GMT</pubDate>
    <dc:creator>ed_sas_member</dc:creator>
    <dc:date>2020-02-17T16:54:58Z</dc:date>
    <item>
      <title>Libname and libref/ import</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Libname-and-libref-import/m-p/625343#M20227</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to set up my dataset but I always forget what to do in order for SAS to read my dataset and the variables in it. This is what I have so far;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;libname drug_a "c:\NidiaSAS\SASLearn\";&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;PROC IMPORT DATAFILE= "c:\NidiaSAS|SASLearn\h188a"&lt;BR /&gt;out=&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The libname statement works but I forget what to do to make the dataset h188a go into the work folder so I can run tests on it. If anyone can help me without linking me to another forum that wont help me and just tell me what I should fix, I would appreciate it.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2020 16:44:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Libname-and-libref-import/m-p/625343#M20227</guid>
      <dc:creator>98ighcfdvxcghjk</dc:creator>
      <dc:date>2020-02-17T16:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Libname and libref/ import</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Libname-and-libref-import/m-p/625346#M20228</link>
      <description>&lt;P&gt;You would not use both PROC IMPORT on an Excel file and a LIBNAME statement pointing to the same Excel file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next, if you want the dataset created to go to the WORK library, you have to clean up the PROC IMPORT statement you typed, and specify the OUT= option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;PROC IMPORT DATAFILE= "c:\NidiaSAS&lt;FONT color="#FF0000"&gt;\&lt;/FONT&gt;SASLearn\h188a&lt;FONT color="#FF0000"&gt;.xlsx&lt;/FONT&gt;" out=&lt;FONT color="#FF0000"&gt;h188a&lt;/FONT&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2020 16:51:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Libname-and-libref-import/m-p/625346#M20228</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-02-17T16:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: Libname and libref/ import</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Libname-and-libref-import/m-p/625347#M20229</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/284322"&gt;@98ighcfdvxcghjk&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if your dataset is already a SAS dataset, there is no need to run a proc import -&amp;gt; just mention drug_a.h188a to refer to it&lt;/P&gt;
&lt;P&gt;e.g.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname drug_a "c:\NidiaSAS\SASLearn\";

Data test;
Set drug_a.h188a;
Run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;NB there is no need to put RUN after the libname statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if your dataset is a file (e.g. csv file), then do :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname drug_a "c:\NidiaSAS\SASLearn\";

PROC IMPORT DATAFILE= "c:\NidiaSAS\SASLearn\h188a.csv"
out=drug_a.h188a
dbms = csv
replace;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2020 16:54:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Libname-and-libref-import/m-p/625347#M20229</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-02-17T16:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Libname and libref/ import</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Libname-and-libref-import/m-p/625364#M20232</link>
      <description>&lt;P&gt;After you have successfully run the LIBNAME statement, you can test to see if your data set is already available using PROC CONTENTS:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=drug_a.h188a;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If your data is already there as a SAS data set, then you'll get a contents report and no errors in the SAS log. If your data was not in the library as a SAS data set, you'll get an error something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ERROR: File DRUG_A.H188A.DATA does not exist.&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;If your data is already a SAS data set, you don't need to copy it to the WORK library to use it. You can use it right from the "drug_a" library without the need to make a copy. For example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=drug_a.h188a;
  class drug;
  var age;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2020 17:42:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Libname-and-libref-import/m-p/625364#M20232</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2020-02-17T17:42:00Z</dc:date>
    </item>
  </channel>
</rss>

