COMPANY DETAILS - 10:30 MONDAY, DECEMBER 13, 2010 (Page - 1)
EMP = 001
DES SAL
---- ----
SE 50
TL 60
PM 70
-----
EMP 180
COMPANY DETAILS - 10:30 MONDAY, DECEMBER 13, 2010 (Page - 2)
EMP = 002
DES SAL
---- ----
SE 50
PM 30
------
EMP 80
COMPANY DETAILS - 10:30 MONDAY, DECEMBER 13, 2010 (Page - 3)
EMP = 003
DES SAL
---- ----
DM 40
PM 90
-----
EMP 130
=====
TOTAL 390
Output Explanation:
The input file should be grouped based on the first field i.e. EMP 001,002...etc, and should written to the output report based on groups as EMP=001,EMP=002, EMP=003. Every group should have header, date and time(format as shown above) and Page no in incrementing order. In every group the sum should be done on SAL field which should have EMP as field name for it(as this has been used for grouping e.g EMP 180 for group 1st). Finally all the sum of groups should be totalled under TOTAL field.
Please help me in solving the above query.
Thanks in advance.
In the above requirement there is a small change wherein my input and output is as shown below.
input:
1st part
001 SE 50 AA P
001 TL 60 AA P
001 PM 70 AA Q
002 SE 50 BB R
2nd part
001 SE 50 AA P
001 TL 60 AA P
001 PM 70 AA Q
002 SE 50 BB R
002 SE 50 BB R
output:
The output below has different criterias
1.) when only system is changed then only the total will be printed as shown in 1st part below
2.) when last rec i.e for emp = 002 has more than one records then the output will be as shown in 2nd part.
A.) 1ST PART
COMPANY DETAILS - 10:30 MONDAY, DECEMBER 13, 2010 (Page - 1)
EMP = 001 SYSTEM = P
DES SAL CODE SYSTEM
---- ---- ------- --------
SE 50 AA P
TL 60 AA P
-----
EMP 110
COMPANY DETAILS - 10:30 MONDAY, DECEMBER 13, 2010 (Page - 1)
EMP = 001 SYSTEM = Q
DES SAL CODE SYSTEM
---- ---- ------- --------
PM 70 AA Q
-----
EMP 70
SYSTEM 180
EMP 180
COMPANY DETAILS - 10:30 MONDAY, DECEMBER 13, 2010 (Page - 2)
EMP = 002
DES SAL
---- ----
SE 50
PM 30
------
EMP 80