Help using Base SAS procedures

Proc import csv

Reply
Occasional Contributor
Posts: 7

Proc import csv

Hi,
I have csv file

ex: id money
1 31803,03

I want read in sas db money whit format BEST12.

ex: id money
1 31803.03

but the output is this:

ex: id money
1 3180303000

money format = COMMA1
money informat = COMMA3.

Why sas read the number in this way?
Are there any option to set in proc import step?
Can I change the money format? Message was edited by: CMilena
Contributor sss
Contributor
Posts: 65

Re: Proc import csv

hi,

try with Proc import statement and use sheetname='sheetname'$ .

Ex:
Proc import data=' ' outfile=work.xyz replace;
sheetname='sheetname'$
quit;
Trusted Advisor
Posts: 2,113

Re: Proc import csv

It looks like you need to be using the COMMAXw.d format. (note the "X" for reversing the role of the comma and decimal in money).
Super User
Posts: 10,516

Re: Proc import csv

I find that most real CSV data files don't get handled well by the defaults or even available options with PROC IMPORT. I go to the log after running PROC IMPORT and find the generated lines of code, copy and paste into the editor. Then clean up the informats, formats, input statemement and add labels.
Ask a Question
Discussion stats
  • 3 replies
  • 269 views
  • 0 likes
  • 4 in conversation