Write and run SAS programs in your web browser

Uploading one txt to myfolders, and want to use the file but fail to run

Reply
Contributor
Posts: 20

Uploading one txt to myfolders, and want to use the file but fail to run

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;

Super User
Posts: 21,546

Re: Uploading one txt to myfolders, and want to use the file but fail to 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;


 

Highlighted
Trusted Advisor
Posts: 1,683

Re: Uploading one txt to myfolders, and want to use the file but fail to 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.

Contributor
Posts: 20

Re: Uploading one txt to myfolders, and want to use the file but fail to run

Thank you very much!Smiley Happy

Ask a Question
Discussion stats
  • 3 replies
  • 173 views
  • 4 likes
  • 3 in conversation