Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Join Logicals 1

Status
Not open for further replies.

Skittle

ISP
Sep 10, 2002
1,528
US
I'd like to set up a join logical. It's the first time I've done one since the last century and it's different to how I remembered it.

If you create a logical that joins two files together, I thought you could key it on fields from both files. The compiler is complaining that I can only use fields from the first file.

Is there a way for me to do this or do I have to resort to an open query file?

Dazed and confused
 
Skittle,

I thought you could too. However I've looked high and low and the only thing I found was you can do it by substringing a field from one into the join file. The example is below.

Code:
*************** Beginning of data ***********************************
     A          R TXP004@                   JFILE(SVTXP004 SVTXP007) 
     A          J                           JOIN(SVTXP004 SVTXP007)  
     A                                      JFLD(ADMKEY AGTSEPKEY)   
     A            ADMKEY    R               JREF(SVTXP004)           
     A            AGTTAXID           I      SST(ADMKEY 18 11)        
     A            AGTNAME   R               JREF(SVTXP007)           
     A            AGENTNUMBRR               JREF(SVTXP007)           
     A            PRTSEPFLG R               JREF(SVTXP007)           
     A            BEGINDAT                                           
     A            ENDINGDAT                                          
     A            ENDINGBAL                                          
     A          K AGTTAXID                                           
     A          K ENDINGDAT                 DESCEND                  
     A          K ADMKEY                    DESCEND                  
     A          S PRTSEPFLG                 COMP(EQ 'Y')             
****************** End of data **************************************

HTH,
MdnghtPgmr
 
Thats pretty clever.

thanks for your help.


Dazed and confused
 
That is correct. Key fields must exist in primary join file. A possible option might be to access with SQL.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top