Learning SAS? Welcome to the exclusive online community for all SAS learners.

To define the orion library, follow the steps for the SAS software you are using to do the practices

Reply
New Contributor
Posts: 4

To define the orion library, follow the steps for the SAS software you are using to do the practices

Programm: SAS Programming 1

SAS University Edition / SAS Studio

 

 

I am trying to define Orian  but no luck.

 

How can I define Orion library to complete my prctice tests. I was able to do the setup and do the followings

 ----You have set up your practice data. Each time you start SAS Studio to practice in this course, open the Snippets panel and expand the My Snippets folder. Double-click setup to add the code to the Code tab. After you run the program, you can access your practice data for the course. Each practice page reminds you to define the orion library and has a link to this setup page----

 

What do I have to do after this step to actually solve the practice data…..

 

 

Please see attached screen shots

 Errors (1) 



  ERROR: Physical file does not exist, /opt/sasinside/SASConfig/Lev1/SASApp/FILEPATH/country.dat. 



 Warnings (2) 



  WARNING: The data set WORK.NEWCOUNTRY may be incomplete. When this step was stopped there were 0 observations and 2 variables. 



  WARNING: Data set WORK.NEWCOUNTRY was not replaced because this step was stopped. 



 Notes (7) 



































 
 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 61         
 62         
 63         proc print data=work.newcountry;
 64         run;
 
 NOTE: No observations in data set WORK.NEWCOUNTRY.
 NOTE: PROCEDURE PRINT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 64       !       %let path=FILEPATH;
 


Super User
Posts: 17,750

Re: To define the orion library, follow the steps for the SAS software you are using to do the pract

It's hard to tell from your data/post - please take a few minutes to format it in the future - but it looks like you didn't define the snippet correctly, things are not in the correct order.

 

1. Post the exact code submitted

2. Include the log and error if you received one

3. Search here for answers, 99% likely someone's already asked and answered this question (I answer it almost every other day).

4. Search on SAS UE Help Center 

New Contributor
Posts: 4

Re: To define the orion library, follow the steps for the SAS software you are using to do the pract

After I open my Snippet, double clicked setup and typed this code


Code


%let path=FILEPATH;
libname orion "/folders/myfolders/ecprg193";


Log

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
61
62 %let path=FILEPATH;
63 libname orion "/folders/myfolders/ecprg193";
NOTE: Libref ORION was successfully assigned as follows:
Engine: V9
Physical Name: /folders/myfolders/ecprg193
64
65 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
78



Now i just want to know how can I define Orion library so that I can
perform practice tests.

As when I am taking class it asks me to do following


SAS University Edition / SAS Studio

1. Open and submit the *setup.sas* program that you saved when you set
up practice files for this course.
2. Check the log to verify that SAS successfully assigned the libraries.



Can you please tell me how to open and submit the setup.sas

Thank you
##- Please type your reply above this line. Simple formatting, no
attachments. -##
Super User
Posts: 17,750

Re: To define the orion library, follow the steps for the SAS software you are using to do the pract

According to the log it ran correctly this time, note the lack of errors and the successful LIBNAME statement.

 

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
61
62 %let path=FILEPATH;
63 libname orion "/folders/myfolders/ecprg193";
NOTE: Libref ORION was successfully assigned as follows:
Engine: V9
Physical Name: /folders/myfolders/ecprg193
64
65 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
78

New Contributor
Posts: 4

Re: To define the orion library, follow the steps for the SAS software you are using to do the pract

I understand ...what should I do after that ...

How to I define Orion library so that I can practice test , I am taking SAS
(R) programming 1: essestial



##- Please type your reply above this line. Simple formatting, no
attachments. -##
SAS Super FREQ
Posts: 8,740

Re: To define the orion library, follow the steps for the SAS software you are using to do the pract

Hi: we want you to replace the word FILEPATH in the %LET statement with YOUR file path location, like this:
%let path=/folders/myfolders/ecprg193;
libname orion "&path";

because &PATH is a "helper" macro variable that our programs will all expect to be set and if you leave &PATH=FILEPATH, then all of the OTHER programs will fail, even if your LIBNAME statement worked.

Every program in the class that uses an INFILE statement has this:

