Michael Jacobsen | 21 Apr 18:43 2005

RE: %KDS Compile Problem

I went ahead and wrote a very simplified example when I receive this 
error.  Here is the full code of the RPG:

FTestFile  IF   E           K Disk 

D TestDS        E DS                  ExtName(TestFile:*Key) 

 /Free 

  SetLL  %KDS(TestDS:3)  TestFile; 

  *InLR = *On; 

 /End-Free 

Here is TestFile:

A          R TESTREC 
A            FIELDA         5S 2 
A            FIELDB        10A 
A            FIELDC        10A 
A 
A          K FIELDA 
A          K FIELDB 
A          K FIELDC 

The above will compile fine on one system, but not the other (I even 
compiled it on both to be sure of this).  The error I receive is the same 
as I stated earlier.  The file I am using was just created and there are 
no other copies on the system.
(Continue reading)

Fisher, Don | 21 Apr 18:50 2005

RE: %KDS Compile Problem

Your first instinct about it being a PTF issue was probably right.  I seem
to remember some discussion about %KDS needing a PTF on this or the other
list. 

Donald R. Fisher, III
Project Manager
Roomstore Furniture Company
(804) 784-7600 extension 2124
DFisher@...

<clip>
I went ahead and wrote a very simplified example when I receive this error.
Here is the full code of the RPG:

FTestFile  IF   E           K Disk 

D TestDS        E DS                  ExtName(TestFile:*Key) 

 /Free 

  SetLL  %KDS(TestDS:3)  TestFile; 

  *InLR = *On; 

 /End-Free 
<clip>
--

-- 
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@...
To subscribe, unsubscribe, or change list options,
(Continue reading)

iSeries / as400 | 21 Apr 18:11 2005
Picon

Re: %KDS Compile Problem

... what does the compile listing say for the key info on the file
... "K e y   F i e l d   I n f o r m a t i o n "

----- Original Message -----
From: "Michael Jacobsen" <MJacobsen@...>
To: "RPG programming on the AS400 / iSeries" <rpg400-l@...>
Sent: Thursday, April 21, 2005 10:33 AM
Subject: RE: %KDS Compile Problem

> Donald,
>
> Thanks, but I have checked both of those.  The key fields are correct and
> there are no other files that it could be using.  Any other ideas?  It
> really seems to me that it is a compiler problem.
>
> I even wrote a different program using different files and I still
> received the %KDS error.
>
> Mike
>
>
>
> > You've probably checked this already, but I'll mention it anyway.  Did
> you
> > ensure the file over which the program is being compiled has the correct
> key
> > fields?  Check the library list being used for the compilation to
> determine
> > if another version of that file exists.
> >
(Continue reading)

Rich Dotson | 21 Apr 18:54 2005
Picon

RE: %KDS Compile Problem

Did you run an OPNQRYF on this file and not close the File Id?      I had 
this same error once and I found that there was a CL on the system that 
performed an OPNQRYF on this file.   It selected different fields as keys 
then what were on the PF.   The CL did not perform a CLOF so when I ran the 
CL the file stayed open.   The compiler was picking up the keys created by 
the OPNQRYF and not what were on the PF causing a mismatch.

----Original Message Follows----
From: Michael Jacobsen <MJacobsen@...>
Reply-To: RPG programming on the AS400 / iSeries <rpg400-l@...>
To: "'RPG programming on the AS400 / iSeries'" <rpg400-l@...>
Subject: %KDS Compile Problem
Date: Thu, 21 Apr 2005 10:16:20 -0500

I am having a compilation problem.  I have code that I know for a fact
will compile on a different system, but I am unable to compile it on our
production system.  The error I am getting is this:

*RNF7071 30      1 Number of KFLDs in KLIST is greater than number of key
fields in file.

Is there a PTF that addresses this?  I am on V5R2.  I have never worked
with PTF's before, but I am trying to help find out if that is part of the
problem.

