?
Solved

Using SQL in SAS with Multiple Dataset Locations

Posted on 2013-06-13
2
Medium Priority
?
417 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
ShannonEE earned 2000 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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

This is about my first experience with programming Arduino.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

743 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