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


Please Help Members By Posting Answers For Below Questions

How to read an input file in sas?

659


what is the use of proc contents and proc print in sas? : Sas-administrator

611


Describe 5 ways to do a “table lookup” in SAS?

704


do you prefer proc report or proc tabulate? Why? : Sas programming

581


What is the difference between where and if statement?

624






Explain data_null_?

611


What is interleaving in SAS?

679


Do you know the features of sas?

598


Why and when do you use proc sql?

764


what is hash files in sas and why we are using this one in sas?

1734


what is the difference between floor and ceil functions in sas? : Sas-administrator

708


how could you generate test data with no input data? : Sas programming

635


If a variable contains only numbers, can it be a character data type?

616


For what purposes have you used sas macros? : sas-macro

540


explain what is data set in sas? : Sas-administrator

531