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

Hi Cynthia, Panos, 

 

Thank you so much for your reply. 

2 things I noticed, first I have saved my unzipped files on my desktop (not sure if that should have any effect) and when I run the 2nd program egpg194-2, the physical location of the created data sets( 22 btw, please check screenshot) seems to be on the server instead my C drive as the video shows. 

Also, those 2 steps run smoothly but when I try to reference the datasets later on , I keep getting those error messages( please check my previous posts)

 

Again , thank you so much for the prompt reply and I really appreciate your help, 

 

Kind regards, 

 

Mazen

screenshot.png

Cynthia_sas
SAS Super FREQ
Hi:
If you follow the Enterprise Guide instructions that were just entered, then your location is correct. The zip file contents should still be on your C: drive, where you unzipped them. But the EG program writes ALL the data files to your WORK location.

In the version of EG I was using, my WORK location just happened to be on my C: drive. Your WORK location was different. Take a look at the video again, at approximately time stamp 6:33, if you focus on the long path name in my CONTENTS output (not at the C: location), but farther down in the path, you will see "SAS Temporary Files" which indicates that my data files are in WORK.

This is why you need to re-submit the AUTOEXEC Process Flow every time the project opens -- so the data is re-created in the WORK library, as appropriate to YOUR implementation of SAS.

Sounds like you were successful, you have 22 datasets in your screen shot. I assume that you did finish up and follow the rest of the steps to rename the Process Flow as AUTOEXEC, as shown at the end of the video and in the instructions. If you watch the video all the way to the end, you'll see that I log off of EG and log back on and the AUTOEXEC starts up the second time and re-creates the data.

Hope this helps,
Cynthia
mazensleiman
Fluorite | Level 6

hi cynthia, 

 

thank you for the instructions. 

I am pretty sure that the libraries and the data exist in my work directory  (which I think is on the SASApp server work/PG1) as I can actually open them from the work directory in the PG1 folder. but yet when I use "&path" I get 2 types of errors in lesson 2 -activity 2 (understanding data):

26 proc contents data="&path/storm_summary.sas7dbat";
ERROR: Extension for physical file name "/vw/data/saswork/SAS_workA20C0000A150_bal2541prd001/SAS_work713C0000A150_bal2541prd001/storm_summary.sas7dbat" does not correspond to a valid member type.
27 run;

when I don't use /, I get this error:

proc contents data="&path storm_summary.sas7dbat";
ERROR: The physical file name "/vw/data/saswork/SAS_workA20C0000A150_bal2541prd001/SAS_work713C0000A150_bal2541prd001 storm_summary.sas7dbat" is too long.
27 run;

and it is only when I use the &path that I get those messages

 

 Btw, I am using EG7.1 with SAS9.4  and when I run your code about path

%put My WORK location is: %SYSFUNC(pathname(WORK));

this is what I get :

NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
24
25 GOPTIONS ACCESSIBLE;
26 %put My WORK location is: %SYSFUNC(pathname(WORK));
My WORK location is: /vw/data/saswork/SAS_workA20C0000A150_bal2541prd001/SAS_work713C0000A150_bal2541prd001

 

and when I run Andrew's code :

libname MyTmp "."; /* Set libref to current folder */
%put %sysfunc(pathname(MyTmp)); /* Show the path of the libref */
libname MyTmp clear; /* Clear the libref */

I get that all was successfully assigned to the work server directory (please check log attachment for details).
I really don't understand what am I doing wrong here. It should be much easier to set up the path automatically but obviously this macro is not working correctly for everyone.


 

Panagiotis
SAS Employee

@mazensleiman,

If the code in red is the exact code you wrote, you have a typo in the file extension. 

It should be .sas7bdat, not .sas7dbat. It's a subtle difference, but you can tell because the log indicates the file extension has an error. You should also need to use a slash like your first example.

Hope that helps!

- Peter

mazensleiman
Fluorite | Level 6

Thanks Peter,

that was it I think, but now I had another problem moving forward.

While creating the np library I get a similar error that the file does not exist :

code :

options validvarname=v7;
libname np xlsx "&path/np_info.xlsx";
proc contents data=np.np_info;
run;
libname NP clear;

 

Error log:

GOPTIONS ACCESSIBLE;
26 options validvarname=v7;
27
28 libname np xlsx "&path/np_info.xlsx";
NOTE: Libref NP was successfully assigned as follows:
Engine: XLSX
Physical Name: /vw/data/saswork/SAS_workB33800007ABE_bal2541prd001/SAS_work5CC900007ABE_bal2541prd001/np_info.xlsx


29 proc contents data=np.np_info;
ERROR: File NP.np_info.DATA does not exist.
30 run;

NOTE: Statements not processed because of errors noted above.
NOTE: PROCEDURE CONTENTS used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

NOTE: The SAS System stopped processing this step because of errors.
31 libname NP clear;
NOTE: Libref NP has been deassigned.

 

Any idea what have i done wrong this time?

 

regards, 

Mazen

 

