BookmarkSubscribeRSS Feed
HeatherNewton
Quartz | Level 8

when I convert sas dataset to csv one file looks like this

2.0223322E12

 

how can I transform its format before converting to csv so that it looks like a normal decimal?

3 REPLIES 3
HeatherNewton
Quartz | Level 8

sorry I need look like a 14 digit no not a decimal

eg 12345678901234

LinusH
Tourmaline | Level 20

What method are you using for the export?

If you specify a format with an explicit length for that variable it might help, e.g., "14."

Data never sleeps
ballardw
Super User

@HeatherNewton wrote:

when I convert sas dataset to csv one file looks like this

2.0223322E12

 

how can I transform its format before converting to csv so that it looks like a normal decimal?


You don't say where you are looking at this. If, as I suspect, you are examining the CSV file with spreadsheet software try making the column width wider. One common behavior is to attempt to display something that consists of many digits in the allowed space. So the software displays the value as scientific notation.

 

Or open the CSV in a TEXT editor to confirm the value was not exported by SAS as exponential. At which point make sure that the format SAS has for the variable will display properly. If your values actually have more than 14 digits you likely need to consider if it should be numeric at all as you bumping up against the storage precision of numeric values.

Which raises question, exactly what does the value represent? If you are not doing arithmetic with it, like an account number or other identifier, then it should be stored as character.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1012 views
  • 0 likes
  • 3 in conversation