Perhaps
Else if missing( brand) then mid =0;
If you have many of these types of operations to do you might consider a custom informat.
proc format library=work;
invalue missingtext
. = 0
other=1;
run;
data example;
x= ' ';
yx=input(x,missingtext.);
z='anything';
yz=input(z,missingtext.);
run;
This informat looks at an input string, if it is missing then the result is 0 anything else is 1. Even if the input string has a leading blank the result is one.
For your use then you would have
mid=input(brand,missingtext.);
NOTE this works if you are interested in knowing that your variable has some text.
... View more