Help using Base SAS procedures

Exporting to Access - cutoff

Reply
N/A
Posts: 0

Exporting to Access - cutoff

I'm trying to export into Access percentages. The percentages were created using proc tabulate (pctSum)

The percentages are formatted using 5.2
The Access table is showing all the numbers except the value 100.
How can I fix the problem so SAS exports all the values that are 100 into Access?
SAS Super FREQ
Posts: 8,742

Re: Exporting to Access - cutoff

Hi:
99.99 is 5 total characters, including the decimal point. So the format for 99.99 would be 5.2 -- but 100.00 is 6 total characters, including the decimal point. So a format of 5.2 would be incorrect for the SAS format width to use for 100.00 percent. In the same fashion, the dollar amount: $12,345.67 would need at least a width of 10 and the "official" format specification would be: dollar10.2 -- you need 10 as the width because you have 7 numbers and 3 symbols: . , and $.

The clue that you have a format width that's not "wide" enough is that you should see a note in the SAS Log that says something like:

NOTE: At least one W.D format was too small for the number to be printed. The decimal may be
shifted by the "BEST" format.



The format would need to be even larger if you were using a PICTURE format to put a percent sign in the column. Complicating the whole picture is HOW you are exporting to Access (Microsoft Access???) Are you using PROC EXPORT or the LIBNAME engine???

If you fix the format width and your number does not get carried over into Microsoft Access, then you may want to work with Tech Support on this question.

cynthia
N/A
Posts: 0

Re: Exporting to Access - cutoff

Hi Cynthia:

Changing the format to 6.2 solved the problem!!

Thank you!
Ask a Question
Discussion stats
  • 2 replies
  • 119 views
  • 0 likes
  • 2 in conversation