@IGK22 wrote:
so firstly there should be
proc sort data = dbraw.subjtbl(keep=s_siteid s_subjid trtgrp screen_fail)
out = rand;
by s_siteid s_subjid;
run;
and then i just created data step rand where i'm using input? the problem is i don't know how to use it at all, here what i got.
data rand(where=(trtgrp ne .)); input(trtgrp, TRTMNT.); run;
and the result
ERROR 22-322: Syntax error, expecting one of the following: a name, arrayname, ), -, :, [, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_, {.
ERROR 76-322: Syntax error, statement will be ignored.
469 run;
ERROR: No DATALINES or INFILE statement.
ERROR: Variable trtgrp is not on file WORK.TRTDATA.
The SAS documentation for the INPUT function is very clear and gives examples of use.
https://documentation.sas.com/?cdcId=pgmmvacdc&cdcVersion=9.4&docsetId=lefunctionsref&docsetTarget=p19en16vskd2vhn1vwmxpxnglxxs.htm&locale=en
Assuming you have properly defined the format TRTMNT, then this is the correct syntax
newvariablename = input(trtgrp, TRTMNT.);
... View more