Donald H
I can almost debug blind ;-), but sas logs help
Would you like me to guess(see below), or provide your versions ........>
1 > provide : a sas-code showing what doesn't work
+
2 > provide : the sas-log showing what the sas system thought of the code,
+
3 > provide : the output, if any
PeterC
data orig ;
input Pat_id ST_JO NEPEA PRINC WESTM ;
list;cards;
1 1 . . .
2 1 . 1 .
3 . . . 1
4 . 1 . .
5 1 . 1 1
6 . 1 1 .
7 . . . 1
8 . 1 . 1
9 . 1 . .
10 1 . . .
11 . 1 . .
12 1 . . .
13 . 1 . .
14 . . 1 .
15 1 1 1 .
;
PROC FORMAT ;
*creating a translation from missing and 1 to visits string;
value visits
1 ='ONLY VISITED'
. = 'NEVER VISITED'
2-high = 'MULTI' ;
run ;
proc print data= orig ;
id Pat_id ;
format _numeric_ visits. pat_id best8. ;
run ;
data your_updated_data ;
set ;
array thos(*) ST_JO NEPEA PRINC WESTM ;
if n( of thos(*) ) >1 then
do _i_=1 to dim(thos) ;
thos(_i_) +2 ;
end ;
format ST_JO NEPEA PRINC WESTM visits. ;
run ;
proc print ;
run ;
Message was edited by: Peter.C