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

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?

 

73 INFILE ’/home/johndoe/myfolders/Temperature.txt’;
_
23
ERROR 23-2: Invalid option name /.
 
73 INFILE ’/home/johndoe/myfolders/Temperature.txt’;
____
23
ERROR 23-2: Invalid option name HOME.
 
73 INFILE ’/home/johndoe/myfolders/Temperature.txt’;
___________
23
ERROR 23-2: Invalid option name johndoe.
 
73 INFILE ’/home/johndoe/myfolders/Temperature.txt’;
_________
23
ERROR 23-2: Invalid option name MYFOLDERS.
 
74 INPUT City $ State $
75 / NormalHigh NormalLow
76 #3 RecordHigh RecordLow;
1 ACCEPTED SOLUTION

Accepted Solutions
newsasuser2017
Fluorite | Level 6

Never mind, double quotes around the directory path did the trick.

View solution in original post

6 REPLIES 6
Cynthia_sas
SAS Super FREQ

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

newsasuser2017
Fluorite | Level 6

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;

Reeza
Super User

Please post the full log and code, edit out your name if you like but leave the rest exact as is. 

newsasuser2017
Fluorite | Level 6

The code I posted was the full one;its short.

 

The full log is:

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
70
71 DATA highlow;
72 INFILE ’/home/johndoe/myfolders/Temperature.txt’;
_
23
ERROR 23-2: Invalid option name /.
 
72 ! INFILE ’/home/johndoe/myfolders/Temperature.txt’;
____
23
ERROR 23-2: Invalid option name HOME.
 
72 ! INFILE ’/home/johndoe/myfolders/Temperature.txt’;
___________
23
ERROR 23-2: Invalid option name johndoe.
 
72 ! INFILE ’/home/johndoe/myfolders/Temperature.txt’;
_________
23
ERROR 23-2: Invalid option name MYFOLDERS.
 
73 INPUT City $ State $
74 / NormalHigh NormalLow
75 #3 RecordHigh RecordLow;
 
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.HIGHLOW may be incomplete. When this step was stopped there were 0 observations and 6 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
memory 491.43k
OS Memory 26536.00k
Timestamp 12/30/2017 03:53:03 AM
Step Count 18 Switch Count 1
Page Faults 0
Page Reclaims 239
Page Swaps 0
Voluntary Context Switches 6
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 264
 
76 PROC PRINT DATA = highlow;
 
77 TITLE ’High and Low Temperatures for July’;
78 RUN;
 
NOTE: No observations in data set WORK.HIGHLOW.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 475.15k
OS Memory 26536.00k
Timestamp 12/30/2017 03:53:03 AM
Step Count 19 Switch Count 1
Page Faults 0
Page Reclaims 196
Page Swaps 0
Voluntary Context Switches 5
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
 
79
80 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
92
 
newsasuser2017
Fluorite | Level 6

Never mind, double quotes around the directory path did the trick.

Reeza
Super User

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-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
  • 6 replies
  • 2262 views
  • 0 likes
  • 3 in conversation