BookmarkSubscribeRSS Feed
Cynthia_sas
SAS Super FREQ

Hi:

  When you use SAS Enterprise Guide, EG is acting as a "front-end" to SAS. There are 3 ways SAS could be installed and used:

1) EG is on your local machine and EG talks to a copy of SAS that is also installed on your machine

2) EG is on your local machine and EG talks to a copy of SAS that is installed on some other machine (could be a Windows server, could be a Unix server, could be a mainframe, could be Linux...).

3) EG is on your local machine and EG talks to a copy of SAS that is configured as part of the SAS Platform for Business Analytics (also called the BI Platform)

  How you access your data, whether we are talking RAW data files (.DAT or .CSV or .TXT files) or SAS datasets, depends on which of the "flavors" of EG and SAS you are using.

  EG -ALWAYS- submits code in "batch" mode. So, when you are submitting code from within EG, the "flavor" of EG you are using and where SAS actually lives (local vs on another machine) really, really makes a difference.

  If you are indeed using EG in the #1 scenario, then saving or copying your files to your local drive and submitting code with a local path should have worked. The fact that you received that error message leads me to believe that you are dealing with the #2 or #3 scenario.

  In the #2 or #3 scenario, your SAS session on the server has NO visibility of your local C drive. In fact, if you think about it, as an example, let's say you code a local location of c:\temp\pilot.dat (which is the name of one of the raw datas file used in the Intro self-paced elearning class), but your installation is NOT the #1 scenario -- you are working in #2 scenario and your local copy of EG is submitting code to SAS on a UNIX box. No UNIX box in the world ever has a C: drive. Unix directory names would be something like: /user/data/something/pilot.dat -- but before you could even use a directory like that, you have to move the files from your local machine to a directory on the UNIX machine, where they are accessible to SAS on the server where it lives.

  I would recommend that you either talk to the SAS Administrator at your site, they can tell you which "flavor" of EG you are working with and perhaps they can tell you the best way for you to submit code or help you upload the files to a directory and build the correct INFILE statement. Otherwise, your best source of help will be to work with SAS Tech Support.

cynthia

mayankgoel01
Calcite | Level 5

Hi Cynthia,

Your response above is very informative. I too am facing the same issue with EG. I am now certain that EG does not access my local drive to look for pilot.dat and does not recognize SASintro library, hence gives an error. (ERROR: Library SASINTRO does not exist.)

I do not have access to any onsite SAS admin who could help me resolve this. Raw data files that I specify in my programs came with SAS training material so I was hoping these files also already exist on server and would not require an import.

I have completed the training but have not been able to try any of the codes due to such errors. It would be great if you could help.

Mayank

ChrisHemedinger
Community Manager

Mayank,

If you have the file local on your PC, you can use the Copy Files task to upload it to your SAS server.

Here is information about the Copy Files task and how you can get it:

There and back again: copying files in SAS Enterprise Guide - The SAS Dummy

Chris

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
mayankgoel01
Calcite | Level 5

Thanks Chris. Im sorry but I could not locate Copy Files screen in EG.

ChrisHemedinger
Community Manager

You have to download the task from a link on the blog post.  It's not built in to EG - it was developed and released later as a productivity tool.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
mayankgoel01
Calcite | Level 5

Got it. Installed and running. Now I donno how to specify Server folder path :S

Why do I have to involve server here at all? Isnt there a way I run it within my machine? Its such a waste of time.

I am sorry to be asking so many questions but I am a beginner in SAS and this is not straight forward.

ChrisHemedinger
Community Manager

Mayank,

SAS Enterprise Guide is a "client-side" application that connects to a SAS server.  The SAS server can be on your local machine if you have SAS Foundation installed, but since your local file references didn't work I'm assuming that's not the case.  Therefore, all of your data processing and analysis must happen on a remote SAS session -- the SAS server that is typically maintained by a SAS admin. 

How you specify a destination path for the Copy Files task -- that depends on the OS of the remote system.  If it's a UNIX system, then you'll need to use a UNIX-style path for a folder that you can write to (ex: /u/your_id/).  If the remote server is a Windows OS, then you can use a DriveLetter:Folder name or a UNC-style path (ex: D:\MyFiles\Data or \\myServer\MyFiles\Data).

If all of this is still unclear, you'll probably need to tap your local support staff (if possible) for guidance as to how your environment is configured.

Chris

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
mayankgoel01
Calcite | Level 5

Chris,

Your responses have been very helpful. Now I do have to find out which OS is on the remote system. At this point I am not sure who to contact but will figure that out. And will also ask for folder path as well.

Truly appreciate your time!

Mayank

mayankgoel01
Calcite | Level 5

Hello,

I fugured out what was going on with my SAS EG On Demand. I used the following code which was required for me to work with the remote server:

libname orion '/tutorials/eg/data/ecprg1';

Now I am stuck at the next step and was wondering if someone can help. Practice module asks me to execute the following statement:

