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 / chandrakanth

To Solasa and others ....whenever you read data from an input file...you need to be careful about the last data value in every dataline you have values like x,xxx,xxx which is total width of 9, when you mention more than 9 the input pointer will go the next data line to get the remaining spaces. So in your code you used comma10. try with using comma9. I am very sure it will work.

Another option is if you want to keep that comma10. use TRUNCOVER in the infile statement, this should fix all the extra spaces you mention in the input statement.

let me know if this does not help you

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the functions which are used for character handling functions?

620


What is the use of PROC gplot?

642


what is star schema? : Sas-di

649


explain the difference between alternate key, business key, foreign key, generated key, primary key, retained key and surrogate key ? : Sas-di

551


Tell me about % include and % eval? : sas-macro

683






How do you test for missing values?

1062


how do the in= variables improve the capability of a merge? : Sas programming

941


List out some key concept of SAS

625


Differentiate input and infile.

599


What is the basic structure of a sas program?

602


Explain translate function?

638


how does sas handle missing values in assignment statements? : Sas programming

571


What does the trace option do?

671


How do you specify the number of iterations and specific condition within a single do loop?

628


Explain bmdp procedure?

616