Solved

Using SQL in SAS with Multiple Dataset Locations

Posted on 2013-06-13
2
406 Views
Last Modified: 2013-06-14
I am trying to run the attached SAS program using SQL in my company's system, but I continue to have the same error.  I though it would be a simple LEFT JOIN, but I assume the two different dataset locations are the problem.  

I would appreciate any help you can provide.

Thank you very much.

George
SAS-Problem.txt
0
Comment
Question by:gwflyer
2 Comments
 
LVL 8

Accepted Solution

by:
ShannonEE earned 500 total points
ID: 39246412
Hi there  gwflyer,

Is this homework?  It may be so that I wont be providing actual code to make it work, but rather point out the problems you are probably having in understanding how sas works.

If this is not homework I am allowed to help further. In any case what I say below should be enough to get you going.

The problem is most likely with your libname statements and with your specification of the data set (table) that you want to read.  I say that because the log you supplied says that
File WORK.MYEMPLOYEE.DATA does not exist

The first table that the code (as currently written) is looking for is
dataset MYEMPLOYEE
in library WORK
of type DATA.

As you have used it, the libname statement needs to point to a folder which can contain 1 or more datasets. The datasets typically have operating system file names  like  "employeeHours.sas7bdat", but are referred with a SAS dataset name of employeeHours. Hence there should be files in your system with full path names of
/pdq/pub/employee/*.sas7bdat

To refer to a dataset in a particular library use the syntax <library>.<dataset>. Any dataset within SAS code without a preceding library name followed by a dot, are in the temporary library called WORK.  Hence
empdata
and
work.empdata
both refer to to same dataset.

===

First make sure that the libname statement points to a folder and not to the individual dataset.

Next in the SQL from clause use a double barrel name of  <library name>.<sas dataset>.

Hope this is enough to get along.

Ian
0
 

Author Closing Comment

by:gwflyer
ID: 39248443
Thank you very much.  This is a work-related problem and your guidance put me in the right direction.  You were exactly right and my program ran successfully.  I really appreciate the time you took to explain it in detail.   Thanks again.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
tidtcpserver connection lost handle 2 83
rhino JavaScript import, load 25 82
Regular Expression Calculator Tester 2 71
T-SQL:  Sigh---Boy, this is fun.... 12 46
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

806 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question