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".
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!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: