hello I have my query below
What I'm trying to do is use the asmt_tmplt_id and restrict the data so that it only takes these 4 ids, I get the error below when I try, is it just the wrong type of statement I'm doing?
proc sort data=lib.fall_assessments out=tmp3 nodupkey ;
where BLD_ASMT_ID in ('461') ;
by MBR_ID ARC_QUEST_ID RSPN_CHO_ID ;
proc sort data=tmp3 nodupkey ;
where ASMT_TMPLT_ID in ('6746','6953','7086','7173');
by MBR_ID ARC_QUEST_ID ;
proc transpose data=tmp3 out=tmp3 ;
by MBR_ID ;
id ARC_QUEST_ID ;
var RSPN_CHO_ID ;
run ;
NOTE: There were 4468 observations read from the data set LIB.FALL_ASSESSMENTS.
WHERE BLD_ASMT_ID='461';
NOTE: 106 observations with duplicate key values were deleted.
9 The SAS System 15:52 Friday, November 3, 2017
NOTE: The data set WORK.TMP3 has 4362 observations and 12 variables.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.05 seconds
cpu time 0.03 seconds
33 proc sort data=tmp3 nodupkey ;
34 where ASMT_TMPLT_ID in ('6746','6953','7086','7173');
ERROR: WHERE clause operator requires compatible variables.
35 by MBR_ID ARC_QUEST_ID ;
Apparently your ID variable is actually numeric and not character. Remove the ' from the IN values.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.