|
Try this replace RRN with a work variable. From the RRN_MAX value being
148 in your previous post this tells me you are loading all or
SFLSIZ>SFLPAG. Using rrn could give you unexpected results.
I added +1 to the rrn_max...once you get this going the way it was the
last record would not have printed ;-)
BegSR PrintReport;
rdashes = *ALL'-';
WrkRrn = 1;
write HEADING;
DoW WrkRrn < Rrn_Max+1;
Chain WrkRrn SPODATA;
If PrtOverFlow;
Write HEADING;
PrtOverflow = *off;
endif;
SPONUM = spno01 + '-' + spno02 + '-' + spno03;
PARTCL = %subst(spptcl:1:7);
SUPPLIER = spspcd + ' ' + spsplc;
SPOSDATE = %subst(%char(spsddt):5:2) + '/'
+ %subst(%char(spsddt):7:2) + '/'
+ %subst(%char(spsddt):1:4);
if %len(%trim(%char(spsdtm))) = 1;
SPOSTIME = '00:0' + %trim(%char(spsdtm));
endif;
if %len(%trim(%char(spsdtm))) = 2;
SPOSTIME = '00:' + %trim(%char(spsdtm));
endif;
if %len(%trim(%char(spsdtm))) = 3;
SPOSTIME = '0' + %subst(%char(spsdtm):1:1) + ':'
+ %subst(%char(spsdtm):2:2);
endif;
if %len(%trim(%char(spsdtm))) = 4;
SPOSTIME = %subst(%char(spsdtm):1:2) + ':'
+ %subst(%char(spsdtm):3:2);
endif;
PARTNO = %trim(spptno);
QTY = %trim(%editc(spoqty:'3'));
Write DETAIL;
WrkRrn = WrkRrn + 1;
EndDo;
Write pfooter;
Close SPOINQP;
Open SPOINQP;
EndSR;
Thanks,
Tommy Holden
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.