BookmarkSubscribeRSS Feed
CMilena
Calcite | Level 5
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
3 REPLIES 3
sss
Fluorite | Level 6 sss
Fluorite | Level 6
hi,

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

Ex:
Proc import data=' ' outfile=work.xyz replace;
sheetname='sheetname'$
quit;
Doc_Duke
Rhodochrosite | Level 12
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).
ballardw
Super User
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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1253 views
  • 0 likes
  • 4 in conversation