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 ? | 1 Yes | 4 No |
Post New Answer View All Answers
Explain translate function?
What is the difference between reading data from an external file and reading data from an existing data set?
what is sas and what are the functions? : Sas-administrator
name some data transformation used in sas di? : Sas-di
what is scheduling and how will u implement it. In scheduling 5 jobs r running if there is an error occured at 3rd job and how will u check and waht necessary steps will u take not to repeat the same mistake
What is the purpose of trailing @ and @@? How do you use them?
how can you import .csv file in to sas? : Sas programming
what is factor analysis? : Sas-administrator
How would you identify a macro variable?
how many display types available in sas bi dashboard? : Sas-bi
How we can create SAS USER DEFINED CODE?
Difference between nodup and nodupkey options?
How would you define the end of a macro? : sas-macro
How long can a macro variable be? A token? : sas-macro
Describe the ways in which you can create a macro variable?