Hello Everyone , I have This Table :
Oss | Client_ID | Code_ID | ||||||||||||||||
1 | 23895517 | 23895517 | ||||||||||||||||
2 | 23895517 | 23895518 |
| . | . | |||||||||||||
3 | 23895517 | 23895519 | . | . | ||||||||||||||
4 | 23895517 | 23895520 | . | |||||||||||||||
5 | 23895522 | 23895521 |
|
| . | . | ||||||||||||
6 | 23895522 | 23895522 | . |
|
(425630 ROWS , 3 COLUMN)
Than I have This Other Table :
Oss | Code_ID | Type_ID | Mas | TR_ID | LP-i_ID | |||||||||||||
1 | 23895517 | 143 | 5 |
| 0 | 2 | ||||||||||||
2 | 23895518 | 143 | 8 | . | 0 | 0 | . | |||||||||||
3 | 23895519 | 143 | 3 |
| . | 0 | 0 | . | ||||||||||
4 | 23895520 | 141 | 5 | . | 0 | 0 | ||||||||||||
5 | 23895521 | 139 | 8 | . | 0 | 0 | . | |||||||||||
6 | 23895522 | 139 | 1 | . | 0 | 0 |
|
(5 COLUMNS , 20540 ROWS)
And This Table :
Oss | FAM_ID | Des | ||||||||||||||||
1 | 30 | FAT | . | |||||||||||||||
2 | 25 | MO |
| . | . | |||||||||||||
3 | 15 | CH |
| . | . | |||||||||||||
4 | 15 | GRA | . |
| ||||||||||||||
5 | 15 | MO |
|
| . | . | ||||||||||||
6 | 26 | FAT |
| . | . |
(2 Columns , 24510 rows)
And This Table
Oss | TYPE_ID | DES | FAM_ID |
| ||||||||||||||
1 | 143 | FAT | 50 |
| ||||||||||||||
2 | 143 | MO | 83 | . | . | |||||||||||||
3 | 143 | CH | 38 | . | . | |||||||||||||
4 | 141 | MO | 2 | . | ||||||||||||||
5 | 139 | MO | 83 | . | . | |||||||||||||
6 | 139 | GRA | 19 | . | . |
(3 Columns 24510 Rows )
And This is The Table That I want to get :
Oss | Client_ID | Code_ID | Type_ID | Mas | FAM_ID | |||||||||||||
1 | 23895517 | 23895517 | 143 | 5 | 30 |
| . | |||||||||||
2 | 23895517 | 23895518 | 143 | 8 | 25 | . | ||||||||||||
3 | 23895517 | 23895519 | 143 | 3 | 15 | |||||||||||||
4 | 23895517 | 23895520 | 141 | 5 | 15 | . | ||||||||||||
5 | 23895522 | 23895521 | 139 | 8 | 15 | . | . | |||||||||||
6 | 23895522 | 23895522 | 139 | 1 | 26 | . |
| . |
So , If anyone can Give me a Help , it would be Great , Thank you in advance.
You could perform a simple Proc Sql and join to the associated tables but it appears your identifiers are not unique to values. Meaning TYPE_ID which is your key is not unique to one FAM_ID or DES on your 3rd (T3) and 4th (T4) table so you will get a 1 to many relationship. In order for this to work you would need T3.FAM_ID = T4.FAM_ID by T3.DES = T4.DES and utilize T3.TYPE_ID = T2.TYEP_ID. Unless these values do equal each other somewhere on your table and are not included on your sample I don't think this will work.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.