10-20-2016 05:39 PM
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.
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;
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.
10-21-2016 01:17 PM
10-20-2016 06:31 PM - edited 10-20-2016 06:35 PM
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.
10-20-2016 06:45 PM - edited 10-20-2016 09:45 PM
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:
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.
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
2) Instructions that show where to save the setup statements
3) program submitted successfully AFTER running necessary statements
10-21-2016 01:19 PM
I wrote this code in my program.
libname orion "&path";
The log was
10-21-2016 01:17 PM
10-21-2016 01:20 PM
10-21-2016 01:32 PM
Here is a set of numbered screen shots that illustrate the entire process from an empty folder for ecprg193 to a successful program.
Start with instructions
#1 Make a folder (you have already done this step)
#2 Check folder properties
#3 Run "setup" with LIBNAME
#4 at some point save code as setup.sas or save as snippet
#5 Task 2, Step 2, Paste code into the Studio editor window
#6 After code runs, see files in ecprg193 folder and see PROC CONTENTS in Results window
#7 After Task 2, Step 2 code runs successfully, you should be able to see the files in your shared folder location
Note that your shared folder location might not be the same as what is shown in my screen shot.
You CANNOT try to read COUNTRY.DAT until AFTER you have successfully run the program inside Task 2.
Need further help from the community? Please ask a new question.