Hi:
I'm not sure whether you really need a DO loop or not. Basically, the DATA step program is an implied loop -- it will repeat the statements in the program for every dataline or row in the input data.
Consider this program. It reads in data that resembles your example (without so many values), calculates the sum of the numbers on each row (excluding CODE and PRODUCT) and creates 2 output data sets, based on the value of CODE. Since I didn't know what your criteria were for deciding that something was outstanding, I just did the output based on the value of CODE:
[pre]
data testcode;
infile datalines;
input code product $ var0 var1 var2 var3 var4;
format code z3.;
return;
datalines;
069 Motor 25 182 67 217 88
070 Motor 18 114 28 11 44
071 Motor 153 102 12 6 23
072 Motor 259 786 559 74 21
;
run;
data out071 out072;
set testcode;
tot = sum(of var0-var4);
if code = 71 then output out071;
else if code = 72 then output out072;
run;
proc print data=out071;
title '071';
run;
proc print data=out072;
title '072';
run;
[/pre]
If you need to create a more dynamic program, then you may need to investigate using a SAS macro program to dynamically find out which records meet your criteria and create the appropriately named output datasets.
If you decide that you do need to use SAS Macro processing for your task, then the key thing is to start with a working SAS program. Make sure you have the program logic working in a 'regular' program before you try to introduce macro elements into the code.
For more information about the SAS Macro Facility, the documentation is quite good and this paper provides a good introduction:
http://www2.sas.com/proceedings/sugi28/056-28.pdf
cynthia