07-11-2017 10:47 PM
I'm struggling in print my new value (Mileage, Cost), but unfortunately it still did not work even I used commax and dollarx.
The result is (.), and I'm not sure what I'm missing. I use sas university edition.
infile "/folders/myshortcuts/SASUniversityEdition/module 3/usedcars.txt"
firstobs=2 expandtabs obs=50 dsd
Year $2. Manufacturer $16. Model $16. Mileage commax. cost dollarx.
contents data = usedcar varnum;
value Mileage low - 50000 = '<50,000'
50000 - high = '>=50,000'
other = 'Unknown';
Value Cost low - 5000 = 'Economic'
5000-10000 = 'Moderate'
other = 'Expensive';
Here is my log
07-12-2017 12:05 AM
Your first datastep won't run as expected, Some of your infile options are throwing off the results and some of your informats are wrong. I think that you'll find the following to work a lot better:
data usedcar; infile "/folders/myshortcuts/SASUniversityEdition/module 3/usedcars.txt" firstobs=2 obs=50 ; informat year $2.; informat Manufacturer $16.; informat Model $16.; informat Mileage comma10.; informat cost dollar7.; input Year Manufacturer Model Mileage cost; run;
Art, CEO, AnalystFinder.com