|
-----Original Message----- From: Phil & Vera Hayes [mailto:PHayes1@Prodigy.net] Sent: Sunday, October 24, 1999 6:02 PM To: david@midrange.com Subject: How do you receive multiple results from the same Product Number? Hi ya'all, Here is the problem... from Judy's book( Chapter 9 Problem 1) Qddssrc contains a File PRDSLSP with the following definition; Prodno 1-6 SLS 7-78 1 2 3 4 5 6 7 1234567890123456789012345678901234567890123456789012345678901234567890 XX/XX/XX ACME EXPLOSIVES ANNUAL SALES SUMMARY PAGE XX0X PRODUCT BEST MONTH WORST MONTH XXXXX XXX,X0X JANUARY XXX,X0X SEPTEMBER XXXXX XXX,X0X MAY XXX,X0X AUGUST .. AND SO ON TOTAL MONTHLY SALES: JANUARY $XX,XXX,X0X FEBRUARY $XX,XXX,X0X MARCH $XX,XXX,X0X . . . DECEMBER $XX,XXX,X0X If the Product has multiple equal high results it should print also. The same with the low month. Here is what I have; ************************************************************** * Program ID: R0901 * * * * * * * ************************************************************** FPRDSLSP IF E DISK FQPRINT O F 123 OF PRINTER * *Sort Array in Ascending Order * E SAR 12 6 0 E MON 1 12 9 * IMNS DS 10 I 1 60PRODNO I 7 78 SLS I 7 780SAR * *OA DS 10 * Define Like Fields C EXCPTHEADER C EXCPTHEADS2 C EXCPTTOTAL1 * C 1 DO 10 I 20 C I OCUR MNS * C READ PRDSLSP 90 C *IN90 IFEQ *ON C LEAVE * C ENDIF C ENDDO C EXSR MTOTL C EXSR VALUE C MOVE *ON *INLR * C MTOTL BEGSR C 1 DO 12 M 20 C 1 DO 10 N 20 C N OCUR MNS * C ADD SAR,M MNTHLY 90 C MOVEAMON,M MONTH 9 C ENDDO C EXCPTDETAIL C EXCPTTOTALS C CLEARMNTHLY C ENDDO C ENDSR * VALUE SUBROTINE * C VALUE BEGSR * C 1 DO 10 L 20 C L OCUR MNS C MOVEASAR,1 HLO 60 C 1 DO 12 A 20 C HLO IFGT SAR,A C MOVEASAR,A HLO 60 C MOVEAMON,A LMTH 9 C ENDIF C ENDDO C* ENDDO * * @HI * C MOVEASAR,1 HHI 60 C 1 DO 12 A 20 C HHI IFLT SAR,A C MOVEASAR,A HHI C MOVEAMON,A HMTH 9 C ENDIF C ENDDO C ENDDO C ENDSR * 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 HEADS2 O 7 'PRODUCT' O 27 'BEST MONTH' O 47 'WORST MONTH' * O E 1 DETAIL O PRODNO 6 O HHI 22 O HMTH 32 O HLO 41 O LMTH 51 * O E 21 TOTAL1 O 20 'TOTAL MONTHLY SALES:' O E 1 TOTALS O MONTH 10 O MNTHLY1 23 ** JANUARY FEBRUARY MARCH APRIL MAY JUNE JULY AUGUST SEPTEMBER OCTOBER NOVEMBER DECEMBER You Help would be most appreciated... Thank You! Phil New to RPG +--- | 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-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.