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
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.
@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
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
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
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
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!
The SAS System version is:
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:
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.
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
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.