× 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.



I will send it in a few minutes Ron.....


On Fri, 13 May 2005 10:18:14 -0230, RPower wrote
> Could you please attach the printer description file?
> 
> Ron Power
> Programmer
> Information Services
> City Of St. John's, NL
> P.O. Box 908
> St. John's, NL
> A1C 5M2
> Tel: 709-576-8132
> Email: rpower@xxxxxxxxxx
> Website: http://www.stjohns.ca/
> ___________________________________________________________________________
 Success is going from failure to failure without a loss of enthusiasm. - 
 Sir Winston Churchill
> 
> "Douglas W. Palme" <dpalme@xxxxxxxxxxx> 
> Sent by: rpg400-l-bounces@xxxxxxxxxxxx
> 12/05/2005 06:25 PM
> Please respond to
> RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
> 
> To
> rpg400-l@xxxxxxxxxxxx
> cc
> 
> Subject
> Need some help with a report
> 
> I have been moving along in my feeble attempt to gain as much rpg 
> knowledge 
> as I can get, however I have a report that I need to produce that 
> has been
> 
> giving me fits for four days and if anyone can provide any 
> assistance I 
 would appreciate it.
> 
> I will post the source below.  I have a logical file which contains 
> branch
> 
> (location) id, customer number, stock numbers, and each record is 
> equivalent 
> to one line item from our sales.  It is keyed by ilninv#a (location 
> id), 
 ilnsoldto (customer number) and ilnstk (stock number), it 
> also has a range
> 
> restriction on it for line items related to this fiscal year.  I am 
> attempting to print out one detail line with the sum of sales and 
> costs 
 for 
 each stock number and customer number, with a page 
> break when the location
> 
> id changes.
> 
> So far, every time I run the report it spits out over a 1,000 pages 
> and 
 has 
 produced as many as 89,000 pages....it appears to keep 
> printing the same 
 header file over and over again.....
> 
> Any help, pointers or suggestions would be appreciated.
> 
> Douglas
> 
[UTF-8?]>  
â??***********************************************************************
 ***
     â??*       ORIGINAL DATE:           05/11/2005
     â??*       APPLICATION NAME:        BRANCH MARGIN REPORT
     â??*       PROGRAM NAME:            BRCHMARRPT
     â??*       DESCRIPTION:             1. READ FIRST REC   2. CREATE 
 HEADING
     â??*                                3. READ RECORDS INTO TOTALS
     â??*                                4. BREAK ON STK NO, CUST NO AND  
 THE
     â??*                                   BRANCH LOCATION
 â??***********************************************************************
 ***
     â??*       LOG            OF             MODIFICATIONS
     â??*
     â??*       DATE                PGMR           DESCRIPTION
 â??*----------------------------------------------------------------------
> ---
[UTF-8?]>      â??*       /  /
[UTF-8?]>  
â??***********************************************************************
 ***
     â??*       FUNCTION OF INDICATORS
     â??*
     â??*       IND                      FUNCTION
 â??*----------------------------------------------------------------------
> ---
[UTF-8?]>      â??*       99                       OFLIND INDICATOR
[UTF-8?]>      â??*       INLR                     LAST RECORD INDICATOR
[UTF-8?]>  
â??***********************************************************************
 ***
     â??*       SUBROUTINE INDEX
 â??***********************************************************************
 ***
     â??*       PRTHEADING - PRINT HEADING SUB ROUTINE
     â??*       BRCHLOOKUP - BRANCH LOOKUP SUB ROUTINE
 â??***********************************************************************
 ***
     â??*       FILES
 â??***********************************************************************
 ***
     FCUSTMLF   IF   E           K DISK
     FBRCHMARGINIF   E           K DISK
     FBRCHMARLSTO    E             PRINTER OFLIND(*IN99)
 â??***********************************************************************
 ***
     â??*       STANDALONE VARIABLES
 â??***********************************************************************
 ***
     DDBRANCH          S             20A
     DDBRANCHID        S              2A
     DDSTOCKNO         S             20A
     DDDESC            S             24A
     DDCUSTNO          S              9S 0
     DDTSALES          S             12S 2
     DDTCOST           S             12S 2
     DDMARGIN          S             12S 2
     DDPCT             S              4S 3
 â??***********************************************************************
 ***
     â??*       MAINLINE
 â??***********************************************************************
 ***
     â??*       READ THE FIRST RECORD IN THE FILE AND WRITE DATA TO 
 VARIABLES
 â??***********************************************************************
 ***
     C                   READ      BRANCH
      *       COPY DATA TO HOLDING AREA
     C                   EVAL      DBRANCHID = ILNINV#A
     C                   EVAL      DCUSTNO = ILNSOLDTO
     C                   EVAL      DSTOCKNO = ILNSTK
     C                   DOW       NOT %EOF(BRCHMARGIN)
     C                   IF        ILNINV#A = DBRANCHID
     C                   IF        ILNSOLDTO = DCUSTNO
     C                   IF        ILNSTK = DSTOCKNO
     C                   EVAL      DTSALES = DTSALES + ILNEPRICE
     C                   EVAL      DTCOST = DTCOST + ILNEUAVCST
     C                   ELSE
     C                   EXSR      PRTDETAIL
     C                   ENDIF
     C                   ELSE
     C                   EXSR      PRTDETAIL
     C                   ENDIF
     C                   ELSE
     C                   EXSR      PRTDETAIL
     C                   EVAL      *IN99 = *ON
     C                   ENDIF
     C                   READ      BRANCH
     C                   ENDDO
     C                   EVAL      *INLR = *ON
     C                   RETURN
