× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Tommy,

Still no dice.  Made the exact same changes and had no luck.

One of my fellow programmers suggested that this may be because that the
subfile is reading by reference from the physical file.  In my display
DDS, the subfile is:

     A          R SPODATA                   SFL CHGINPDFT(CS)
     A            SPONUM        13A  O  7  2
     A            PARTNO        15A  O  7 16
     A            PARTCL         7A  O  7 33
     A            QTY            6A  O  7 41
     A            SUPPLIER       9A  O  7 48
     A            SPRCCD    R        O  7 58
     A            SPOSDATE      10A  O  7 62
     A            SPOSTIME       5A  O  7 73
     A            SPTRMD    R        H
     A            SPRMRK    R        H
     A            SPUSR     R        H

And in my Printer file, the detail section is defined as:

     A          R DETAIL
     A                                      SPACEB(1)

     A            SPONUM        13A  O     2
     A            PARTNO        15A  O    +2
     A            PARTCL         7A  O    +2
     A            QTY            6A  O    +2
     A            SUPPLIER       9A  O    +2
     A            SPRCCD    R        O    +2
     A            SPOSDATE      10A  O    +2
     A            SPOSTIME       5A  O    +2
     A            SPTRMD    R        O    +2
     A            SPRMRK    R        O    +2
     A            SPUSR     R        O    +2

Would this have anything to do with the printout of the subfile?

Thanks for all of your help so far!

Brian.

-----Original Message-----
From: Holden Tommy [mailto:Tommy.Holden@xxxxxxxxxxxxxxxxx] 
Sent: Thursday, October 13, 2005 4:27 PM
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




As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

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