15 pts.
 Keying on a Joined file
I have a joined file that I want to sort, I am using a field from the primary file so it is compiling.  But the data is not getting sorted, what am I doing wrong?*******************************************************

JDFTVAL 

R MSCJ01 JFILE(MSCMP100 CSIU200)

J JOIN(1 2)

JFLD(CUSNO CSICUS)

CUSNO

CNAME

CSIUSR

CSICUS

K CSICUS



Software/Hardware used:
AS/400
ASKED: January 27, 2010  5:33 PM
UPDATED: January 28, 2010  1:13 AM

Answer Wiki:
Some keywords like DB/2 and AS/400 would help us find your request. As you said, with the key from the primary file the join will compile. But it doesn't sort the data-it makes a keyed index into the data. The join would generally be used as a keyed input file to RPG or Cobol. In RPG be sure to include the K on the F spec. This type of join isn't very good for SQL but if you are trying to do something with SQL you will have to use an ORDER BY clause. Please tell us how you were determining that the data wasn't in the order you needed. Phil
Last Wiki Answer Submitted:  January 28, 2010  1:13 am  by  philpl1jb   44,150 pts.
All Answer Wiki Contributors:  philpl1jb   44,150 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Before anyone notices, in the above code “CSIUSER” is from the secondary file. I was doing some testing but did not get it changed back to “CUSNO”. so the code is correct. just not in the example above.

 15 pts.