Yes. I am assume that savcuno is defined like(cunano)
Both are A14's
D savcuno S 14A
From DBU of ARLCU
CUNANO A 14
-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxx> On Behalf Of Alan Shore
Sent: Tuesday, October 23, 2018 3:41 PM
To: RPG programming on the IBM i (AS/400 and iSeries) <rpg400-l@xxxxxxxxxxxx>
Subject: RE: Problem with reading a file that does have keys
[ External Email ]
----------------------------------------------------------------------
Hi Peter
Been somewhat busy - but have been trying to follow this thread You said that your program is
Doing a "DOU NOT %EOF(filename)
Then an EXSR X1 to the read routine where the read on the file is
BEGSR x1
READ FILENAME;
endsr
Shouldn't that be
DOU %EOF(filename)
Exsr X1
Enddo
Then in X1
read arlcu;
if not %eof(arlcu)
if cunano = savcuno;
count4 = count4 + 1;
endif;
savcuno = cunano;
count1 = count1 + 1;
endif
I am assume that savcuno is defined like(cunano)
Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
'If you're going through hell, keep going.'
Winston Churchill
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Burrows, Thomas 1001
Sent: Tuesday, October 23, 2018 4:25 PM
To: RPG programming on the IBM i (AS/400 and iSeries) <rpg400-l@xxxxxxxxxxxx>
Subject: [EXTERNAL] RE: Problem with reading a file that does have keys
Peter:
I had the "K" in column 34. Removed that and took out the SETLL. Get the exact same results. At no time should This statement be TRUE;
read arlcu;
if cunano = savcuno;
count4 = count4 + 1;
endif;
savcuno = cunano;
count1 = count1 + 1;
================
There are 36,815 records in ARLCU and not a single repeating CUNANO.
Not sure what is up.
Thomas
-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxx> On Behalf Of Peter Dow
Sent: Tuesday, October 23, 2018 2:55 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Problem with reading a file that does have keys
[ External Email ]
----------------------------------------------------------------------
Hi Thomas,
In regards to your question "is there anything on the F specs I could be overlooking?", make sure there's a "K" in pos.34 of the F-spec, or if you're doing free-format, the KEYED keyword. Otherwise you'd be reading the file by RRN instead of by key.
--
*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
petercdow@xxxxxxxxx <mailto:petercdow@xxxxxxxxx> pdow@xxxxxxxxxxxxxx <mailto:pdow@xxxxxxxxxxxxxx> /
On 10/23/2018 8:45 AM, Thomas Burrows wrote:
I want to read a keyed file from top to bottom. i.e. I am finding that
I seem to read some records more than once.
is there anything on the F specs I could be overlooking?
I put a counter in for the read and I get the right number of times
through the read routine.
Doing a "DOU NOT %EOF(filename)
Then an EXSR X1 to the read routine where the read on the file is
BEGSR x1
READ FILENAME;
endsr
I put an if statement in after the read looking against one of the
account numbers that is only in the file being read from once. But I
get SEVEN or more hits in the IF statement checking against that one account number.
Thomas Burrows
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.com_mailman_listinfo_rpg400-2Dl&d=DwICAg&c=Iej4I5bEYPmgv5l2sS6i8A&r=XeGBz1fvL6mzoxSW9-Fyt7Ajo0tG_mOKUz5KbIaikfo&m=QCA-vbpQGWbbjYIkv4DxXqDmou5ymphgVPPC2_71_Zc&s=pG265zx8Dj_eiwNFG11DCYAjFN0qynBK6I4ah2vDsoA&e=
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_rpg400-2Dl&d=DwICAg&c=Iej4I5bEYPmgv5l2sS6i8A&r=XeGBz1fvL6mzoxSW9-Fyt7Ajo0tG_mOKUz5KbIaikfo&m=QCA-vbpQGWbbjYIkv4DxXqDmou5ymphgVPPC2_71_Zc&s=g2oS2y-XDDaJJ-KJBgmcCio1ZM9INm0OAgGDBzLJVqY&e=.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://urldefense.proofpoint.com/v2/url?u=http-3A__amzn.to_2dEadiD&d=DwICAg&c=Iej4I5bEYPmgv5l2sS6i8A&r=XeGBz1fvL6mzoxSW9-Fyt7Ajo0tG_mOKUz5KbIaikfo&m=QCA-vbpQGWbbjYIkv4DxXqDmou5ymphgVPPC2_71_Zc&s=ayHN-DkHhblwl1N7OR1CpX7TwmAW_tvwOkX24AQwEAI&e=
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.com_mailman_listinfo_rpg400-2Dl&d=DwICAg&c=Iej4I5bEYPmgv5l2sS6i8A&r=XeGBz1fvL6mzoxSW9-Fyt7Ajo0tG_mOKUz5KbIaikfo&m=4H9Y7Rsn3QvbyJRDTf0a_P-oO8b_zF0g1uxIuVIPjRY&s=XHCmP1_K0IekhpnK8zoOzXnE2l6XtY71IBRlCphBgwE&e=
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_rpg400-2Dl&d=DwICAg&c=Iej4I5bEYPmgv5l2sS6i8A&r=XeGBz1fvL6mzoxSW9-Fyt7Ajo0tG_mOKUz5KbIaikfo&m=4H9Y7Rsn3QvbyJRDTf0a_P-oO8b_zF0g1uxIuVIPjRY&s=CisQz6FMFF7GWZZzFhY1ixFWTyNbkhl7PoOs8uFcrH8&e=.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://urldefense.proofpoint.com/v2/url?u=http-3A__amzn.to_2dEadiD&d=DwICAg&c=Iej4I5bEYPmgv5l2sS6i8A&r=XeGBz1fvL6mzoxSW9-Fyt7Ajo0tG_mOKUz5KbIaikfo&m=4H9Y7Rsn3QvbyJRDTf0a_P-oO8b_zF0g1uxIuVIPjRY&s=vG714-fGlNxQ7tLvOMwu4xiKbLvtntKWPBWQSSKfbY8&e=
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.com_mailman_listinfo_rpg400-2Dl&d=DwICAg&c=Iej4I5bEYPmgv5l2sS6i8A&r=XeGBz1fvL6mzoxSW9-Fyt7Ajo0tG_mOKUz5KbIaikfo&m=4H9Y7Rsn3QvbyJRDTf0a_P-oO8b_zF0g1uxIuVIPjRY&s=XHCmP1_K0IekhpnK8zoOzXnE2l6XtY71IBRlCphBgwE&e=
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_rpg400-2Dl&d=DwICAg&c=Iej4I5bEYPmgv5l2sS6i8A&r=XeGBz1fvL6mzoxSW9-Fyt7Ajo0tG_mOKUz5KbIaikfo&m=4H9Y7Rsn3QvbyJRDTf0a_P-oO8b_zF0g1uxIuVIPjRY&s=CisQz6FMFF7GWZZzFhY1ixFWTyNbkhl7PoOs8uFcrH8&e=.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://urldefense.proofpoint.com/v2/url?u=http-3A__amzn.to_2dEadiD&d=DwICAg&c=Iej4I5bEYPmgv5l2sS6i8A&r=XeGBz1fvL6mzoxSW9-Fyt7Ajo0tG_mOKUz5KbIaikfo&m=4H9Y7Rsn3QvbyJRDTf0a_P-oO8b_zF0g1uxIuVIPjRY&s=vG714-fGlNxQ7tLvOMwu4xiKbLvtntKWPBWQSSKfbY8&e=
As an Amazon Associate we earn from qualifying purchases.