The first record of the SAC has PO# 12345 and Item: ABCDE.
The ex_850dtly file has 2 records with that PO and Item combination. However, it seems to ignore the "dou not %found(ex_850dtly)" command and goes through the loop the 3rd time. when it hits the UPDATE, it bombs out.
What am I doing wrong?
Here is the code:
/free
read ex_850sac;
dou %eof(ex_850sac);
setll (edsacpo:edsacitm) ex_850dtly;
reade (edsacpo:edsacitm) ex_850dtly;
dou not %found(ex_850dtly);
item = %subst(edpo107:1:6);
color = %subst(edpo113:1:2);
if %subst(edsacupc:2:5) = %subst(edpo107:1:5);
size = '000';
else;
size = %subst(edpo113:3:3);
endif;
edpo118 = 'IS';
edpo119 = item + '-' + color + '-' + size;
edpo120 = 'MU';
edpo121 = edsacupc;
update edformat;
reade (edsacpo:edsacitm) ex_850dtly;
enddo;
read ex_850sac;
enddo;
*inlr = *on;
return;
/end-free
The ex_850dtly file has 2 records with that PO and Item combination. However, it seems to ignore the "dou not %found(ex_850dtly)" command and goes through the loop the 3rd time. when it hits the UPDATE, it bombs out.
What am I doing wrong?
Here is the code:
/free
read ex_850sac;
dou %eof(ex_850sac);
setll (edsacpo:edsacitm) ex_850dtly;
reade (edsacpo:edsacitm) ex_850dtly;
dou not %found(ex_850dtly);
item = %subst(edpo107:1:6);
color = %subst(edpo113:1:2);
if %subst(edsacupc:2:5) = %subst(edpo107:1:5);
size = '000';
else;
size = %subst(edpo113:3:3);
endif;
edpo118 = 'IS';
edpo119 = item + '-' + color + '-' + size;
edpo120 = 'MU';
edpo121 = edsacupc;
update edformat;
reade (edsacpo:edsacitm) ex_850dtly;
enddo;
read ex_850sac;
enddo;
*inlr = *on;
return;
/end-free