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


Please Help Members By Posting Answers For Below Questions

Explain translate function?

638


What is the difference between reading data from an external file and reading data from an existing data set?

641


what is sas and what are the functions? : Sas-administrator

544


name some data transformation used in sas di? : Sas-di

548


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

1920






What is the purpose of trailing @ and @@? How do you use them?

617


how can you import .csv file in to sas? : Sas programming

642


what is factor analysis? : Sas-administrator

617


How would you identify a macro variable?

653


how many display types available in sas bi dashboard? : Sas-bi

646


How we can create SAS USER DEFINED CODE?

1618


Difference between nodup and nodupkey options?

637


How would you define the end of a macro? : sas-macro

612


How long can a macro variable be? A token? : sas-macro

721


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

628