libname custfm 'my-file-path\custfm.xls';

but I am not sure what to put in place of "my-file-path" in order to be able to read custfm.xls file into SAS. I have this file saved on my C: but I believe that is NOT where I am expected to fetch it from but from the server.

Any help will be appreciated.

Thanks

Mayank

sushmita
Calcite | Level 5

I am having the exact same problem as mentioned by Mayank.

I am using the SAS enterprise guide to practice how to access the custfm.xls file.

Tried the code below, but it does not work.

libname custfm '/tutorials/eg/data/ecprg1/custfm.xls';


I was asked to save the ECPRG1 files in my computer (which I did).

But it looks like with the '/tutorials/eg/data/ecprg1/custfm.xls' pathname, I am trying to access the files located in the SAS server.


Am I doing something wrong? Need your advise.

overmar
Obsidian | Level 7

Since you saved it to your hard drive you have to trick EG into realizing what your local computer is called. I have found that the easiest way to do this it to open up SAS in this case I guess it is EG, so I don't know exactly how or where you will have to ask the file to open, but then go to my computer and open up your hard drive. Using our schools virtual SAS (on a UNIX platform), my hard drive shows up under \\Client\C$ which is what would replace C: in most of your requests, so if you have saved the file to your desktop your file path would be \\Client\C$\Desktop. But once again it all depends on where things are located and the operating system.

One last thing, the reason that the libname statement you wrote didn't work was because you included custfm.xls in the libname, a libname should be a folder not a file. If you wanted to point at the file and read it in your best bet may be to write it like this:

filename serv ( '/tutorials/eg/data/ecprg1/custfm.xls');

data readable;

infile serv;

input;

run;

or just write it in a proc import statement

proc import      out = want

                         datafile =  '/tutorials/eg/data/ecprg1/custfm.xls'

                         dbms = excel

                         replace;

                         getnames=yes;

                         guessingrows=1000;

run;


Hope this helps.

Cynthia_sas
SAS Super FREQ

Hi:

  When you take the Programming 1 e-learning course, using the SAS OnDemand for Professionals server, the correct location of the SAS datasets used in the class is the LIBNAME location given above:

  

libname orion '/tutorials/eg/data/ecprg1';

 

and you can read SAS datasets from this location very easily. There are also some CSV files in that location. However, I do not believe there are XLS files in that location. So the PROC IMPORT step to read custfm.xls will not work when you are using the SAS OnDemand for Professionals server.. You should see this error message on the server:

ERROR: Physical file does not exist, /tutorials/eg/data/ecprg1/custfm.xls.


  In fact, in the Programming 1 e-learning class, when you get to several of the demos and exercises, there are specific instructions for you to SKIP the Excel LIBNAME engine based exercises. The note only references SAS Enterprise Guide, not SAS OnDemand explicitly, but this warning in the "import" chapter also applies to the SAS OnDemand for Professionals students. There are a few examples of using CSV files that will work, but students should study the syntax, but skip the practices .. especially if the practice is to read an XLS file.

cynthia


cc_prg1_do_not_attempt.png
sushmita
Calcite | Level 5

Thank you Cynthia and Overmar. Your messages were helpful.

Yes, I am taking the e-course and practicing using the SAS OnDemand.

I was also having problem converting SAS data sets into excel as demonstrated in Lesson 6 using LIBNAME statement to create/assign a xls file.

Cynthia_sas
SAS Super FREQ

Hi:

  I thought that was one of the practices that explicitly said that it should be skipped or else told you that you could not submit the code if you were using Enterprise Guide. The bottom line is that the SAS OnDemand for Professionals server has a few limitations:

1) SAS Enterprise Guide will NOT read data files or Excel files or SAS datasets from your C: drive;

2) you do not have write access to the ORION library on the SAS OnDemand server, so you cannot write to ORION and

3) since the SAS OnDemand server is a Unix server, it is not configured with SAS/ACCESS to PC Files or the PC File server, which would also allow you to read Excel files (such as with PROC IMPORT or the SAS LIBNAME engine for Excel).

  

   In every practice in Chapter 6, there is an alternate practice for EG that, when you click, contains this note: "Although you cannot submit this code, you can practice by writing the program in your editor window and then comparing your program to the program in the solution." The part of the alternate practice that says "cannot submit this code" means that the Unix server is not configured to allow you to access Excel workbooks for import or export. So you should study the syntax in that chapter, but do not expect it work on the SAS OnDemand server. If you do try to submit the code, you will receive one of several possible error messages.

  And remember, you are not alone in having to study syntax that you can't run. Other students might have this same issue -- for example students who might use a mainframe server or a Unix server or Linux server could also have this same issue: they can study the code, but they cannot submit the code.

cynthia


alternate_practice_has_sentence_about_not_run.png
sushmita
Calcite | Level 5

Thanks Cynthia,

This makes a lot of sense now.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 29 replies
  • 7224 views
  • 6 likes
  • 7 in conversation