Obs | drug | placebo | total | col0 |
1 | 1 | 4.76% | 0 | 0.00% | 1 | 2.50% | Latin | |
2 | 13 61.90% | 11 57.89% | 24 60.00% | Caucasian | ||||
3 | 7 33.33% | 7 36.84% | 14 35.00% | Black | ||||
4 | 0 | 0.00% | 1 | 5.26% | 1 | 2.50% | Asian |
Hi guys, sorry for the mess of the table have, but i am interested in the last variable (col0) with the value (Latin, Cauc. Black and Asian), and
I am interesting to add a new record heading this table as:
col0='Race' , drug= ' ' , placebo=' ', total=' '
I try the next syntax using INSERT in proc sql (I want to do it in proc qsl) but it doesnt work...any help?
proc sql;
*Add new record;
insert into have
set col0='Race',
Drug=' ',
Placebo=' ',
from have ;
quit;
Thanks.
That only works because all of the affected columns are of character type, and sufficiently wide.
It looks like you are just tweaking headings for display. You should be able to do that with a simple LABEL= spec, as in
select
...
col0 label='Race'
...
from
... ;
michtka wrote:
I got it:
proc sql;
*Add new record;
insert into tablec1
(Drug,Placebo, total, Col0)
values
(' ',' ', ' ', 'Race');
quit;
Thanks.
I got it:
proc sql;
*Add new record;
insert into tablec1
(Drug,Placebo, total, Col0)
values
(' ',' ', ' ', 'Race');
quit;
Thanks.
That only works because all of the affected columns are of character type, and sufficiently wide.
It looks like you are just tweaking headings for display. You should be able to do that with a simple LABEL= spec, as in
select
...
col0 label='Race'
...
from
... ;
michtka wrote:
I got it:
proc sql;
*Add new record;
insert into tablec1
(Drug,Placebo, total, Col0)
values
(' ',' ', ' ', 'Race');
quit;
Thanks.
Sorry Howles, I saw your answer as correct, but it not, because with col0 label='Race', you change the name of the variable,
when i am not interested in this, I want a new record called 'sex' as another value of the variable col0.
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 the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.