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

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 981 views
  • 0 likes
  • 2 in conversation