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 / guest
data temp;
infile datalines ;
input sno city & $12.
pop : comma.;
datalines;
1 new york 7,262,700
2 los angeles 3,259,340
3 philadelphia 1,642,900
;
The ampersand (&) modifier is used to read character values
that contain embedded blanks.
The colon (:) modifier is used to read nonstandard data
values and character values that are longer than eight
characters, but which contain no embedded blanks.
| Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
where are dashboard components are created and maintained? : Sas-bi
why is sas considered self-documenting? : Sas programming
how would you create a data set with 1 observation and 30 variables from a data set with 30 observations and 1 variable? : Sas programming
What is the purpose of trailing @ and @@? How do you use them?
What is the difference between INPUT and INFILE ?
How to import multiple xls files into sas. Out of those files, how to get different values from a single variable and how to find number of rows per value type? We can do this using group by for one xls file with proc sql. Was wondering how I can achieve this for multiple files at the same time. Any ideas?
what is function of retain statment
What is factor analysis?
what are the benefits of data integration? : Sas-di
What is the use of divide function?
Approximately what date is represented by the SAS date value of 730?
How can you limit the variables written to output dataset in data step?
what is sas metadata repository? : Sas-bi
what is proc Index? and what is proc document?
Explain by-group processing?