BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Jayreed34
Calcite | Level 5

Running this code and coming up with the error above. Any suggestions on how to successfully run?

 

 

proc sql ; create table max_line_apc as
select legacy_claim_id
,line_id
,apc_fee
,max_apc_fee
from OPSURG6
where apc_fee not in (0, .)
order by legacy_claim_id, apc_fee desc
;
quit ;

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

This indicates that when you are doing some sort of comparison, one of the variables is numeric and one of the variables is character/text, and so these cannot be compared. In your code, this is the comparison where this happens:

 

where apc_fee not in (0, .)

 

To fix this, you might want to change apc_fee to numeric (if possible), or try this

 

where input(apc_fee,32.) not in (0,.)

 

 

The Input function will turn a character variable into a numeric variable

--
Paige Miller

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

This indicates that when you are doing some sort of comparison, one of the variables is numeric and one of the variables is character/text, and so these cannot be compared. In your code, this is the comparison where this happens:

 

where apc_fee not in (0, .)

 

To fix this, you might want to change apc_fee to numeric (if possible), or try this

 

where input(apc_fee,32.) not in (0,.)

 

 

The Input function will turn a character variable into a numeric variable

--
Paige Miller
PaigeMiller
Diamond | Level 26

When things are not working, we need to see the LOG (we need to see the entire log for this PROC SQL)

--
Paige Miller

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 471 views
  • 0 likes
  • 2 in conversation