Learning sas by example

Occasional Contributor
Posts: 9

Learning sas by example

Hello everyone,

I did attempt to search the community to see if there was a solution available but could not find one. I am using the Leaning SAS by Example text to begin my training and I'm stuck on the first example : (

Here's the code:

data demographic;

  infile "c:/Users/Oprah/Desktop/SASLearning/mydata.txt";

  input Gender $ Age Height Weight;


  title "Gender Frequencies";

  proc freq data=demographic;

  tables Gender;


  title "Summary Statistics";

  proc means data=demographic;

  var Age Height Weight;


Followed by the error message in the log:


42 ;

43 data demographic;

44 infile "c:/Users/Oprah/Desktop/SASLearning/mydata.txt";

45 input Gender $ Age Height Weight;

46 run;

ERROR: Physical file does not exist, /opt/sasinside/SASConfig/Lev1/SASApp/c:/Users/Oprah/Desktop/SASLearning/mydata.txt.

I've attempted to switch the forward slashes to backslashes, that didn't help. I've tried changing the location of the "mydata" file, that didn't work either. Im using SAS U. Not sure if that makes a difference. Thank you in advanced.

Occasional Contributor
Posts: 9

Re: Learning sas by example

Posted in reply to bruceleeroy

I think I might have found the answer to my own question, however I can not try as there's an update downloading.

I'm using virtualbox and I did not add the folder to "shared folders" therefore my "infile" statement would not be able to locate the .txt file.

Throwing this up here just in case anyone else get's stuck.

I know it's super early in the training : )

Anyways take care.

Super User
Posts: 23,754

Re: Learning sas by example

Posted in reply to bruceleeroy

You can mark the question assumed answered.

This is a frequent question on here, but under SAS Analytics U forum. I'm not quite sure if the search works across both forums.

Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation