×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Also Brian, how about moving all the printing stuff you are doing inside the
loop into a subroutine outside of the loop, just to unclutter our minds.  
 
---------------------------------
Booth Martin
http://www.martinvt.com
---------------------------------
-------Original Message-------
 
From: RPG programming on the AS400 / iSeries
Date: 10/13/05 16:03:12
To: RPG programming on the AS400 / iSeries
Subject: RE: Printing a Subfile - Revisited
 
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
 
 
 
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
 
.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 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.