col1 | col2 | col3 | col4 | col5 | col6 | col7 | col8 | col9 | col10 | FIRST DIFF | SECOND DIFF | THIRD DIFF | |
obs1 | -16,13 | -6,45 | -9,68 | ZE | AM | 16822 | 2 | 2 | XXX | 09-janv-19 | col6 | - | - |
obs2 | -16,13 | -6,45 | -9,68 | ZE | AM | 16822 | 2 | 2 | XXX | 16-janv-19 | col6 | - | - |
obs3 | -16,13 | -6,45 | -9,68 | ZE | AM | 16822 | 2 | 2 | XXX | 23-janv-19 | col6 | - | - |
obs4 | -16,13 | -6,45 | -9,68 | ZE | AM | 16822 | 2 | 2 | XXX | 30-janv-19 | col6 | - | - |
obs5 | 16,13 | 6,45 | 9,68 | ZE | AM | 16892 | 2 | 2 | XXX | 09-janv-19 | col6 | - | - |
obs6 | 16,13 | 6,45 | 9,68 | ZE | AM | 16892 | 2 | 2 | XXX | 16-janv-19 | col6 | - | - |
obs7 | 16,13 | 6,45 | 9,68 | ZE | AM | 16892 | 2 | 2 | XXX | 23-janv-19 | col6 | - | - |
obs8 | 16,13 | 6,45 | 9,68 | ZE | AM | 16892 | 2 | 2 | XXX | 30-janv-19 | col6 | - | - |
I want to compare similar rows in (col4 to col10) and their negative matches in col1 col2 col3 and I want to detect if some rows are not similar on col4 to col10; in this example col6 is not similar
Why col6? i don't understand this logic. Please be more specific.
Please don't use only upcase-letters in the subject, this is called "screaming" i prefer not be yelled at.
You will also want to post the data in usable form: a data-step using datalines/cards and extend the data so that all cases you are looking have an example.
data have;
input col1 col2 col3 $ col4 $ col5 $ col6 $ col7 $ col8 $ col9 $ col10 $;
datalines;
-16 -6 -9 ze am o 2 km JH date1
-16 -6 -9 ze am o 2 km JH date2
-16 -6 -9 ze am o 2 km JH date3
-16 -6 -9 ze am o 2 km JH date4
16 6 9 ze am n 2 km JH date1
16 6 9 ze am n 2 km JH date2
16 6 9 ze am n 2 km JH date3
16 6 9 ze am n 2 km JH date4
;
run;
columns from 4 to 10 are class variables they must be similars
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.