data nopit sinpit twopit allpit; infile 'c:/temp/quad.txt'; drop dis; input a= b= c=; if a=0 then /*linear equation*/ do; if b=0 and c ~=0 then output nopit; else if b=0 and c=0 then output allpit; else output sinpit; end; else /*quadratic equation*/ do; dis= b**2 - 4 * a * c; /*discriminant*/ if dis < 0 then output nopit; /*no solution*/ else if dis > 0 then output twopit; else output sinpit; end; proc print data=nopit; title 'no solutions'; proc print data=allpit; title 'all solutions'; proc print data=sinpit; title 'single solution'; proc print data=twopit; title 'two solutions'; run;