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



Thank you, changing the file name for the record name the program works.
I miss that in the manual.

Raul.

Werner Noll wrote:

Raul,

one error in your test program is, that you did the CHAIN with the file
name. When using a %KDS you must always chain with the record format (in
your case SALD1).

Regards,
Werner Noll

-----Ursprüngliche Nachricht-----
Von: Raul A Jager [mailto:raul@abc.com.py]
Gesendet: Montag, 16. Dezember 2002 21:21
An: rpg400-l@midrange.com
Betreff: KDS bif


I'm trying for the first time the KDS bif, and I get a misleading error
message (or at least missleading for me)
The message says thatt the number of key fields in the DS are more than
the file, but both are 2, or at least that is what I belive.


Here are the parts of the program that I think relevant, the file
definition, some calcs, and the fields found by the compiler.  Some
messages are in spanish, I just copied the compiler output

     5 Fsaldo     IF   E           K DISK    extfile('ED/SALDO')


*---------------------------------------------------------------------------
-----------------*
        *                               Nombre en RPG    Nombre
externo                              *
        * Nombre de archivo  . . . . :  SALDO
ED/SALDO                                    *
        * Formato(s) de registro . . :  SALD1
SALD1                                       *

*---------------------------------------------------------------------------
-----------------*

    19 d ksal            ds                  likerec(sald1: *key)


    28=ISALD1

*---------------------------------------------------------------------------
-----------------*

        * Formato de registro RPG  . :  SALD1
        * Formato externo  . . . . . :  SALD1 : ED/SALDO

*---------------------------------------------------------------------------
-----------------*

    29=I                             P    1    4
0NCTA                            N° Cuenta
    30=I                             P    5    7
0MESAL                           Mes del saldo
    31=I                             P    8   14
0SGUA                            Saldo
    32=I                             P   15   21
2SDOL                            Saldo Dólar
    33=I                             P   22   27
2SKAN                            Cantidad
    34=I                             P   28   34
2AJDOL                           Ajuste Dólar


    56      clear
sgua;

    57      ksal.mesal = 100 * anio +
10001;
    58      ksal.ncta =
ncta;

    59      chain %kds(ksal) saldo;            /// <<<<<<  KDS has 2
fields, so does "saldo"
    60      salant =
sgua;

    61      salmes(1) = salmes(1) +
sgua;
    62      for mes = 2 to
12;
    63        ksal.mesal = ( 100 * anio + 10000) +
mes;
    64        chain %kds(ksal :2) saldo;       ///  <<<<<<<  using the
second parameter didn't help
    65        if
%found(saldo);

    66          salmes(mes) = salmes(mes) - salant +
sgua;
    67          salant =
sgua;

    68
endif;

    69
endfor;

__________________________________________________________________

       * * * * *   F I N   D E   F U E N T E   * * * * *
 5722WDS V5R2M0  020719 RN        IBM ILE RPG
A/ACC52                  ABC        16/12/02 16:54:46        Pág.      5
       M e n s a j e s   d e   D i a g n ó s t i c o   A d i c i o n a
l e s
 ID msje Sv Número Sec.    Texto mensaje
*RNF7066 00      4 000400  Formato de registro CUE1 no utilizado para
entrada ni
                           salida.
*RNF7066 00      5 000500  Formato de registro SALD1 no utilizado para
entrada ni
                           salida.
*RNF7071 30     59 004700  El número de KFLD en KLIST es mayor que el
número de campos
                           de clave en el archivo.
*RNF7071 30     64 005200  El número de KFLD en KLIST es mayor que el
número de campos
                           de clave en el archivo.

 5722WDS V5R2M0  020719 RN        IBM ILE RPG
A/ACC52                  ABC        16/12/02 16:54:46        Pág.      6
             I n f o r m a c i ó n   d e   C a m p o s   d e   C l a v e
         Archivo        Interno     Externo
           Registro     nomb campo  nomb campo  Atributos
      1  CUENTA
           CUE1
                        NCUENT                  CHAR        4
      2  SALDO
           SALD1
                        NCTA                    PACK      7,0 SIGNED
                        MESAL                   PACK      5,0 SIGNED
 * *  F I N   D E   I N F O R M A C I O N   C A M P O S   D E   C L A V
E   * *

         KSAL              DS(7)                  19D     57M
58M     59
                                                  63M     64
           MESAL           P(5,0)                 19D     57      63
           NCTA            P(7,0)                 19D     58











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

_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
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.