Hi, Actually I’m trying to replace the permanent dataset in my code with the data from DB2. Also i'm using SQL pass through to fetch the data from DB2 and creating a work table. In this,I’m facing one issue while joining an unsorted dataset with a sorted dataset. Issue : The observation order getting differ in the outputs while joining same set of tables from different locations. i.e. While joining unsorted dataset from a permanent library with sorted dataset and joining unsorted dataset from work library with sorted dataset, the o/ps are different in terms of observation order. And how this observation order affecting is , I'm going to fetch the last observation of each primary key from the above result. For eg.: Let us take two tables "EMP" and "DET". Here EMP is sorted table based on Id and DET is unsorted table. The join used herer is LEFT Join (EMP left join DET). EMP Id name 101 Sam DET Id Date Amt 101 11/12/2014 200 101 11/12/2014 100 The DET in Permanent library and Work Library has the same observation order. Output of join: (DET from permanent library). Id Date Name Amt 101 11/12/2014 Sam 200 101 11/12/2014 Sam 100 Output of join: (DET from work library) Id Date Name Amt 101 11/12/2014 Sam 100 101 11/12/2014 Sam 200 In the above o/ps the observation order is different for Amt variable. Beacuse of this I'm getting different o/p in my next step where I'm using last.Id to fetch the last observation from each ID. Note: If I convert the permament dataset to Work dataset then the observation order is matching as like the dataset from DB2. But I want to match the order that I'm getting when using permanent dataset. Please help me to resolve this issue. Thanks in advance! -Ramesh
... View more