- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 05-10-2011 07:18 AM
(14519 views)
Dear All,
Please help me out the following issue.
Input:
data a;
input a ;
datalines;
9
34
45
64
;
output;
9.00
34.0
45.0
64.0
I can convert the data using put function to character (ex: put(a,8.1);
or i can display the value with format 8.1;
I just want to store the value with decimal value Zero to the integers ( i.e 34 to 34.0)
Could you please suggest me is ther any other way to solve this issue.
Thanks In Advance.
Please help me out
Please help me out the following issue.
Input:
data a;
input a ;
datalines;
9
34
45
64
;
output;
9.00
34.0
45.0
64.0
I can convert the data using put function to character (ex: put(a,8.1);
or i can display the value with format 8.1;
I just want to store the value with decimal value Zero to the integers ( i.e 34 to 34.0)
Could you please suggest me is ther any other way to solve this issue.
Thanks In Advance.
Please help me out
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi
SAS knows only 2 data types: character or numeric. There is no integer data type.
But you can always store a format like 8.1 permanent for a variable - so it will show 34.0 by "default".
HTH
Patrick
SAS knows only 2 data types: character or numeric. There is no integer data type.
But you can always store a format like 8.1 permanent for a variable - so it will show 34.0 by "default".
HTH
Patrick
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Dear Patrick.
Thanks for your response.
How can i convert numeric value 34 to 34.0 and stores into numeric variable.
Thanks IN Advance.
Thanks for your response.
How can i convert numeric value 34 to 34.0 and stores into numeric variable.
Thanks IN Advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
From SAS' perspective, there is no difference between 34 and 34.0 except for the display format. The underlying data are the same.
If you want to change the format, then you can do so but it makes zero difference with the actual data.
If you want to change the format, then you can do so but it makes zero difference with the actual data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
More specific to the point, review the use of the SAS FORMAT and/or ATTRIB statement which is used to associate an "output display format" with a SAS variable.
There are both SAS-system standard formats documented in the SAS Language Dictionary and also there is the SAS PROC FORMAT (procedure) where you can develop / define your own format.
Scott Barry
Suggested Google advanced search arguments, this topic / post:
display numeric variable integer decimal site:sas.com
format documentation site:sas.com
There are both SAS-system standard formats documented in the SAS Language Dictionary and also there is the SAS PROC FORMAT (procedure) where you can develop / define your own format.
Scott Barry
Suggested Google advanced search arguments, this topic / post:
display numeric variable integer decimal site:sas.com
format documentation site:sas.com