I have the following data set which is being processed within a macro: id time ipred occ sid subj1 0 0 subj1 0.5 0 subj1 1 0 subj1 2 0 subj1 3 0 subj1 4 0 subj1 5 0 I would like to: 1.take a substring of the variable subj1 to have a result of 1. How can this be done when the substring is a value within the id column? 2.I tried to convert id from a character to numeric value using sid=input(id,8.) but a s you can see it is converted but the column entries are missing. What am I doing wrong to cause the column entries to be missing? I have included my code which is part of a Macro.
/*16)**************TEST CONCENTRATIONS************************/
data simt&i._&j;
retain _name_ cln lagn ka1n ka2n vfn fn ;
set nall_final&i._&j;
if Treat in ('ATES') ;
if _n_=2;
do time=0, 0.5,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,24;
/*DOSE IS IN NG AND CP IN NG/ML*/
dose=40000;
cln=input (cl,8.);
rename cln=cl;
lagn= input (lag,8.);
rename lagn= lag;
ka1n=input (ka1,8.);
rename ka1n=ka1;
ka2n=input (ka2,8.);
rename ka2n=ka2;
vfn=input (vf,8.);
rename vfn=vf;
fn=input (logit,8.);
rename fn=f;
id=input(_name_,8.);
rename _name_=id;
drop id cl lag ka1 ka2 vf logit;
substr(subj1&i,1,4);
sid=input (id,8.);
output ;
end;
run;
... View more