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 / pravin

data cityrank;

input rank @3 city $ 13. amount : comma15.;
datalines;
1 new york 7,262,700
2 los angeles 3,259,340
3 philadelphia 1,642,900

;
run;
proc print data=cityrank;
run;

this is the ans only for this example new york has more than
single blank so problem arise hire.if not & modifier can be
used.

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

explain the function of substr in sas? : Sas-administrator

552


Explain why double trailing @@ is used in input statement?

569


what is the difference between infile and input? : Sas-administrator

605


What does the RUN statement do?

851


what is sas data set?

664






What are the prime responsibilities of data integration administrator? : Sas-di

585


what is data governance? : Sas-di

621


how does sas handle missing values in sort order? : Sas programming

530


For a user to have access to a standard workspace server, is internal authentication alone is sufficient? : sas-grid-administration

535


What is slibref?

744


Describe the ways in which you can create a macro variable?

622


Differences between where and if statement?

582


What do you know about sas data set?

592


What does PROC print, and PROC contents do?

724


what is ae onset date n what is RDS

1931