SDS: Correct ill-formed statement

VMS compiler objected to variable ch being modified in two places in the same statement.  Expand into full if statement instead.