- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Search for "SAS numeric precision".
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set
Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets
--------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You can store 256 numbers, 0 to 255. They have 1 to 3 digits.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I assume this is a theoretical question as you can't define a 1 byte numeric variable in SAS. For Windows / Unix the minimum is 3 bytes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It depends on how you store your numbers.
If stored as character in human-readable form, you obviously have one digit per byte.
If stored as character, but with the IBM packed decimal format, you have 2 digits per byte.
If you do some trickery and work with pure integers in character strings, each byte can hold 256 numbers, so the number of digits is that of the number 256 ** (number of bytes) - 1.
As mentioned, numeric has a minimum length of 3, and for that, search for "SAS numeric precision" to know how the storage lengths influence the maximum precision and the largest integer that can be stored exactly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@balu_g wrote:
Hi, I have a question? numeric and character data has default length is 8 bytes. In the character data "one byte for one character." Then how many digits can store in one byte?
For actual use in SAS datasets, that is a question of little concern as the smallest numeric variable in bytes is 2 or 3 (and mostly 3 IIRC)
length
specifies a numeric constant that is the number of bytes used for storing variable values.
Range For numeric variables, 2 to 8 or 3 to 8, depending on your operating environment. For character variables, 1 to 32767 under all operating environments.