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
 

 

How to make sure the order of UNLOADed data?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: How to make sure the order of UNLOADed data?
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: 1826
Location: UK

PostPosted: Fri Dec 20, 2013 3:23 pm    Post subject:
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    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Fri Dec 20, 2013 5:42 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Paasing symbolic parameter to instrea... Robert Sample JCL & VSAM 2 Thu Jul 27, 2017 1:22 pm
No new posts Passing data from REXX to C programme... chong.zhou CLIST & REXX 3 Wed Jul 26, 2017 9:11 pm
No new posts copying data without knowing location arunsoods DFSORT/ICETOOL 11 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm


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