Hello,
I am just a beginner, and I want to test to write a code to use the txt. file titled "test 3" and run a SPSS result.
Please help me check what is wrong in my code. Thanks much!!
filename tesfil3 'myfolders/test3.txt';
data test3;
infile tesfil3;*termstr=CRLF;
input Manufacturer$ Type$ Price MPG.city MPG.highway Horsepower Origin$;
run;
proc print data=test3;
run;
Ad firsobs=2 to the infile statement.
And I assume you mean SAS not SPSS otherwise you’re using the wrong software.
@jc3992 wrote:
Hello,
I am just a beginner, and I want to test to write a code to use the txt. file titled "test 3" and run a SPSS result.
Please help me check what is wrong in my code. Thanks much!!
filename tesfil3 'myfolders/test3.txt';
data test3;
infile tesfil3;*termstr=CRLF;
input Manufacturer$ Type$ Price MPG.city MPG.highway Horsepower Origin$;
run;proc print data=test3;
run;
One more point to @Reeza's comments:
A dot is not permitted in a variable name:
use MPG_city instead MPG.city in your input staement, or just MPGcity.
Thank you very much!:)
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.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.