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

Dear All,

i hope someone can help me: 

I have two datasets that I would like to connect to each other.
In dataset A there are AEs listed and in the variable AECMNO the corresponding CMs (2, 3, 26, 27, 28, 29, 30, 31, 32,33,34).
In dataset B, these CMs should be found in the variable CMSPID.
I have tried the following statement. unfortunately a: not all hits are listed and b. 1 wrong hit is listed.

proc sql;
create table AE_CM
as select * from test_AE as A left join cm as B on A.SubjectId=B.SubjectId where (AECMNO contains CMSPID);
quit;

 

thank you for your help

 

raigner_1-1672823816400.png

 

raigner_2-1672823872636.png

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
Could try this one :

from test_AE as A left join cm as B on A.SubjectId=B.SubjectId and findw(AECMNO,strip(CMSPID),' ,');

View solution in original post

2 REPLIES 2
Ksharp
Super User
Could try this one :

from test_AE as A left join cm as B on A.SubjectId=B.SubjectId and findw(AECMNO,strip(CMSPID),' ,');
raigner
Calcite | Level 5

Thank you very much it works really precisely.

 

best

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 346 views
  • 0 likes
  • 2 in conversation