hi
whenever I need to do this (numerical to caharcter I use
var1 = input(put(var2, 8.2), $8.);
if you start of with a numerical field, then I doubt you will be able to keep with the zeros ay the beginning, but if you need them try
var1 = input(put(var2, 8.2), $8.);
var1= left(reverse(var1))...
Hi
think for part 1 all you need is a sub string command (substr)
data tmp;
set ...;
newvar= substr(specimen#,4,1);
run;
for excel please have a look into one of my training docs using DDE commands
having trouble attathcing it, so copied and pasted below
DDE COMMAND
SAS AND EXCEL...
Hi
you could try using DDE commands
I have yet to test this, but should be ok. Not sure how familiar you are with DDE commands though
would also need a bit more work to output your data set to the sheet.
cheers
data work.title1;
format var1 var2 var3 $60.;
var1= 'The University of...
with sql
use the group by function
proc sql;
create table blah as
select 'all' as all,
sum(var1+var2+var3) as sum
from dset1
group by all;
quit;
cheers
Hi
whenever I use logistic/reg/genmod etc.. they always reduce the length of the parameter estimates to 16.
So to use the parameter estimate in different data set i either reduce the length of the variable to 16 before hand or use
if...
Hi
I suggest eithe
data temp;
set ;
if var1 ^=. then count=1;
else count=0;
/* if character */
if var1 ^= ' ' then count=1;
else count=0;
all='all';
run;
/* or could use*/
data temp;
set ;
count = (var1 ^=.); /* ^= or ne whatever you prefer */
/* if character */
count...
hi
have you tried a proc summary or proc mean?
e.eg.
proc summary data = test nway;
class tick date;
var value;
output out = test1 mean=;
run;
*using retain command;
data test1;
set test;
by tick date1;
if first.date1 then do;
var1=0;
var2=0;
end;
var1 = var1 +1...
Hi
for character regression don't use proc reg.
you can use proc glm or proc genmod.
e.g.
proc glm data = user.blah;
class your character variables;
model something = your character vairable,with your numerical varaibles;
output out = user.blah1 p=pred;
run;
when using character...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.