In that file 1 thru 6 position is the identifier field and from 96 thru 103 is the service year field. The file is sorted on identifier ascending and service years descending.
The requirement is to find out the difference between the service years for the first & last record in a group of identifiers.
eq:
Consider the below sample of recs
IDENTIFIER
|CHR 6
|(1:6)
|2
*********** TOP OF DA
XXXX02
XXXX02
XXXX07
XXXX07
XXXX10
XXXX10
XXXX10
XXXX10
XXXX11
XXXX11
XXXX11
XXXX11
XXXX13
XXXX13
U20014
U20014
U20016
|SERVICE YEAR
|PAC 15
|(96:103)
|12
* TOP OF DATA *****
29.00
19.00
12.00
7.00
22.00
9.00
8.00
6.00
54.00
25.00
15.00
12.00
21.00
14.00
19.00
9.00
20.00
For the identifier XXXX10:
The difference should be 22 - 6 = 16
There may be n number of records in a group.
Is there any way to do this using DFsort or ICETOOL?
#1.Yes this is a possibility. If there is only one record then the service years of that records should come in the O/P. In the case of U20016 the Service years should be 20.
#2. We use DFSORT V1R12
#3. I am not sure about code tag facility. can you explain bit more on that please?
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
Hello,
Quote:
#3. I am not sure about code tag facility. can you explain bit more on that please?
Notice that your question has been "Quoted". Next to the Quote Tag is the Code Tag. Highlight data you want the alignment preserved and click Code. Then click Preview to see your post as it will appear to the forum. Then Submit when it looks as you want.
Joined: 15 Feb 2005 Posts: 7130 Location: San Jose, CA
Here's a better way to do it with DFSORT using only one pass and no sorting. I assumed the Service Year was actually a 96,8,PD input field based on the description of PAC 15 (96:103).