Hi,
I am using the web version of SAS UE and am trying to learn some basic SAS stuff. I uploaded a file I need to play around with to the online server. On right clicking I get the path as /home/(my user id)/myfolders/Temperature.txt. I then tried to run the infile statement as below:
DATA highlow;
INFILE ’/home/johndoe/myfolders/Temperature.txt’;
INPUT City $ State $
/ NormalHigh NormalLow
#3 RecordHigh RecordLow;
PROC PRINT DATA = highlow;
TITLE ’High and Low Temperatures for July’;
RUN;
However it gave me the following errors; any idea on how I can fix this?
Never mind, double quotes around the directory path did the trick.
Hi:
Is there really a PROC SQL statement in front of the DATA statement? The first thing I recommend is getting rid of your PROC SQL statement. It does not belong where you have it and while in the SQL processing environment, SAS will think the entire rest of your program is full of options you are trying to send to SQL.
Next, you should use your actual user ID where you have (my user id). As far as I know, on the OnDemand server, you would not ever have a home folder named (my user id) with parentheses and spaces. You are supposed to use YOUR user ID. For example, if you log onto the SAS OnDemand server with johndoe0 as your user ID, then your INFILE statement would be:
INFILE '/home/johndoe0/myfolders/Temperature.txt';
Until you fix those two things and try your code again, you won't have any idea whether your program correctly reads the data or not.
cynthia
My mistake, I wasn't actually running the 'proc sql' statement in the SAS UE environment; so please ignore that. That isn't causing the error. Also where it says "my user id" i am actually inputting my userid. so if my user ID was johndoe the code is:
DATA highlow;
INFILE ’/home/johndoe/myfolders/Temperature.txt’;
INPUT City $ State $
/ NormalHigh NormalLow
#3 RecordHigh RecordLow;
PROC PRINT DATA = highlow;
TITLE ’High and Low Temperatures for July’;
RUN;
Please post the full log and code, edit out your name if you like but leave the rest exact as is.
The code I posted was the full one;its short.
The full log is:
Never mind, double quotes around the directory path did the trick.
That shouldn’t matter unless you’re using macro variables.
@newsasuser2017 wrote:
Never mind, double quotes around the directory path did the trick.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.