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 / subbu
data s;
input no 1-2 area $ 3-15 am $ 16-30 ;
amount=input(am,comma15.);
format amount comma15.;
drop am;
cards;
1 new york 7,262,700
2 los angeles 3,259,340
3 philadelphia 1,642,900
;
proc print;
run;
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
if a variable contain dates like "2015/01"---"2015/12" (yymm) ,How to add day to those dates,if them month is jan then 31 if the month is feb then 28 so on ...
What commands are used in the case of including or excluding any specific variables in the data set?
What is the use of PROC gplot?
how do you want missing values handled? : Sas programming
Can you execute macro within another macro? If so, how would sas know where the current macro ended and the new one began? : sas-macro
What is the difference between INPUT and INFILE ?
what is SAS OPTIMIZATION?
for what purpose would you use the retain statement? : Sas programming
I have a SCD Type 2 Dimention for Location In which A Sales Office in Having two Surrogate Keys just because of the change in it's Sales Group. SKey SalesGroup Sales Office BeginDate EndDate 280 SG1 SO1 01APR2000 01APR2010 281 SG2 SO1 02APR2010 31MAR2999 Now while loading the Fact, the Lookup ir returning SKey 280 for records before and after 01APR2010. I am not able to give WHERE condition in the Lookup Properties (TranDate between BeginDate and EndDate). Please help.
Given an unsorted data set, how to read the last observation to a new data set?
what is sas olap server? : Sas-di
What are all the problems you faced while validating tables and reports?
in the flow of data step processing, what is the first action in a typical data step? : Sas programming
Explain input and put function?
Mention what is the difference between nodupkey and nodup options?