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



Dear sir,

How do i define the variables :

NameList and i ?


Thank You !

Luis Martins






Please respond to RPG programming on the AS400 / iSeries
       <rpg400-l@xxxxxxxxxxxx>

Sent by:    rpg400-l-bounces@xxxxxxxxxxxx


To:    rpg400-l@xxxxxxxxxxxx
cc:
Subject:    Re: Why am I getting this message? - RNF5343


Luis Martins wrote:
>
>
> Dear Sir,
>
> At the moment of CRTRPGMOD of the next RPG ILE IV program, Why i receive
> the message RNF5343 ?
>
>
> 1 - Source of the Database File
>
>
>
>             A     R   BCKDES
>                 BIB           10A         TEXT('Biblioteca')
>                 DESC          50A         TEXT('Descrição')
>
> The file have some records that have the names of library's to pass to
the parameter OMITLIB of
> th command SAVCHGOBJ.
>
> 2 - Source of the Program
>
>
> FBCKDESF   IT   F   10        DISK
>
> DTapeIFS          S             25
> DSTRING           S            256
> DLENGHT           S             15  5 INZ(256)
> DTape             S             10
> DArray            S             10A   DIM(300) FROMFILE(BCKDESF)
>
> C     *ENTRY        PLIST
> C                   PARM                    Tape
>
> C                   EVAL      STRING = 'SAVCHGOBJ OBJ(*ALL) LIB(*ALLUSR)
+
> C                             DEV('+Tape+') OBJJRN(*YES) REFDATE(*SAVLIB)
+
> C                             ENDOPT(*LEAVE) TGTRLS(*CURRENT)
+
> C                             SAVACT(*SYSDFN) ACCPTH(*YES)
+
> C                             SAVFDTA(*YES) OMITLIB('+Array+')
+
> C                             OUTPUT(*PRINT) INFTYPE(*OBJ)'
>
> C                   EXSR      COMANDO
>
>
> C                   EXSR      COMANDO
>
> C                   RETURN
>
> C     COMANDO       BEGSR
> C
> C                   CALL      'QCMDEXC'
> C                   PARM                    STRING
> C                   PARM                    LENGHT
> C
> C                   ENDSR
>
>
> Thank You !

The message points to the following line, right?

C              SAVFDTA(*YES) OMITLIB('+Array+')    +

You've coded an array within the expression, but you did not code an
array index. Leaving off the array index is allowed only when the
target of the assignment is also an unindexed array, in which case
the operation is performed element by element through the arrays.

If you want to include all the names in that array in the command
string, you need to code something like:

/free
    namelist = '';
    for i = 1 to %elem(array);
       // append library name to list
       namelist += %trim(array(i)) + ' ';
    endfor;
    namelist = %trimr(namelist);
/end-free

where NAMELIST is defined as a varying length character variable.
Then, code NAMELIST within that command expression instead of ARRAY.

Cheers! Hans


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



__________________________________________________

Esta mensagem e quaisquer ficheiros anexos são confidenciais, destinando-se
ao uso exclusivo da pessoa e/ou entidade a que se dirigem. Caso não se lhe
destine, ou não seja responsável pelo seu encaminhamento ao destinatário,
informamos que a recebeu por engano. Qualquer utilização, distribuição,
reencaminhamento ou outra forma de revelação a terceiros, impressão ou
cópia são expressamente proibidos; sendo que agradecemos que destrua a
mensagem de imediato, informando o seu emissor ou o Finibanco do sucedido.
Não obstante o Finibanco utilizar software anti-vírus como precaução, não é
possível garantir que a presente mensagem e eventuais ficheiros anexos não
contêm vírus, pelo que não consideramos da responsabilidade desta
instituição eventuais consequências inerentes. Alerta-se, ainda, que as
mensagens transmitidas por este meio podem ser interceptadas, corrompidas,
perdidas, destruídas ou entregues com atraso ao destinatário.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.