Keying on a Joined file

15 pts.
Tags:
Key on Join 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

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Kjhcode
    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 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following