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
What is data _null_?
How long can a macro variable be? A token? : sas-macro
What is SAS informats?
what is business intelligence? : Sas-bi
How do you use the do loop if you don’t know how many times you should execute the do loop?
Do you need to know if there are any missing values?
Describe what are the different levels of administrative users in sas? : sas-grid-administration
What is auto call macro and how to create a auto call macro? What is the use of it? How to use it in sas with macros? : sas-macro
How to test the debugging in sas?
how to debug and test the sas program? : Sas-administrator
How would you define the end of a macro? : sas-macro
What do the put and input function do?
If you use a symput in a data step, when and where can you use the macro variable? : sas-macro
for report generation which one you used proc report or data_null_?
Can you explain the process of calendar?