0
votes

I am using this code to import csv file in sas

data retail;
infile "C:\users\Documents\training\Retails_csv" DSD MISSOVER FIRST OBS =2;
INPUT Supplier :$32. Item_Category :$32. Month :$3. Cost :DOLLAR10. Revenue :DOLLAR10. Unit_Price :DOLLAR10.2 Units_Availed :8. Units_Sold :8.;run;

I need to get the Cost Revenue and Unit price in $ formatThe Output sas data

my dataset is I need the same Cost, revenue, Unit_PRICE IN DOLLAR FORMAT please someone help thanks

1
You posted a photograph that looks like a spreadsheet, but your program is trying to read from a text file. Is your file really a CSV file? If so then it should only contain text. Please show the lines of text in the file. Do not post it as a photograph, instead put the lines of text into the question.Tom
It is a CSV filemohit kumar
Please do not SHOUT when posting here. Text in ALL CAPS is more difficult to read and understand, and SHOUTING will not get you an answer any faster. It's aoso rather impolite to SHOUT at us when you're asking us for free help to solve your problem.Ken White
I am sorry for that, i don't mean to shout. And i am very thankful for the the helpmohit kumar

1 Answers

0
votes

The INFILE statement does not take the REPLACE keyword. In fact since INFILE is just saying where the input data is coming from there isn't really any logical feature that the INFILE statement might have that would use that name.

You need to attach the DOLLAR format to the variables if you want SAS to print the values using dollar signs and thousands separators. You can either attach the format in the data step or in the steps that print the data.

format cost revenue unit_price dollar10. ;