You'll need to add an infile with a missover option so that SAS will not simply skip the blank value for the second varibale and go to the next line, as it will by defualt.
Then simply add a couple counters (you would normally need to use a retain to carry the values of the counters from one iteration to the next but this syntax will retain automatically).
data lo;
infile cards missover;
input id $ sal $ ;
if id='' or sal='' then no_of_missing+1;
else no_of_non_missing+1;
cards;
dfgh
dfgh dsfhdsf
dfgh urkrkrj
fjhjh
run;