BookmarkSubscribeRSS Feed
Karolus
Obsidian | Level 7
Hi

I believed that Library names had to follow the SAS norms to be valid; i.e. they should begin with either a character or an underscore ( _ ) and after that other characters or NUMBERS are allowed.

However when I assing the following library:

LIBNAME MEGA712 BASE "W:\Stat\....\Testdata_subset";

1). there is no error message in the log...so it should be OK.

2). Then, I run the following sqL CREATE VIEW with 2 tables located in the mentioned library:


PROC SQL;
CREATE VIEW work.minimega AS
SELECT a.*, b.*
FROM MEGA712.Megadataset a, MEGA172.Megadataset2 b
WHERE a.PID=b.PID
AND a.Visit = b.Visit;
QUIT;

3). and again, there is no error message in the log...

4). but when I try to open the created VIEW, a get the following error message:

ERROR: Libname MEGA172 is not assigned.
ERROR: SQL View WORK.MINIMEGA could not be processed because at least one of the data sets, or
views, referenced directly (or indirectly) by it could not be located, or opened successfully.



after many attemps, someone suggest me to change the name of the library with just characters, like this:

LIBNAME MEGA BASE "W:\Stat\....\Testdata_subset";

and success! with the change of name from MEGA712 to MEGA I don't get anymore problems with the SQL view.

Later I test other non-SQL SAS procedures with the MEGA712 library and I don't have problems at all. Then, why I get such error message with the name MEGA172 but not with MEGA? any suggestions about this?


Kind regards
Karolus Message was edited by: Karolus
2 REPLIES 2
LAP
Quartz | Level 8 LAP
Quartz | Level 8
You show a libname definition for MEGA712, but not MEGA172. Has the libname MEGA172 also been defined? or are both of the dataset in the MEGA712 library?

> Hi
>
> I believed that Library names had to follow the SAS
> norms to be valid; i.e. they should begin with either
> a character or an underscore ( _ ) and after that
> other characters or NUMBERS are allowed.
>
> However when I assing the following library:
>
> LIBNAME MEGA712 BASE "W:\Stat\....\Testdata_subset";
>
> 1). there is no error message in the log...so it
> should be OK.
>
> 2). Then, I run the following sqL CREATE VIEW with 2
> tables located in the mentioned library:
>
>
> PROC SQL;
> CREATE VIEW work.minimega AS
> SELECT a.*, b.*
> FROM MEGA712.Megadataset a, MEGA172.Megadataset2 b
> WHERE a.PID=b.PID
> AND a.Visit = b.Visit;
> QUIT;
>
> 3). and again, there is no error message in the
> log...
>
> 4). but when I try to open the created VIEW, a get
> the following error message:
>
> ERROR: Libname MEGA172 is not assigned.
> ERROR: SQL View WORK.MINIMEGA could not be processed
> because at least one of the data sets, or
> views, referenced directly (or indirectly) by it
> could not be located, or opened successfully.

>
>
> after many attemps, someone suggest me to change the
> name of the library with just characters, like this:
>
> LIBNAME MEGA BASE "W:\Stat\....\Testdata_subset";
>
> and success! with the change of name from MEGA712 to
> MEGA I don't get anymore problems with the SQL view.
>
> Later I test other non-SQL SAS procedures with the
> MEGA712 library and I don't have problems at all.
> Then, why I get such error message with the name
> MEGA172 but not with MEGA? any suggestions about
> this?
>
>
> Kind regards
> Karolus
>
> Message was edited by: Karolus
Karolus
Obsidian | Level 7
Hi LAP

You're damn right, it was just a typo. You definitly have a good eye!! I can't believe I still make such a newbie mistake. Sorry for have you wasted your time.


Regards
Karolus

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 1758 views
  • 0 likes
  • 2 in conversation