Hello,
I want to complete each series present in the table test1 by a value tmp
when absent relative to the var1 of the test table
data test;
input var1;
cards;
1
2
3
;run;
data test1;
input var1;
cards;
1
2
3
2
3
1
2
;run;
desired results
1
2
3
tmp
2
3
1
2
tmp
Thank you
This would be a nice homework assignment. What have you tried so far? If you've tried nothing, then let us now how you would logically perform the task.
In your example the variable Var1 is numeric. As such it can never hold the value "tmp" which is character.
Also, what would the result be if your data looked like:
data test1;
input var1;
cards;
4
5
7
1
2
3
2
3
1
2
;run;
or
data test1; input var1; cards; 4 5 7 1 2 3 2 3 1 2 5 1 2 3 3 3 ;run;
You will have to expand a bit on your definition of what a "series" is and "absent relative".
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.