If you want to check the number of digits, you have to convert the number into a string, then you could use the length-function. But since a number with more than six digits is larger than 999999 you should just check the value. Separating data is only necessary in some very rare cases, so you may want to explain the steps to follow-up so that maybe better solutions can be found.
If you have to separate the data, try the following data-step:
data work.SmallNumbers work.LargerNumbers;
set have;
if MRN <= 999999 then output work.SmallNumbers;
else output work.LargerNumbers;
run;