1 new york 7,262,700
2 los angeles 3,259,340
3 philadelphia 1,642,900
how to read the above data using input statement
consider the above data is in txt format externally
u have to use infile and input statement.
Answer Posted / amy
Add a colon modifier before the informat (commaw.) and increase the informat width, like the following.
data cityrank;
infile 'D:\miths data\Mithelesh\cityrank.txt' ;
input rank city $12. amount : comma15.;
run;
proc print data=cityrank;
run;
Is This Answer Correct ? | 6 Yes | 5 No |
Post New Answer View All Answers
If you have a dataset that contains 100 variables, but you need only five of those, what is the code to force SAS to use only those variables?
what is sas olap server? : Sas-di
How substr function works in sas?
What versions of SAS have you used (on which platforms)?
Explain the use of proc gplot? : sas-grid-administration
What is the basic syntax of a sas program?
List out some key concept of SAS
What is factor analysis?
how do you want missing values handled? : Sas programming
Explain translate function?
Give some examples where proc report’s defaults are different than proc print’s defaults?
What is the work of tranwrd function?
What is the differnce between SDTM 3.1.2 to 3.1.1 version
what is the difference between nodup and nodupkey options? : Sas programming
how do you pull data from equifax?tell me the process?