Taking over code from colleague who left company. Not sure I understand what the line 'else if...' is doing as I get the following error. Thank you. Error" Invalid third argument to function SUBSTR id2=0012312345 Pat_id=55555 Enc_type=office visit region=NY id2=12312345 id=12312345 age=30 bmi 20.8 _ERROR_=1 _N_=6 Variable id2 is text length 11: id2 0012312345 0023454321 0034565656 0099912345 Code: data two; set one (rename=(id2=id3)); by pat_id; region='NY'; IF region='MN' then ID2=compress(ID3); Else if region='NY' then ID2=compress(put(input(substr(id3, 3, 11),11.),11.) ); id = input(id2,15.); run;
... View more