Hi
i am new to SAS programming and formed a simple program in SAS university edition
data vishal
infile "\folders\myfolders\v\vvv.txt" ;
input gener $ age weight ;
run ;
title "frequency" ;
proc freq data=vishal;
tables gender;
run;
I am getting error
Error no dataline or infile statement
Error extension for physical file "\folders\myfolders\v\vvv.txt" does not corresponds to a valid member type.
Please help in solving this,
Attachement contains snapshots.
Generally the slashes are the opposite way, but SAS should still interpret it correctly.
Please include your FULL log in future questions. It's easy to make a typo and the log shows exactly where the error occurs.
data vishal;
infile "/folders/myfolders/v/vvv.txt" ;
input gender $ age weight ;
run ;
You're missing a semicolon at the end of the DATA statement:
data vishal;
Also note, you changed the spelling of one variable (gener vs. gender). You will need to make that consistent.
hi
Applied semicolon at the data statement and run again, but it show below error.
Physical file does not exist /opt/sasinside/SASConfig/lev1/SASApp/\folders\myfolders\v\vvv.txt.
Unix uses / as the delimiters between directories in a path. It is Windows that uses \.
So the error message is just saying that there is no file in the current directory '/opt/sasinside/SASConfig/lev1/SASApp/' with then name '\folders\myfolders\v\vvv.txt'.
Use the real path to the file instead.
'/folders/myfolders/v/vvv.txt'
That error is suprising to me as normally SAS happily converts the directory delimiters for you.
Perhaps it cannot do that when you do not start the filename with a / or a valid relative directory name?
@ambakansaria wrote:
hi
Applied semicolon at the data statement and run again, but it show below error.
Physical file does not exist /opt/sasinside/SASConfig/lev1/SASApp/\folders\myfolders\v\vvv.txt.
Because of the missing semi colon SAS thinks your data step whats to create three output datasets.
data vishal infile "\folders\myfolders\v\vvv.txt" ;
So the first two, visha1 and infile, are just normal membernames and so will default to the WORK library. But the last one is a quoted physical filename. It is complaining that you want to use .txt as the extension on your dataset as SAS requires that it be .sas7bdat instead.
Then since you do not have an INFILE statement SAS will also complain that the INPUT statement has no where to find the data lines.
Generally the slashes are the opposite way, but SAS should still interpret it correctly.
Please include your FULL log in future questions. It's easy to make a typo and the log shows exactly where the error occurs.
data vishal;
infile "/folders/myfolders/v/vvv.txt" ;
input gender $ age weight ;
run ;
Thanks Reeza
After changing the slashes, it works fine
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.