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


Please Help Members By Posting Answers For Below Questions

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?

710


what is sas olap server? : Sas-di

692


How substr function works in sas?

705


What versions of SAS have you used (on which platforms)?

1020


Explain the use of proc gplot? : sas-grid-administration

556






What is the basic syntax of a sas program?

673


List out some key concept of SAS

625


What is factor analysis?

665


how do you want missing values handled? : Sas programming

538


Explain translate function?

638


Give some examples where proc report’s defaults are different than proc print’s defaults?

603


What is the work of tranwrd function?

672


What is the differnce between SDTM 3.1.2 to 3.1.1 version

4614


what is the difference between nodup and nodupkey options? : Sas programming

625


how do you pull data from equifax?tell me the process?

1386