Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Does using Joinkeys always change Order of the Final File ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Puspojit

New User


Joined: 10 Mar 2008
Posts: 34
Location: Pune

PostPosted: Wed Nov 07, 2012 9:39 pm    Post subject: Does using Joinkeys always change Order of the Final File ?
Reply with quote

I have , say 100 accounts on File A and 20 accounts on File B .
I need FileC with those accounts that are present only on File A and missing in File B (80 Accounts).

A Join unpaired on File A only will give me the desired result after I match on accounts .

However I see that the Accounts in File C are not in the same order as it was in File A (after removing the 20 accounts of file B) .

Is there a way I can ensure that records from File A are written to output FileC "as is" without any change of order ?
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Wed Nov 07, 2012 10:03 pm    Post subject: Reply to: Does using Joinkeys always change Order of the Fin
Reply with quote

To do the JOINKEYS correctly the file must be in order based on the key(s) for matching. By default, JOINKEYS (both of them) sort the data with OPTION EQUALS.

If you want the original order, you can add a sequence number to the record, and in the main-task following the JOINKEYS sort on the sequence number.
Back to top
View user's profile Send private message
Puspojit

New User


Joined: 10 Mar 2008
Posts: 34
Location: Pune

PostPosted: Wed Nov 07, 2012 10:18 pm    Post subject: Reply to: Does using Joinkeys always change Order of the Fin
Reply with quote

Thanks Bill....I will add a sequence number at the end of the original file and use that to restore the order of the file after the Join .
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Wed Nov 07, 2012 11:10 pm    Post subject:
Reply with quote

Or RESORT the file in the original desired order (Account Number) without having to extend file length temporarily. It really depends on how much benefit you are getting by sorting on sequence number vs. account number. If size of the account number is less than that of sequence number that you need to add, it may be beneficial to just sort on the account number in stead.

Thanks,
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Wed Nov 07, 2012 11:15 pm    Post subject:
Reply with quote

sqlcode1 wrote:
Or RESORT the file in the original desired order (Account Number) without having to extend file length temporarily. It really depends on how much benefit you are getting by sorting on sequence number vs. account number. If size of the account number is less than that of sequence number that you need to add, it may be beneficial to just sort on the account number in stead.

But is not the TS's objection that the data are originally not sorted on account number, and that heesh doesn't want them to be?
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Wed Nov 07, 2012 11:42 pm    Post subject:
Reply with quote

Yes, I used account number for the example because that is the only field provided here. What I was trying to say is "if" the size of the "original order/desired order" is less than that of sequence number, OP may benefit from resorting in the "original order/desired order".

Thanks,
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Thu Nov 08, 2012 12:02 am    Post subject: Reply to: Does using Joinkeys always change Order of the Fin
Reply with quote

However, it would depend on whether or not the original keys were unique.

If not unique, it then depends on whether NOEQUALS was used.

If not unique and NOEQUALS was used then the only way to get to the original order, other than by fluke, is with the sequence number.

If EQUALS was used then a SORT with EQUALS on the original key should get back to the same order (with the JOINKEYS using EQUALS). The need for EQUALS adjusts the comparison for estimated resource usage beyond a simple one of length.

If the keys are unique, then certainly a SORT with NOEQUALS will also guarantee the original order.

After all this, I hope that it is a testing file rather than a production file that only has 80 records.
Back to top
View user's profile Send private message
Puspojit

New User


Joined: 10 Mar 2008
Posts: 34
Location: Pune

PostPosted: Thu Nov 08, 2012 12:14 am    Post subject:
Reply with quote

I would need to add sequence number since the accounts are stored in the file in the "order" that they were created in the Firm and I dont want to lose that order by sorting .

Again, the layout of this file is not the best, that I can use any other pointers within the file to maintain that chronological order, apart from creation of a sequencer number .

Thanks for all your suggestions ! It really helps !

regards
Puspojit
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us