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



Hello,
If I understand what you want, It's not possible to add a key with the
second or third file.
Try with OPNQRYF.   All the KEYFLD are in the first file and the C31DDV and
C31SV1 are in the second file.
&QRYSLT is for select the records.

       CHGVAR     VAR(&QRYSLT) +
          VALUE('(C31SCR *EQ "' *CAT &SOC *CAT '" *AND C31CTA *EQ "O" +
                   *AND C31STS *EQ  "C" +
                   *AND C31VER *EQ  "                              ") +
             *OR (C31SCR *EQ "' *CAT &SOC *CAT '" *AND C31CTA *EQ "O" +
                   *AND C31STS *EQ  "B" +
                   *AND C31VER *EQ  "                              ") +
             *OR (C31SCR *EQ "' *CAT &SOC *CAT '" *AND C31CTA *EQ "O" +
                   *AND C31STS *EQ  "F" +
                   *AND C31VER *EQ  "                              ") +
             *OR (C31SCR *EQ "' *CAT &SOC *CAT '" *AND C31CTA *EQ "O" +
                   *AND C31STS *EQ  "C" +
                   *AND C31VER *EQ  "DATAQ                         ") +
             *OR (C31SCR *EQ "' *CAT &SOC *CAT '" *AND C31CTA *EQ "O" +
                   *AND C31STS *EQ  "B" +
                   *AND C31VER *EQ  "DATAQ                         ")')

             OPNQRYF      FILE((*LIBL/GCO31P01) (*LIBL/GCO31P02)) +
                          FORMAT(*LIBL/GCO31J01)                  +
                          QRYSLT(&QRYSLT)                         +
                          KEYFLD((C31SCR *ASCEND)  +
                                 (C31CTA *ASCEND)  +
                                 (C31SEL *DESCEND) +
                                 (C31PRT *DESCEND) +
                                 (C31COI *DESCEND) +
                                 (C31DDV *ASCEND)  +
                                 (C31SV1 *DESCEND) +
                                 (C31MAN *ASCEND)  +
                                 (C31MMS *ASCEND)  +
                                 (C31CDE *ASCEND)) +
                          JFLD((GCO31P01/C31MAN GCO31P02/C31MAN *EQ)  +
                               (GCO31P01/C31MMS GCO31P02/C31MMS *EQ)  +
                               (GCO31P01/C31CDE GCO31P02/C31CDE *EQ)) +
                          MAPFLD((C31ENR 'GCO31P01/C31ENR') +
                                 (C31MAN 'GCO31P01/C31MAN') +
                                 (C31MMS 'GCO31P01/C31MMS') +
                                 (C31CDE 'GCO31P01/C31CDE') +
                                 (ENRC31 'GCO31P02/C31ENR') +
                                 (MANC31 'GCO31P02/C31MAN') +
                                 (MMSC31 'GCO31P02/C31MMS') +
                                 (CDEC31 'GCO31P02/C31CDE'))

Cordialement.

Yannick.Jacqueline
Service Informatique
Tél : 02-31-66-46-69
E-Mail : yjacqueline@xxxxxxxxxxxxxx
Visitez notre site Web à : http://www.guydegrenne.fr/



                                                                                
                                         
                    WyvernGod@xxxxxxx                                           
                                         
                    Envoyé par :               Pour :  rpg400-l@xxxxxxxxxxxx    
                                         
                    rpg400-l-bounces@xx        cc :                             
                                         
                    drange.com                 Objet :      Re: keys on 2 
joined files?                                  
                                                                                
                                         
                                                                                
                                         
                    18/03/03 13:52                                              
                                         
                    Veuillez répondre à                                         
                                         
                    RPG programming on                                          
                                         
                    the AS400 / iSeries                                         
                                         
                                                                                
                                         
                                                                                
                                         




well the joining of the files by policy number and client number to join
all
three work fine but when i try and set up the keyts it gives me the error
key
not on first joined file.. or somthing real close... im wondering if i
maybe
switch my second join statment so that it will be first in that join but it

probably wont work.. this is what i have, mcco,mcempl, and mccntr are from
cascntrm and cmname is from cmsclntm
************************************************************************
A*                                     JDFTVAL
A*                                     DYNSLT
A*
A          R LSEC132C2                 JFILE(CASCNTRM          -
A                                            CMSUSREL CMSCLNTM)
A*
A          J                           JOIN(CASCNTRM CMSUSREL)
A                                      JFLD(MCCO   CRCO  )
A                                      JFLD(MCCNTR CRCTL1)
A          J                           JOIN(CMSUSREL CMSCLNTM)
A                                      JFLD(CRCLTN CMCLTN)
A          K MCCO
A          K MCEMPL
A          K CMNAME
A          K MCCNTR
A          S MCCSTA                    COMP(EQ 'I')
A            MCEMPL                    COMP(NE '       ')
A          S MCCSTA                    COMP(EQ 'P')
A            MCEMPL                    COMP(NE '       ')
A          S MCCSTA                    COMP(EQ 'E')
A            MCEMPL                    COMP(NE '       ')
A          S MCCSTA                    COMP(EQ 'R')
A            MCEMPL                    COMP(NE '       ')
**********************************************************

and its because of the cmname that is throwing the error, and yes my fields

are listed in the file.. just not here bacause there is about 50 or so
total..  but as one other noted i could extract the needed recored to temp
db
but im afraid of the posable time to run that.. this has over 35,000
records..but only that amount is used when someone wants all of the
employee
locations listed.. other wise its just one that at most would be 500
records...  Any one know the posable processing time on transfering 500
records would be in RPG? I would use a cl comand for that but i do know
know
how to get specific info.. unless i use a query.. anyway.. its not a big
project.. just one of those anoying requests you get right in the middle of
a
huge project you are already working on and for some reason it develops
into
some great need by the "top brass" can any one tell im ranting now? sorry
sorry.. thanx for all your help.. have any sudjestions just drop me a line
hopefully i'll get this out of the way and if i do so i dont waist your
time
i'll let you know...

Thanx,
Chris
_______________________________________________
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.







As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.