07-17-2017 02:31 PM
I converted xls file into txt and then i wrote a code to infile that file but i am not getting results and the log windows is showing garbage values.
input C_ID Product_ID P_CATEGORY $ CONDTION $ Brand $ Price Selling_price;
title 'online shopping';
proc print data=online;
07-17-2017 02:32 PM
So, if you're not getting the results you want, and you also want our help, we'd need to see the input data (or a relevant portion of it) as well as the output results that aren't what you want.
07-17-2017 02:38 PM
input data(small portion of the whole data)
the wrong output
Obs C_ID Product_ID P_CATEGORY CONDTION Brand Price Selling_price 1 2 3 4 5 6 7
|.||.||card 304||6679 396||carrier||.||.|
|.||.||Sports M||card 586||6740 844||.||.|
|.||.||5974 470||card 288||7759 266||.||.|
07-17-2017 02:44 PM
Try using a PROC IMPORT instead. Set the GUESSINGROWS option to the number of rows that you have.
The log will have the data step code that you need and you can compare it to your non-working code.
07-17-2017 04:11 PM
Unexpected output? Provide input data in the form of an attached text file or just pasted into a code box, the actual results and the expected results.
I would suggest that saving as CSV would be a better choice than TXT as you may end up with tab delimited and your code doesn't show any delimeter. I would expect not to get the desired result. With the CSV try using the import wizard or proc import and then examine the datastep code that will appear in the log. I often then copy the code from the log and modify where needed to allow longer variables, change things that appear to be numeric but should be character or the other way around and such.