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



Do you have the L1 on both the primary and the secondary file?  do the
fields have different names?  If so, then each time the value in the fields
changes you set on L1, right?   So, when the secondary file reads the its
first record of the new group, then it sets L1 on, too, since the value in
that field has just changed.  

It sounds like you want a combination of the L1 and the MR indicator?  Do
you want to process secondary records that have no primary records? 
 
---------------------------------
Booth Martin
http://www.martinvt.com
---------------------------------
-------Original Message-------
 
From: RPG programming on the AS400 / iSeries
Date: 04/08/05 03:42:02
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: primary and secondary files, match fields, summarizing/printing
single line per key
 
> -----Original Message-----
> From: Barton, Mike
> Sent: Friday, April 08, 2005 3:21 PM
>
> I asked that all L1 fields were the same, this
> also applies to L2 and L3 (which will also cause
> L1 to be on). Incidentally, I don't use MR at all.
 
Yup. This is what we did. We monitored the values of all control level
fields using the interactive debugger.
 
>
> The only difference I see between your version
> & what I have used is that you have M6 level
> but with no level break indicator against them.
> I assume this is ok since the compiler would have
> thrown it out.
>
> As mentioned earlier, its best to rename one set
> of fields to be the same as the other file fields.
 
Tried this as well, just now. The problem persists.
 
>
> Unfortunately I cannot quite see what is the
> problem....
>
 
I don't know whether to call it a problem, or not. Perhaps this is really
how RPG/400 works. But what we observed using the interactive debugger is
that *INL1 is set after reading the primary file without first finishing
reading the secondary files (with equal/equivalent keys).
 
Here's a partial listing of the query on the two files in question. After
reading the first record of CSPLNORD, *INL1 is set and triggers the printing
of details. It then proceeds to reading the first two records of the
secondary file, setting *INL1, and triggering the printing of another detail
line.
 
CSPLNORD
========
PLOYER   PLOMKT  PLOIGR  PLOCSZ  PLOCVT  PLOITM           PLOC01   MPODES
 
  2,005    EUR      CD      30     352    01160             1,000   EUROPE
MARK
  2,005                     35     304    01254             1,000   EUROPE
MARK
                                           TOTAL           2,000
 
  2,005             JC      05     106    01255             1,000   EUROPE
MARK
  2,005                     10     302    01250             1,000   EUROPE
MARK
                                           TOTAL           2,000
 
  2,005             MS      10     304    01250             1,000   EUROPE
MARK
                                           TOTAL           1,000
 
  2,005             PL      10     352    01159             1,000   EUROPE
MARK
  2,005                     30     304    01253             1,000   EUROPE
MARK
                                           TOTAL           2,000
 
                                           TOTAL           7,000
 
  2,005    USA      01      10     302    01250             1,000   USA
MARKET
  2,005                     15     811    00198             1,000   USA
MARKET
 
 
CSINVSUM
========
IVSYER   IVSMKT  IVSIGR  IVSCSZ  IVSCVT  IVSITM  IVSITP     IVSCSE
  2,005    EUR      CD      30     352    01160     S           204
  2,005                     30     352    01160     E           176
  2,005             JC      05     106    01255     S           408
  2,005                     05     106    01255     E             8
  2,005                     10     302    01250     S         1,156
  2,005                     10     302    01250     E            20
  2,005             MS      10     304    01250     S           748
  2,005                     10     304    01250     E           546
  2,005             PL      10     352    01159     S           340
  2,005                     10     352    01159     E           172
  2,005                     30     304    01253     S           272
  2,005                     30     304    01253     E           138
  2,005    USA              10     304    01250     S         1,240
  2,005                     10     304    01250     E         4,240
 
 
IPLNMJ1      01
I                                              PLOYER  M6
I                                              PLOMKTL3M5
I                                              PLOIGRL2M4
I                                              PLOCSZL1M3
I                                              PLOCVTL1M2
I                                              PLOITML1M1
IINVSUM      02
I                                              IVSYER  M6
I                                              IVSMKTL3M5
I                                              IVSIGRL2M4
I                                              IVSCSZL1M3
I                                              IVSCVTL1M2
I                                              IVSITML1M1
----------
  MAIN
----------
..
..
..
CL1                   EXSR PRTDTL
..
..
 
 
SAMPLE OUTPUT
=============
                                                          Cur Mo.   Total
     Item_  Size__  Variety___  Market_PO_Description____  ___PO__  Shipmts
  CONC FOR DC OR DIRECT
     01160  12-46   PO          EUROPE MARKET                1,000
 
     01160  12-46   PO          EUROPE MARKET                           204
 
     01254  6-10    J-          EUROPE MARKET                1,000
     01254  6-10    J-          EUROPE MARKET                           272
 
                                Sub-total                    2,000      476
 
 
I guess the way to go is an extract file.
 
--
Carl Mañoso
"It is not real work unless you would rather be doing something else."
[J.M.BARRIE]
 
--
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-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.