> 
[UTF-8?]> 
**************************************************************************
     â??*       PRINT HEADINGS SUB-ROUTINE
 â??***********************************************************************
 ***
     C     PRTHEADING    BEGSR
     C                   EXSR      BRCHLOOKUP
     C                   EVAL      PRTBRANCH = DBRANCH
     C                   WRITE     HEADINGS
     C                   EVAL      *IN99 = *OFF
     C                   ENDSR
 â??***********************************************************************
 ***
     â??*       BRANCH LOOKUP SUB-ROUTINE
 â??***********************************************************************
 ***
     C     BRCHLOOKUP    BEGSR
     C                   SELECT
     C                   WHEN      DBRANCHID = 'D '
     C                   EVAL      DBRANCH = 'DECATUR'
     C                   WHEN      DBRANCHID = 'A '
     C                   EVAL      DBRANCH = 'ALL COMPANY'
     C                   WHEN      DBRANCHID = 'J '
     C                   EVAL      DBRANCH = 'JACKSONVILLE'
     C                   WHEN      DBRANCHID = 'Q '
     C                   EVAL      DBRANCH = 'QUINCY'
     C                   WHEN      DBRANCHID = 'B '
     C                   EVAL      DBRANCH = 'RIVER BEND'
     C                   WHEN      DBRANCHID = 'S '
     C                   EVAL      DBRANCH = 'SPRINGFIELD'
     C                   WHEN      DBRANCHID = 'M '
     C                   EVAL      DBRANCH = 'MATTOON'
     C                   WHEN      DBRANCHID = 'V '
     C                   EVAL      DBRANCH = 'MOUNT VERNON'
     C                   WHEN      DBRANCHID = 'N '
     C                   EVAL      DBRANCH = 'PONTIAC'
     C                   WHEN      DBRANCHID = 'L '
     C                   EVAL      DBRANCH = 'LITCHFIELD'
     C                   ENDSL
     C                   ENDSR
 â??***********************************************************************
 ***
     â??*       PRINT DETAIL SUB-ROUTINE
 â??***********************************************************************
 ***
     C     PRTDETAIL     BEGSR
> 
[UTF-8?]>      â??*       WRITE DATA TO VARIABLES AND MAKE NECESSARY 
> CALCULATIONS
> 
>      C                   IF        DTSALES = 0
>      C                   ELSE
>      C                   EVAL      DMARGIN = DTSALES - DTCOST
>      C                   EVAL      DPCT = DMARGIN / DTSALES
>      C                   EVAL      PRTCUSTNO = DCUSTNO
>      C                   EVAL      PRTBRANCH = DBRANCH
>      C                   EVAL      PRTSTKNO = DSTOCKNO
>      C                   EVAL      PRTDESC = DDESC
>      C                   EVAL      PRTSALES = DTSALES
>      C                   EVAL      PRTCOST = DTCOST
>      C                   EVAL      PRTMARGIN = DMARGIN
>      C                   EVAL      PRTPCT = DPCT
>      C                   WRITE     DETAIL
>      C                   EVAL      DTSALES = ILNEPRICE
>      C                   EVAL      DTCOST = ILNEUAVCST
>      C                   EVAL      DBRANCHID = ILNINV#A
>      C                   EVAL      DCUSTNO = ILNSOLDTO
>      C                   EVAL      DSTOCKNO = ILNSTK
>      C                   EVAL      DMARGIN = 0
>      C                   EVAL      DPCT = 0
>      C                   ENDIF
>      C                   IF        *IN99 = *ON
>      C                   EXSR      PRTHEADING
>      C                   EVAL      *IN99 = *OFF
>      C                   ENDIF
>      C                   ENDSR
[UTF-8?]>  
â??***********************************************************************
 ***
> 
> -- 
> 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.


--
Open WebMail Project (http://openwebmail.org)


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-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.