|
Thanks Larry for your help... tell if this look better than before. ************************************************************** * Program ID: R0901 * Programmer: Phil Hayes * * Multiple Occurence Data Structure with Multiple Arrays * * Results: Comparing Monthly Highs and Lows * Grand Totals by Months * ************************************************************** FPRDSLSP IF E DISK FQPRINT O F 123 OF PRINTER * * Two Arrays- Sales(SAR) Month(MON) * E SAR 12 6 0 E SAV 12 6 0 E MON 1 12 9 E TOT 12 8 0 * * DATA STRUCTURE * I DS I 1 72 SLS I 1 720SAR C EXCPTHEADER * C READ PRDSLSP LR C *INLR DOWEQ*OFF C ADD SAR TOT * C MOVEASAR SAV C SORTASAV C Z-ADD1 X 30 C SAV,1 LOKUPSAR,X 90 C Z-ADD1 Y 30 C SAV,12 LOKUPSAR,Y 91 C EXCPTDETAIL * C *IN90 DOWEQ*ON C *IN91 OREQ *ON * C MOVEL*BLANKS HMON 9 C MOVEL*BLANKS LMON 9 C *IN90 IFEQ *ON C ADD 1 X C X IFGT 12 C MOVEL*OFF *IN90 C ELSE C SAV,1 LOKUPSAR,X 90 C *IN90 IFEQ *ON C MOVELMON,X LMON C END C END C END * C *IN91 IFEQ *ON C ADD 1 Y C Y IFGT 12 C MOVEL*OFF *IN91 C ELSE C SAV,12 LOKUPSAR,Y 91 C *IN91 IFEQ *ON C MOVELMON,Y HMON C END C END C END * C *IN90 IFEQ *ON C *IN91 OREQ *ON C EXCPTDETAL2 C ELSE C EXCPTDETAL3 C END * C ENDDO * C READ PRDSLSP LR C END * PRINT TOTALS C EXCPTTOTAL C 1 DO 12 X C EXCPTTOTAL1 C END * OQPRINT E 202 HEADER O UDATE Y 8 O 34 'ACME EXPLOSIVE ANNUAL' O + 1 'SALES SUMMARY' O 56 'PAGE' O PAGE Z 61 O E 1 HEADER O 7 'PRODUCT' O 27 'BEST MONTH' O 47 'WORST MONTH' * O E 1 DETAIL O PRODNO 6 O SAR,Y 1 22 '$' O MON,Y 32 O SAR,X 1 41 '$' O MON,X 51 * O E 1 DETAL2 O HMON 32 O LMON 51 * O E 1 DETAL3 * O E 21 TOTAL O 20 'TOTAL MONTHLY SALES:' O E 1 TOTAL1 O MON,X 10 O TOT,X 1 23 ** JANUARY FEBRUARY MARCH APRIL MAY JUNE JULY AUGUST SEPTEMBER OCTOBER NOVEMBER DECEMBER -----Original Message----- From: owner-rpg400-l@midrange.com [mailto:owner-rpg400-l@midrange.com]On Behalf Of Larry Ackerman Sent: Monday, October 25, 1999 5:27 AM To: RPG400-L@midrange.com Subject: Re: How do you receive multiple results from the same Product Number? You're making this much harder than it needs to be. Basic logic could be like this: Print Headings Until EOF Read If NOT EOF z-add -9's to hisls z-add 9's to losls z-add 0 to himth z-add 0 to lomth do 12 in X if mthsls(x) > hisls z-add x himth z-add sls to hisls if mthsls(x) < losls z-add x lomth z-add sls to losls add mthsls(x) totsls(x) excpt detail with product, hisls, mth(himth), losls, mth(lomth) DO 12 x excpt totals with mth(x), totsls(x) I left out the part for ties, think about it for a while, if you don't get post again or email me directly. Forget the Multi Occur data structures that's both unnecessary and much later in the course. Good luck and welcome to RPG larry +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.