BookmarkSubscribeRSS Feed
ybz12003
Rhodochrosite | Level 12

Hi, all:

 

I exported CSV file by using ODS.  However, Excel automaticlly remove ".0" and become integer.  I use the notepad to open CSV file, the numbe format are correct as ".0".    How to fix this problem?

 

data nhssfinal;
set yt.nhssfinal (keep= type formatted_value);
run;
ods csv file="E:\My SAS Files\NHSS2020.CSV";
style=minimal;
options missing="";
proc print data=nhssfinal;
run;
ods csv close;

4 REPLIES 4
ybz12003
Rhodochrosite | Level 12

Below are some example showned in CSV.

 

15O17
16O8
17O4.1
18O5.6
19O9.1
20O27.1
21O3.8
22O30.8
23O15.4
24O8.6
25O6.2
26O16.5
27O9.3
28O2.3
29O4.4
30O13.6
31O4
32O20.6
33O5.9
34O21.3
35O15.1
36O1.6
37O9.8
38O8.2
39O6.8
40O11.7
41O8
42O16.2
43O3.5
44O14.5
45O18
46O4
47O1
48O12.3
49O7.6
50O4.6
51O4.2
52O1.4
53N47989
54N680
55N31
56N681
57N187
ybz12003
Rhodochrosite | Level 12

Due to CSV couldn't be uploaded from here.   I copy some error from I read in CSV format.  Please check the row 15,16,31,41,46,47.

Thanks.

ballardw
Super User

Name your CSV file with a TXT extension and it can be uploaded without problems.

 

If your CSV file has values with decimals like 5.0 and Excel removes them, that is an Excel issue.

 

Is your question related to seeing the deicimals in SAS?

 

Post how you read or import the CSV file.

 

Ksharp
Super User
Add a TAB ( '09'x ) character or a single quote( ' ) before that numeric variable .

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 4 replies
  • 1349 views
  • 0 likes
  • 3 in conversation