DATA Step, Macro, Functions and more

Error for infile statement with web version of sas ue

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

Error for infile statement with web version of sas ue

[ Edited ]

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;

Accepted Solutions
Solution
‎12-29-2017 10:58 PM
Occasional Contributor
Posts: 5

Re: Error for infile statement with web version of sas ue

Posted in reply to newsasuser2017

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

View solution in original post


All Replies
SAS Super FREQ
Posts: 9,426

Re: Error for infile statement with web version of sas ue

[ Edited ]
Posted in reply to newsasuser2017

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

Occasional Contributor
Posts: 5

Re: Error for infile statement with web version of sas ue

Posted in reply to Cynthia_sas

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;

Super User
Posts: 23,998

Re: Error for infile statement with web version of sas ue

Posted in reply to newsasuser2017

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

Occasional Contributor
Posts: 5

Re: Error for infile statement with web version of sas ue

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
 
Solution
‎12-29-2017 10:58 PM
Occasional Contributor
Posts: 5

Re: Error for infile statement with web version of sas ue

Posted in reply to newsasuser2017

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

Super User
Posts: 23,998

Re: Error for infile statement with web version of sas ue

Posted in reply to newsasuser2017

That shouldn’t matter unless you’re using macro variables. 

 


newsasuser2017 wrote:

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


 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 250 views
  • 0 likes
  • 3 in conversation