INFILE "&path/filename.ext" ... ;

where &path is meant to have /folders/myfolders/ecprg193 (or whatever your path was) substituted. So if you submit your LIBNAME statement, but the %LET is wrong, eventually some of the programs will fail.

Please fix your setup to be these 2 statements:
%let path=/folders/myfolders/ecprg193;
libname orion "&path";

And then I recommend running the setup program from Task 2 again, because &PATH is used for the location of the "raw" data files like COUNTRY.DAT and NEWEMPS.CSV, so if &PATH was not assigned correctly, those files were NOT created correctly.

I am confident that if you fix your set up statements and resubmit the data creation program and THEN, remember to submit those same 2 set up statements every time you want to work, that you will be able to work with PRogramming 1.

cynthia
Occasional Contributor
Posts: 8

Re: To define the orion library, follow the steps for the SAS software you are using to do the pract

Hello,

Thank you all for your prompt responses. You are correct, I had multiple
pathways that I had tried. I had set up the folder in different locations
thinking that maybe there was an error or a limit on the character length
of the address or anything interfering. I'm still not having any luck and
have submitted a ticket with my school's statistical and tech department
for help.

I recreated the ecprg193 folder on my desktop with a shorter name and no
spaces, to lessen the chance of error and copy and posted the path from
Explorer:

%let path=C:\SAS_Education\ecprg193;
libname orion "&path";

However, it's still not working. Would using an App2Go program to access
SAS through my school be causing the problem? It's a browser-based
~emulator~ I believe that allows me to access SAS indirectly, from my own
computer.


This e-learning isn't through school per se, I'm taking an introductory
course but am having difficulty. I signed up for the free e-learning course
through SAS to better understand the material.

Thank you again for your help.

-Bobby

##- Please type your reply above this line. Simple formatting, no
attachments. -##
Super User
Posts: 17,750

Re: To define the orion library, follow the steps for the SAS software you are using to do the pract

Download and use the free SAS UniversityEdition. It's free and relatively small. 

 

The issues you're facing are entirely due to using Apps2Go. 

Open SAS and see where you can navigate. Ie File>open a file or sas program. If you can connect to it from SAS you can create the library there. 

Occasional Contributor
Posts: 8

Re: To define the orion library, follow the steps for the SAS software you are using to do the pract

I'll do that, thank you! Is there a way to adjust it so it
functions/appears as SAS Base since that's the format I'm using for class?

-Bobby

##- Please type your reply above this line. Simple formatting, no
attachments. -##
Super User
Posts: 17,750

Re: To define the orion library, follow the steps for the SAS software you are using to do the pract

HTML is default for both now so the results should look the same. For the ecourse, there are specific instructions for SAS UE, follow them exactly. 

Super User
Posts: 17,750

Re: To define the orion library, follow the steps for the SAS software you are using to do the pract

I think something in your code is out of order. Taking a look at your first log, it shows the PATH declaration after the LIBNAME statement. So the first time you run it, the path isn't declared and it errors out. 

The second time you run it, it's declared so run's successfully. 

 

 

New Contributor
Posts: 4

Re: To define the orion library, follow the steps for the SAS software you are using to do the pract

I guess you are not understanding what I am saying ,
Occasional Contributor
Posts: 8

Re: To define the orion library, follow the steps for the SAS software you are using to do the pract

I'm having the same problem as well. I signed up for the SAS E-learning course and I've spent the past two hours trying to find a way to assign the Orion Library.

I'm using SAS 9.4 (I believe) the Base SAS. I'm not sure because when I google images of different versions of SAS, they all look different. Here's the info from the log if that helps. I'm using an App2Go feature that allows me to use SAS on my computer, from the school's systems:

NOTE: Copyright (c) 2002-2012 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) Proprietary Software 9.4 (TS1M2)
Licensed to VIRGINIA COMMONWEALTH UNIVERSITY - SFA T&R, Site 70105052.
NOTE: This session is executing on the X64_SRV12 platform.

I've read many of the other threads in but I'm completely new to SAS and none of the other solutions seems to work for me.

I keep getting the statement: NOTE: Library ORION does not exist.