mazensleiman
Fluorite | Level 6
is it created via the autoexec process as well?
Panagiotis
SAS Employee

@mazensleiman,

 

The path macro variable is being created during setup. If you type the following and run the statement, you will see where path is pointing to on your machine:

%put &=path;

On my setup Path is pointing to the data folder in the temporary location that contains all the data that is being created for the course when you run that autoexec program. Path will point to the data folder, but you need to add the "/data/" to get you inside the folder allowing you to access the np_info.xlsx Excel workbook.

 

Try typing:

 

libname np xlsx "&path/data/np_info.xlsx";

After you run this libname statement, it should connect you to the Excel workbook. Next go to your servers window on the left side of Enterprise Guide and :

1. Select local and press the refresh button. 

2. Expand libraries and find NP.

3. Expand the NP library

 

EG.png

 

 

You should see the following three tables in the NP library called PARKS, SPECIES, VISITS. Your proc contents should select one of those tables. I'm guessing you are working on the activity for accessing data? If so, your proc contents should not be using the Excel workbook name, but one of the worksheet names inside that workbook. SAS is treating each worksheet like a SAS table. If my assumption is correct and you are working on the activity, it asks you to read the PARKS table in the NP library. 

 

Type:

 

proc contents data=np.parks;
run;

 

Let me know if that works.

 

- Peter

mazensleiman
Fluorite | Level 6
Yup, worked like a charm.

thank you so much Peter, you're awesome
HFJL
Fluorite | Level 6

Hi Cynthia,

 

I did everything that was in the video,but I'm still getting the same errors.  However, I'm seeing the same observations as what's shown in the video.  I also see the PG1 library with tables in there.  Thank you!

Cynthia_sas
SAS Super FREQ
Hi: &PATH in the EG setup is created automatically in the 2 programs that you run. So that's why you need to run AUTOEXEC every time you start working. The AUTOEXEC will run the 2 programs and the result SHOULD be that 1) you get the data created over again in your WORK location; and 2) &PATH is created and holds the string that is your work location's data folder.

If you are running EG 5.1, what version of SAS are you running? That might make a difference? We tested the program for creating data with EG 7.1 and SAS 9.4 M3, 9.4 M4 and 9.4 M5. Can you go to Help --> About SAS Enterprise Guide and then click Configuration Details -- that should show your version of SAS. If you are running SAS on a server, you may need to submit this program in an Editor window:
%put version is &sysvlong4;

This will show your long version number in the SAS log. The data creation program uses the DLCREATEDIR option to make the data subdirectory in your WORK location. If you are running a version of SAS before SAS 9.3, then you might run into issues.

Cynthia
HFJL
Fluorite | Level 6

The SAS System version is:

image.png

abbyrjones72
Obsidian | Level 7

Disregard, figured out that '' was not needed.

 

I am having this exact same error on creating the PG1 library in the online version of SAS Studio. I am following the instructions to the letter, and PG1 does appear after the setup.sas is run, but there are no data in it. Right-clicking on it reveals it is an invalid library.

 

/***********************************************/
/* In the line of code below, replace FILEPATH */
/* with the path to your EPG194/data folder    */
/***********************************************/

%let path='~/EPG194/data';

/**********************************************/
/* DO NOT EDIT THE CODE BELOW                 */
/**********************************************/

libname pg1 "&path";

Here is my folder structure:

Screen Shot 2019-01-18 at 7.52.19 AM.png

Cynthia_sas
SAS Super FREQ
Hi:
The ~ method will ONLY work if you are creating data on SAS OnDemand for Academics. It will not work in other interfaces or with SAS Studio in other configurations.

SETUP.SAS creates a pointer to the library. There are multiple tasks in the instructions and you have to follow ALL of them to run programs to MAKE the SAS data for the class. So did you run ALL of the programs in class? Are you sure you are using SAS OnDemand for Academics? How do you get onto SAS -- do you start VirtualBox or VMWare and then start SAS in your Virtual Machine? or do you log onto the SAS Control Center from a browser? or do you Start SAS Studio from your Start Menu in Windows?

Please verify that you've run ALL the programs you need to run after running SETUP.SAS and then please verify that you are using SAS OnDemand for Academics. We can go from there.

Cynthia
abbyrjones72
Obsidian | Level 7

Hi Cynthia,

 

Thank you. I am running SAS Studio On Demand, but my problem was I was including ' ' in the path assignment. It works now and I am enjoying the heck out of these SAS classes.

sbyfield
Fluorite | Level 6

Hi Cynthia,

 

I am having the same issue but with SAS Studio.  I have tried everything, including taking a copy of the EPG1V2 and putting it directly on my C drive and not in a folder.  The file name is still too long.  Any suggestions?  I went through the exercise today and would expect the video / directions to be up to date.

 

Thank you, Sheli

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

LIBNAME 101

Follow along as SAS technical trainer Dominique Weatherspoon expertly answers all your questions about SAS Libraries.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 44 replies
  • 7922 views
  • 22 likes
  • 12 in conversation