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.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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