Help required for a sort step.
Posted: Tue Jun 06, 2006 2:16 pm
Hi ,
I have a small query regarding usage of SORT card utility.
Situation:
There say a table(A) with the following data
Table A
arnd 15 records for same column a1 value 'james'.
Similarly, i may have a no: of records with same value in column a1.
Now, the pbm is that
1) I need to check for the total no: of records for a given column 'a1', if the count is greater than 10 (say it is 'y'),then i need to merge the first (y-9) records as a single record, and then the rest will follow sequentially.
Let me explain with an example.
say i have 15 records with a1 value as 'James', then i need to merge first (15-9) records into a single record, with the date field(adate) pointing to the latest date of the six records. That means , at any given point of time
the record count for each unique column a1 value should not be more than 10 records.
And I have to incorporate this logic in the JCL Only .. meaning no COBOL code change.
Thanks,
Ambili.
I have a small query regarding usage of SORT card utility.
Situation:
There say a table(A) with the following data
Table A
Code: Select all
a1 a4 amts1 amts2 amts3 adate
james 30 40 40 40 24-jan-2005
james 30 13 23 23 25-jan-2005
james 30 13 23 23 26-jan-2005
james 30 13 23 23 27-jan-2005
james 30 13 23 23 28-jan-2005
...........................................
Similarly, i may have a no: of records with same value in column a1.
Now, the pbm is that
1) I need to check for the total no: of records for a given column 'a1', if the count is greater than 10 (say it is 'y'),then i need to merge the first (y-9) records as a single record, and then the rest will follow sequentially.
Let me explain with an example.
say i have 15 records with a1 value as 'James', then i need to merge first (15-9) records into a single record, with the date field(adate) pointing to the latest date of the six records. That means , at any given point of time
the record count for each unique column a1 value should not be more than 10 records.
And I have to incorporate this logic in the JCL Only .. meaning no COBOL code change.
Thanks,
Ambili.