Output will be sorted on basis of
1. JOBNAME (If we have two enteries for JOBNAME, then it will delete one entry from that)
2. The entry which is going to be deleted will be on basis of field
from 19-20, that row will be retained which will have entry higher )
Here the last row has a prior date(2010.242) and the time is 11:24 PM . Now if you sort these 3 records in descending order of the time , you would get the prior date record which is not what I think you want.
So you need to consider the date also. Considering the above conditions here is a DFSORT/ICETOOL job which will give you the desired results.
You don't have to reformat the time column , you can use UFF format to sort it
You don't need EQUALS with Select operator , as Equals is the default for SELECT operator.
I am not sure as to why you decided to sort on the jobname descending.
You don't need EQUALS with Select operator , as Equals is the default for SELECT operator.
Understand EQUALS is default for select but shouldn't I preserve original order of the job in case of duplicates for the job name? For example, If input data is as shown below, using EQUALS, I am trying to select first record with job id J0086475 irrespective of the date field. I think you have this already covered in your post but since OP didn't mention anything regarding date part (2010.243,2010.242...),I assumed he would want to keep first record irrespective of date. Isn't it true that SELECT gets output of CNTL1 and then applies all the default options?
I am not sure as to why you decided to sort on the jobname descending.
This was because OP said, he wanted output sorted on Job (didn't mention ASC or DESC) and his expected output,though in original order, shows jobid descending. Had he wanted ASC his expected output would be different.
Quote:
Output will be sorted on basis of
1. JOBNAME (If we have two enteries for JOBNAME, then it will delete one entry from that)
OUTPUT from the job you provided is as below, which shows G123451K as the first record but in OP's expected output shows G123451K as the last one. Please correct me If I am wrong.
I won't be surprised if he comes back and says he doesn't really care for Job name order.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Quote:
Understand EQUALS is default for select but shouldn't I preserve original order of the job in case of duplicates for the job name?
sqlcode1,
When you use SELECT operator, it passes EQUALS as one of the parm for SORTING. Look at the ICE146I message and read all the parameters that are passed. So you coding EQUALS on CTL1CNTL is not necessary.
Quote:
Isn't it true that SELECT gets output of CNTL1 and then applies all the default options?