Help using Base SAS procedures

proc import- how to avoid the scientific notation for long numbers

Reply
New Contributor
Posts: 2

proc import- how to avoid the scientific notation for long numbers

Hi,

I need to import a text file and avoid the scientific notation for long numbers, is there an option I could use in proc import?

Thank you in advance,
Super Contributor
Super Contributor
Posts: 365

Re: proc import- how to avoid the scientific notation for long numbers

Hello Jad12,

Why do you need to avoid scientific notation? It is only a representation of numbers and you could change it using appropriate formatting.

Sincerely,
SPR
Super User
Posts: 10,500

Re: proc import- how to avoid the scientific notation for long numbers

One cause of the scientific notation is that the values have been imported with a BESTX. format and the width is smaller than you would like. So SAS is only displaying the X number of columns. By default SAS uses 20 rows to guess the format for numerics (from online help for PROC IMPORT). Set the option GUESSINGROWS= to something larger so that SAS "sees" more rows and gets a better chance to assign a width you'd like.

Or look at the datastep code generated in the log when using PROC IMPORT and customize it to assign the formats you'd like. Copy it from the LOG, past into the editor and got to town. I would recommend this if you you are going to import many files in the same format.
Ask a Question
Discussion stats
  • 2 replies
  • 970 views
  • 0 likes
  • 3 in conversation