It shows that a library folder was created so to speak, but says that it doens't exist. I've inputted the path to the folder, but I don't understand why it won't use it.


SAS Problem 01.JPG
SAS Super FREQ
Posts: 8,740

Re: To define the orion library, follow the steps for the SAS software you are using to do the pract

Hi:

  In the screen shot, it looks like you have very different locations that you've tried. This is the last one I see:

%let path=e:\Documents\School\School\School - 2017 - Spring\STAT 321\SAS Tutorial\Orion\ecprg193;
libname orion "&path";

 

The fact that your SAS log says: LIBRARY ORION does not exist implies to me that there is something wrong with that path on your E: drive -- either it is a mapped Unix drive and there is a case sensitivity issue or you do NOT have the path quite right, such as the fact that "School" appears 3 times in the folder path.

 

Nevertheless, I duplicated your long path name. I don't have an E drive, but I did duplicate your path on my C: drive and put some files in the folder.

 

Then, I ran the 2 setup statements to point to that path, followed by a PROC CONTENTS. Here are the results. The long path name did work for me.

using_really_long_path.png

 

 

But, as you can see -- I have EXACTLY the same path showing in Windows Explorer as in my SAS code. Can you navigate to your E: drive using Windows Explorer? After you navigate down the whole path, if you click one time up in the path bar, the path will change to a standard Windows path and while the path shows up in blue, you can Ctrl+C to copy that full path. Then you can do a Ctrl+V in your program window to paste that into the %LET statement.

 

Assuming you have write access to your E: drive location, this should paste in the correct path for the setup statements that you need to submit.

 

Has your professor in the STAT class already made the data for you? Or do you need to run the program inside the Course Overview section to make the data. Until you get the path correct, you will not be able to make the data.

 

And, if you have more control over your E: drive, I'd recommend simplifying the folder path, for your own ease of use. having a folder name with "School" appearing 3 times, plus spaces and dashes seems to me like it is a recipe for several typos or an extra hit of the spacebar to render your path incorrect.

 

In our classrooms, we map the students to either a D or an S drive, and so their path is simply:

%let path= S:\workshop\prg1; (for the classroom course)

or

%let path= /folders/myfolders/ecprg193; (for the e-learning course on the University Edition)

or, on my Windows machine, usually, I stick with

%let path= c:\SAS_Education\ecprg193;

so then the libname orion "&path"; always finds the correct location based on what is provided for the &PATH helper variable. But you have to know that the path you've typed is correct and that you do not have any, any, any misspellings. On Windows, the case typed for the folder path doesn't matter. That is not true of Unix, so if your E drive is a UNIX drive, then every single letter must be specified correctly.

 

Look what happens when I take out ONE  space around one of the dashes

Instead of 2017 - Spring, I have 2017- Spring:

 

one_missing_space.png

 

cynthia

Occasional Contributor
Posts: 8

Re: To define the orion library, follow the steps for the SAS software you are using to do the pract

EUREKA!!!

Thank you all so much! I was able to get it to work by playing around some more.

 

 I kept trying to copy and paste the path address from Windows Explorer into the code without success. I changed the location of the file to one with a shorter address and no spaces, also to no avail. I noticed that the library would create an active library called Orion but when I double clicked it, it said it doesn't exist.

What I did was go into the SAS explorer and deleted the Orion file, then right clicked in that window and created a new library called "orion" and used the "Path" under "Library Option" to locate the file. I finally noticed that the address format used in SAS was different than the one used in Windows and remember that you mentioned something about UNIX and perhaps a ~translation~ or format issue might be happening.

The address path in SAS looks like this: 

\\Client\C$\SAS_Education\ecprg193

 

The address path in Windows when using "properties" and copying looks like this:

C:\SAS_Education\ecprg193

 

Once I created the library in the SAS explorer, then reran the code with the new address path, it worked! I was even able to do step 2 in the installation and set up the data.

I'll probably come back for MUCH more help, but thank you all so much for your patience! Communal happy accidents is a great thing and I've really been struggling to learn this and this helps me not give up trying.

Sincerely, Bobby


SAS Problem 03.JPG
Ask a Question
Discussion stats
  • 16 replies
  • 474 views
  • 5 likes
  • 4 in conversation