SUM Fields between two lines



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

SUM Fields between two lines

Postby zvawn » Fri Nov 17, 2017 10:22 pm

Hi,

I am trying to sum the number of occurrences between two lines in a file. For example:


START                  00000
  FIELD1               00001
  FIELD2               00001
END                    0000X
 


With the above input I would like to return something like:

START                  00002
 


I am lost on how to do this with sort. Any help would be appreciated.
zvawn
 
Posts: 1
Joined: Fri Nov 17, 2017 10:15 pm
Has thanked: 0 time
Been thanked: 0 time

Re: SUM Fields between two lines

 

Re: SUM Fields between two lines

Postby enrico-sorichetti » Fri Nov 17, 2017 11:34 pm

cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2644
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post