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 / poornima
data poo;
infile 'D:\poo.txt ';
input rank country $ 12. salary ;
INFORMAT SALARY COMMA10.;
FORMAT SALARY COMMA10.;
run;
proc print;
run;
Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
data data1; input dt account; format dt date9.; cards; 1745 1230 1756 1120 1788 1130 1767 1240 ; data data2; input startdt enddt total; format startdt date9. enddt date9.; cards; 1657 1834 12300 1557 1758 16800 1789 1789 12300 1788 1345 12383 1899 1899 13250 ; proc sql; create table data3 as select * from data1 as x left join data2 as y on x.dt>=y.startdt and x.dt<=y.enddt; quit; Here, we are getting cartision product. But,I want left join report consisting of this program. It should not get duplicate values. you can modify the program also.
what is transformation in sas data integration? : Sas-di
where to use sas business intelligence? : Sas-bi
What is a pdv and what are its functions?
Which function is used to count the number of intervals between two sas dates?
Where do you use proc means over proc freq?
What is the difference between %local and %global? : sas-macro
What is the different between functions and PROCs that calculate the same simple descriptive statistics?
what are input dataset and output dataset options? : Sas programming
How would you define the end of a macro?
what is the difference between infile and input? : Sas-administrator
what are informats in sas? : Sas-administrator
For what purpose would you use the RETAIN statement?
How would you determine the number of missing or nonmissing values in computations?
how will you locate the sas platform applications? : Sas-bi