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.
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 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.