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".
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.