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

Hi

 

Can someone please help me. I am trying to run the following query:

 

Proc SQL;
Create table Temp as
Select *
from MM.mom_Claims
Where CLAIM_NO in (Select input(CLAIM_NO,15.) from PMB_ICD_Codes);

Quit;

 

 

However I am getting the following error:

8157 Proc SQL;
8158 Create table Temp as
8159 Select *
8160 from MM.mom_Claims
8161 Where CLAIM_NO in (Select input(CLAIM_NO,15.) from PMB_ICD_Codes);
ERROR: INPUT function requires a character argument.
ERROR: INPUT function requires a character argument.
ERROR: Expression using IN has components that are of different data types.
NOTE: The IN referred to may have been transformed from an OR to an IN at some point during PROC SQL WHERE clause
optimization.
8162
8163 Quit;

 

Note: In both the PMB_ICD_Code and mom_Claims file the CLAIM_NO field has the following attributes:

 

Lenght: 8

Format: 10.

Informat: 10.

Type: Numeric

 

I am not sure how to rewrite this as a I am very new to SAS.


Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

Since CLAIM_NO is already numeric, the input function is not needed.

Do this:

proc sql;
create table temp as
select *
from mm.mom_claims
where CLAIM_NO in (select CLAIM_NO from PMB_ICD_Codes);
quit;

View solution in original post

2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

Since CLAIM_NO seems to be numeric in both tables you are using, simply dropping the INPUT function part should do the job.

Kurt_Bremser
Super User

Since CLAIM_NO is already numeric, the input function is not needed.

Do this:

proc sql;
create table temp as
select *
from mm.mom_claims
where CLAIM_NO in (select CLAIM_NO from PMB_ICD_Codes);
quit;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 3382 views
  • 3 likes
  • 3 in conversation