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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 1027 views
  • 0 likes
  • 4 in conversation