Thanks! (And I apologize if this has been asked before, but I couldn't
find any answers from IBM's site, or in the archives.)

Mike
--
(Continue reading)

Haas, Matt | 21 Apr 18:56 2005
Picon

RE: LDAP Query

There are working examples in the archives that show how to do this. Reading from LDAP isn't difficult by
writing (which is a modify query) is but there are examples of both. If I remember how it works, a successful
connect returns a pointer that you pass into the other API calls. If the pointer is null, the connect didn't
work and you need to check errno to find out why (the samples likely have that in them as well).

Matt

-----Original Message-----
From: rpg400-l-bounces@...
[mailto:rpg400-l-bounces@...]On Behalf Of Smith, Mike
Sent: Thursday, April 21, 2005 12:40 PM
To: rpg400-l@...
Subject: LDAP Query

Rob Said
Honestly I've only casually glanced at the code so far. Where is the
name of the ldap server?

As I understand it(and I might be totally wrong)  The name of the LDAP
server is the first parm of the LDAP_INIT procedure.  It can be null or
it can be a space seperated list of host to search.  

In original example it is *NULL which means localhost. 
I tried using the IP address in my situation.  I then tried just random
names and all returned a pointer.  

Michael Smith
iSeries.mySeries.

--

-- 
(Continue reading)

Smith, Mike | 21 Apr 18:40 2005

LDAP Query

Rob Said
Honestly I've only casually glanced at the code so far. Where is the
name of the ldap server?

As I understand it(and I might be totally wrong)  The name of the LDAP
server is the first parm of the LDAP_INIT procedure.  It can be null or
it can be a space seperated list of host to search.  

In original example it is *NULL which means localhost. 
I tried using the IP address in my situation.  I then tried just random
names and all returned a pointer.  

Michael Smith
iSeries.mySeries.

--

-- 
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@...
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@...
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

Scott Klement | 21 Apr 19:03 2005

Re: LDAP Query

Hello Mike,

> In original example it is *NULL which means localhost.
> I tried using the IP address in my situation.  I then tried just random
> names and all returned a pointer.

The ldap_init() API just creates a new copy of a data structure in the 
memory of the LDAP service program. It doesn't actually attempt to make 
the connection at the point where you call the API.

AFIAK, ldap_init() should always succeed unless you're missing a 
prerequisite licpgm or unless your system is completely out of memory 
(though, in that case, you'd be having MUCH bigger problems! heh)

--

-- 
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@...
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@...
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

Smith, Mike | 21 Apr 19:13 2005

RE: LDAP Query

That's the way I understand it also Matt, however, my problem was even
passing bad parms, I was still getting a pointer.  I was never getting
the Null.  I have managed to get past the init now(well at least I'm
getting a new error on the Bind(can't contact LDAP Server)  Before it
was indicating ('invalid credentials)

Michael Smith
iSeries.mySeries.

-----Original Message-----
From: Haas, Matt [mailto:Matt.Haas@...] 
Sent: Thursday, April 21, 2005 12:57 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: LDAP Query

There are working examples in the archives that show how to do this.
Reading from LDAP isn't difficult by writing (which is a modify query)
is but there are examples of both. If I remember how it works, a
successful connect returns a pointer that you pass into the other API
calls. If the pointer is null, the connect didn't work and you need to
check errno to find out why (the samples likely have that in them as
well).

Matt

-----Original Message-----
From: rpg400-l-bounces@...
[mailto:rpg400-l-bounces@...]On Behalf Of Smith, Mike
Sent: Thursday, April 21, 2005 12:40 PM
To: rpg400-l@...
(Continue reading)

rob | 21 Apr 19:37 2005

Re: LDAP Query

It's starting to sink in now. 
ldap_init just creates the data structure.
You then use the ldap_simple_bind or ldap_simple_bind_s (and not the 
deprecated ldap_bind) and if that hurls then you know that the name is 
horsehocky.

Infocenter link:
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/ic2924/info/apis/dirserv1.htm

Rob Berendt
-- 
Group Dekko Services, LLC
Dept 01.073
PO Box 2000
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com

Scott Klement <rpg400-l@...> 
Sent by: rpg400-l-bounces@...
04/21/2005 12:03 PM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@...>

To
RPG programming on the AS400 / iSeries <rpg400-l@...>
cc

Subject
(Continue reading)

Keith E Smith | 21 Apr 19:41 2005

Re: Array Lookup in ILERPG ?

%lookup is fine for a whole item match.  My docs don't show a way to 
look for a particular string anywhere in the array.  They could be out 
of date.  Assuming you didn't mean whole string match or gt/lt matches 
and you are looking for a needle anywhere in the haystack, you could use 
a pointer ala:

       *!rpgle
      Dmyar             s             80a   dim(50)

      Dmyar_ptr         s               *   inz(%addr(myar))
      Dmyar_string      s           4000a   based(myar_ptr)
. . .
       /free
             pos = %scan("something":myar_string);
             if pos > 0;
                 ar_ix = %int(pos/80);
                 ar_ixpos = %fpt(pos/80);
             endif;
. . .

Would yeild the array element in ar_ix and the position within that 
element in ar_ixpos.

This could be trivially put in a function/procedure, but I'm not sure 
what it would buy you over a loop, unless you were just looking to see 
if it is there ie, myar is a text message and you are just checking to 
see if a particular word is in there anywhere:

if %scan("badword":myar_string);
     exsr abort_send;
(Continue reading)


Gmane