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
is data integration and etl programming is same? : Sas-di
How will you react when, while consulting a SAS documentation manual to get an answer to a problem, someone says hey, I thought you were supposed to know all that stuff already, and not have to look it up in a book?
how can you create zero observation dataset? : Sas programming
What is the difference between nodupkey and nodup options?
How can you limit the variables written to output dataset in data step?
Given an unsorted data set, how to read the last observation to a new data set?
what is hash files in sas and why we are using this one in sas?
what is sas business intelligence? : Sas-bi
what is sas data set?
name some data transformation used in sas di? : Sas-di
what other sas products have you used and consider yourself proficient in using? : Sas programming
what is program data vector? : Sas-administrator
What do you know about sas and what we do? : sas-grid-administration
How would you identify a macro variable?
What do the mod and int function do? : Sas programming