☑ This topic is solved.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 08-07-2023 06:29 AM
(1128 views)
Hi, I used commax format to format some numeric variables. Nevertheless, running the code I got an error: "character expression requires character format"
proc sql;
create table
table
as select
variable1,
variable2 format commax22.2
from source;
quit;
I'm sure variable 2 is numeric, why do I get the error? thanks anyone for help
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@ari2495 wrote:
Yes, i've just run, and i found out the format is "best". Can you suggest me what to do? thanks and excuse me, i'm a new user
Note the question is not what format is ATTACHED to the variable. The question is what TYPE is the variable.
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Why are you "sure"? Did you run PROC CONTENTS?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Yes, i've just run, and i found out the format is "best". Can you suggest me what to do? thanks and excuse me, i'm a new user
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
format commax22.2
----->
format=commax22.2
----->
format=commax22.2
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@ari2495 wrote:
Yes, i've just run, and i found out the format is "best". Can you suggest me what to do? thanks and excuse me, i'm a new user
Note the question is not what format is ATTACHED to the variable. The question is what TYPE is the variable.