BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Santha
Pyrite | Level 9

Hi all. I am trying to use SASHELP.ZIPCODE in viya. I have a proc fedsql and i am trying to create a table by joining two simple tables called R and Z. Here is the code below. "Table "SASHELP.ZIPCODE" does not exist or cannot be accessed" is the error that I get. Is there a permission issue going on or something else not correct in the code below?

 

cas;
caslib _ALL_ assign;

 

proc fedsql sessref=casauto;
create table STDOPT.ModelingData as
(select R.Sitename,R.Sitezip,Z.X AS LATITUDE,Z.Y AS LONGITUDE
from SASHELP.ZIPCODE AS Z LEFT OUTER JOIN SANTSBOX.DATA as R
on Z.ZIP=R.Sitezip);
QUIT;

 

1 ACCEPTED SOLUTION

Accepted Solutions
maggiem_sas
SAS Employee

See this SAS Note:

http://support.sas.com/kb/63/384.html

Be sure to click on the Full Code tab to see how to create the proper LIBNAME statement for Sashelp data sets.

View solution in original post

4 REPLIES 4
tomrvincent
Rhodochrosite | Level 12
If you do something like 'data foo; set sashelp.zipcode; run;' do you get the same error?
Santha
Pyrite | Level 9

yes i get the same error. i had to make a copy of the sashelp.zipcode then go from there. thanks for ur input though

ballardw
Super User

@Santha wrote:

Hi all. I am trying to use SASHELP.ZIPCODE in viya. I have a proc fedsql and i am trying to create a table by joining two simple tables called R and Z. Here is the code below. "Table "SASHELP.ZIPCODE" does not exist or cannot be accessed" is the error that I get. Is there a permission issue going on or something else not correct in the code below?

 

cas;
caslib _ALL_ assign;

 

proc fedsql sessref=casauto;
create table STDOPT.ModelingData as
(select R.Sitename,R.Sitezip,Z.X AS LATITUDE,Z.Y AS LONGITUDE
from SASHELP.ZIPCODE AS Z LEFT OUTER JOIN SANTSBOX.DATA as R
on Z.ZIP=R.Sitezip);
QUIT;

 


It may help to post the ENTIRE proc step with errors from the log.

With a very simple query to fedsql I get:

8    proc fedsql;
NOTE: Writing HTML Body file: sashtml1.htm
9       create table work.junk
10      as select *
11      from sashelp.zipcode
12      ;
ERROR: Table "SASHELP.ZIPCODE" does not exist or cannot be accessed
ERROR: BASE driver, schema name SASHELP was not found for this connection
13   quit;

I use SASHELP.ZIPCODE frequently (not with FEDSQL though). I think that you need to use a special LIBNAME statement to make the BASE data sets accessible:

 

libname mybase base "<path to the SASHELP library where zipcodes resides.";

and use MYBASE>ZIPCODE.

 

I think part of the issue might be that the SASHELP library contains multiple directories as well. So a more specific path is needed.

maggiem_sas
SAS Employee

See this SAS Note:

http://support.sas.com/kb/63/384.html

Be sure to click on the Full Code tab to see how to create the proper LIBNAME statement for Sashelp data sets.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 925 views
  • 1 like
  • 4 in conversation