BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
vraj1
Quartz | Level 8
proc sql;
create table want as
select id, ifc(max(indexw(put(b.MM_2,best12.),put(id,best12.))>0),'Y','N') as MM_Flag,ifc(max(indexw(put(b.LL_1,best12.),put(id,best12.))>0),'Y','N') as LL_Flag
from main a,BOOK11 b
group by id;
quit;

ERROR: Numeric format BEST in PUT function requires a numeric argument.
ERROR: Numeric format BEST in PUT function requires a numeric argument.
ERROR: Numeric format BEST in PUT function requires a numeric argument.
ERROR: Numeric format BEST in PUT function requires a numeric argument.
 

PaigeMiller
Diamond | Level 26

So way back in message 9 of this thread, you replied to me, but this is not my code. So that's why I was very unclear about what you were saying.

--
Paige Miller
Ksharp
Super User
data WORK.main;
infile datalines dsd truncover;
input ID:BEST12.;
datalines4;
111
134
122
221
232
198
908
762
212
2122
3435
2123
;;;;

data WORK.BOOK11;
infile datalines dsd truncover;
input LL_1:BEST12. MM_2:BEST12.;
datalines4;
111,908
134,762
122,212
221,
232,
198,
;;;;

data want;
 if _n_=1 then do;
   if 0 then set book11;
   declare hash L(dataset:'book11(keep=LL_1 where=(LL_1 is not missing))');
   L.definekey('LL_1');
   L.definedone();
   declare hash M(dataset:'book11(keep=MM_2 where=(MM_2 is not missing))');
   M.definekey('MM_2');
   M.definedone();
 end;
set main;
if L.check(key:id)=0 then LL_Flag='Y';else LL_Flag='N';
if M.check(key:id)=0 then MM_Flag='Y';else MM_Flag='N';
drop LL_1 MM_2;
run;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 17 replies
  • 7009 views
  • 0 likes
  • 4 in conversation