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

Hello!!

I need your help.

I.m doing a activity .This is my activity.

 

In this practice, you submit a SAS program, review the log messages, and examine the results.

Reminder: Make sure you've defined the orion library.

  1. Copy and paste the following code into the editor.

    data work.newcountry;
       length Country_Code $ 2 Country_Name $ 48;
       infile "&path/country.dat" dlm='!'; 
       input Country_Code $ Country_Name $;
    run;
    
    proc print data=work.newcountry;
    run;
  2. Submit the code and then examine the results. How many rows and columns are in the report?


  3. Examine the log. Based on the log notes following the DATA step, how many observations and variables are in the data set work.newcountry?

 

Ok, I create my library, this library is called Bea but can I can run my codige I have this message.

 

ERROR: Physical file does not exist, /folders/myfolders/ecprg193/country.dat.

 

I don,t understant this because this is the first activity and before I didn.t explain me anything.

 

Thanks!!!!!!!!!

 

Bea

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ
Hi: There is NOT a zip file. As Reeza suggests, you must look at my picture of the tasks in #2 above and follow ALL the instructions in Task 1. It looks like you made a folder. That is good. That means your 2 statements for Task 1, #4 are:
%let path=/folders/myfolders/ecprg193;
libname orion "&path";

But that is NOT enough. You MUST finish ALL the steps in Task 2. Task 2, #2 has a link to click which brings the code into a popup window. You MUST copy and paste that code from Task 2, #2 into your Editor Window and run the code, as I show in my #3 screen shot, after you run the code successfully (from Task 2) then you should see the files under the ecprg193 folder.

cynthia

View solution in original post

18 REPLIES 18
Reeza
Super User

Where is this 'activity' from?

JediApprentice
Pyrite | Level 9

In the beginning instructions when setting up the course, you should have downloaded a zip file that contains the files you need to run the practice programs, like the country.dat data file you're referencing in this program. First, did you download the these? Second of all, you have to make sure you placed those files in the location that you've specified as the path: /folders/myfolders/ecprg193/. You may just have the files in a different location.

Cynthia_sas
SAS Super FREQ

Hi:
In the Programming 1 e-learning class, we do NOT provide the SAS datasets in a zip file. (only EG and JMP and EM classes have zip files with data sets -- programming courses have programs to make the data and a few courses have some Excel files in a zip archive).

The Programming 1 e-learning class has a program inside the e-learning course that the student must copy and paste into their editor and that program, when run, makes ALL the data sets and .DAT files that are used in the course.

The OP did not indicate what class they were following, but the Reminder text looks like it comes straight out of the e-learning course.

In the e-learning course, in the instructions, the student is told to create a file called setup.sas or make a snippet file in SAS Studio that contains these 2 statements:
%let path=/folders/myfolders/ecprg193;
libname orion "&path";

That way if &PATH exists then the INFILE statement (as shown in the OP code)
infile "&path/country.dat" dlm='!';

Will work, because &PATH will have a value or path, as assigned in the setup.sas or setup snippet.

However, if you do NOT ever run the instructions in the Course Overview section of Programming 1, then the physical location will be empty.

BTW, in the Programming 1 class, all of our programs are expecting a library called ORION (not a library called BEA). And, all of our programs are expecting that the student will follow the instructions and issue a %let statement to create the "helper" macro variable called &PATH.

The "physical file does not exist message" implies to me that the OP did not follow ALL of the instructions in the Course Overview and Data Setup section of the Programming 1 e-learning course.

Reading country.dat is NOT the first activity. Running the program and doing the setup in the Course Overview section is the first activity and if you don't follow and complete ALL of the instructions, then the data files will not exist when you move into the lessons.

cynthia

 

 I can exactly replicate your error message if I submit my code WITHOUT submitting the setup program, as instructed in Task 1 in the course instructions.

1) Can generate the SAME error message if &PATH is not defined

duplicate_error_message_if_no_path.png

 

2) Instructions that show where to save the setup statements

pg1_instructions_ue.png

 

3) program submitted successfully AFTER running necessary statements

successful_read_country_dat_file.png

beatraca
Fluorite | Level 6

Hi! 

This is my problem

archivo2.png

 

archivo1.png

I have this error and I don.t know as resolve

 

Thanks!!!!!

 

Bea

 

 


archivo1.png
beatraca
Fluorite | Level 6

Hi.Where is this zip file? I can.t see it

 

Thanks

Reeza
Super User

See @Cynthia_sas post, #2 and look at the second red box highlighted. 

beatraca
Fluorite | Level 6

I wrote this code in my program.

 

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

 

 

 

The log was 

NOTE: El libref ORION se ha asignado correctamente:
Motor: V9
Nombre físico: /folders/myfolders/ecprg193ç
 
later 
data work.newcountry;
length Country_Code $ 2 Country_Name $ 48;
infile "&path/country.dat" dlm='!';
input Country_Code $ Country_Name $;
 
The log is 
data work.newcountry;
61 length Country_Code $ 2 Country_Name $ 48;
62 infile "&path/country.dat" dlm='!';
63 input Country_Code $ Country_Name $;
64
65 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
ERROR: Physical file does not exist, /folders/myfolders/ecprg193/country.dat.
 
 
 
Reeza
Super User

Did you copy the code from the CLICK HERE link and run it?

Cynthia_sas
SAS Super FREQ
Hi: There is NOT a zip file. As Reeza suggests, you must look at my picture of the tasks in #2 above and follow ALL the instructions in Task 1. It looks like you made a folder. That is good. That means your 2 statements for Task 1, #4 are:
%let path=/folders/myfolders/ecprg193;
libname orion "&path";

But that is NOT enough. You MUST finish ALL the steps in Task 2. Task 2, #2 has a link to click which brings the code into a popup window. You MUST copy and paste that code from Task 2, #2 into your Editor Window and run the code, as I show in my #3 screen shot, after you run the code successfully (from Task 2) then you should see the files under the ecprg193 folder.

cynthia
beatraca
Fluorite | Level 6

@Cynthia_sas @Reeza ohhh I can now!!!!! Thanks for your patient with me!!!! Smiley Happy

egouws
Calcite | Level 5

Hi Cynthia.

 

I am having the same error, but I have all the Orion files, but the file extensions are .sas7bdat instead of just .dat. How do I resolve this?

Cynthia_sas
SAS Super FREQ

Hi:
The program inside the Programming 1 course creates a variety of files. What you see in your ORION library are the SAS7BDAT files -- those are SAS datasets. We also create several .DAT files and .CSV files, but you will NOT see those in the PROC CONTENTS output. Instead, you need to go to page 2 of this posting and look at #6 screen shot. In that screen shot, the Files and Folders list or Server Files and Folders list shows you ALL the files created and the PROC CONTENTS output shows you the SAS data sets that were created. I believe the date on that posting is 10-21-2016 at 01:32 PM -- look at screen shot #6.

cynthia

if you do NOT see files in your Files and Folders list, such as shown in my screen shot #6, then you need to rerun the setup program again.

Reeza
Super User

If you're on SAS UE and using the free e training courses, see this post:

https://communities.sas.com/t5/Base-SAS-Programming/Orion-Library-on-SAS-university-edition/m-p/3028...

 

beatraca
Fluorite | Level 6

Thanks but I did  these steps and I have the same error  Smiley Frustrated

 

archivo2.png

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 18 replies
  • 2475 views
  • 1 like
  • 6 in conversation