On 10/23/2018 1:53 PM, Thomas Burrows wrote:
Here is what I mean from top to bottom on the file.length
Using DBU here are the first three variables or columns.
Key 1 is the first column A5 length. Key 2 is the second column A14
company Customer National
005 000059 000059
005 000117 000117
005 000125 000117
005 000133 000117
005 000141 000117
005 000158 000117
005 000166 021436
005 000174 074625
005 000182 000182
005 000208 000208
005 000224 000224
setll (cuco: cucuno) arlcu;
dow not %eof(arlcu);
if cunano = ' 000117';
count4 = count4 + 1;
cunano = cunano;
count1 = count1 + 1;
I get 14 for count4. And 36 thousand plus for counter1. Which is the
number of records in ARLCU.
If we can assume that the SETLL uses the lowest CUCO and CUCUNO values,
the DOW would start at the lowest record and run to %EOF. COUNT1 would
then be 36k, right?
And because the DOW doesn't stop when CUNO changes, or CUCUNO changes,
COUNT4 represents every row in the file that is for National Account
000117, regardless of CUNO or CUCUNO.
You might want a READE, to restrict the DOW just to the keys of interest.
One thing I've found personally helpful is my Best and Dearest Friend
QSYSPRT, and I mean that sincerely. I'd put in an EXCEPT at each of the
places where the counts are incrementing and some O-specs that print the
fields that will give me that Aha!. It seems faster for me to reach that
Aha! moment when I WRKSPLF than when I'm in debug.
Oh, one other thing - I used to leave debugging code like that in the
source, conditioned on U8 or some such. Today, I'd wrap it in
conditional compilation like this:
// uncomment below for printed debugging info
// define DEBUG
Which in real life is a LF, but when I copiedYep. What you want to do is CRTDUPOBJ the PF, make sure your library is
the file into my library ARLCU became a PF.
at the top of *LIBL, then CRTDUPOBJ the LF. Then you'll see the LF in
your lib pointing to the PF in your lib.
Your updates make it better!
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
Please contact support@xxxxxxxxxxxx for any subscription related
Help support midrange.com by shopping at amazon.com with our affiliate