IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to make sure the order of UNLOADed data?


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Fri Dec 20, 2013 10:16 am
Reply with quote

I'm using DB2 utility to unload data from table, and the generated sequenced file will be later be used by DFsort.

I'm not sure whether the UNLOADed data will keep the same ascending oreder as specified by PK when the table was defined.

If the unloaded data is already sorted by PK, there will be no need for another SORT.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Fri Dec 20, 2013 3:23 pm
Reply with quote

So what did you see when you unloaded a similar, test, table and looked at the unloaded data?
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Fri Dec 20, 2013 5:11 pm
Reply with quote

I can see data is basically the same order as the PK.
but from job log, I cannot see SORT processing during the unload.
I cannot find such description from DB2 Utility reference either, so, I'm not sure about my suspect.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Dec 20, 2013 5:42 pm
Reply with quote

if there is no sort process during the unload,
and the rows are in PK order,
then the table has been recently reorgd and no inserts have been made
to disrupt the 'order'.

unless you request a sort (ORDER BY) during any db2 selection process,
the order of the selected rows is unpredictable.
it would be an error to assume anything else.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 4
No new posts Store the data for fixed length COBOL Programming 1
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top