How to WRITE group data in output file by using easytrive

//XXXXIN DD DISP=SHR,DSN=XXXXXXX.XXXX.XXXXX.XXX
//XXXXOUT DD DSN=XXXXXXX.XXXX.XXXXXXXX.XXXXXXXX.XXXX,
// DISP=(NEW,CATLG,DELETE),SPACE=(CYL,(XXX,XXX),RLSE),
// DCB=(LRECL=XXX,RECFM=XX,BLKSIZE=0),UNIT=XXXXX
//SYSIN DD *

FILE XXXXIN
IN-XXX-XXXXXX 03 4 P 00
XXXXXXXX-XXXXX-XXDE 0012 0003 A
XXXXXXXX-XXX-XXXX-XCCUR 0032 0002 P 00
XXX-XXXA 0034 0038 A OCCURS 0100
XXXXXXXX-XXX-XXH XXX-XXXA 05 A
XXXXXXXX-XXXX-XMT XXX-XXXA +5 05 P 02
XXXXXXXX-XXXXX-XXXXXE XXX-XXXA +10 05 P 02
XXXXXXXX-XXXX-XXX-XD XXX-XXXA +15 05 P 02
XXXXXXXX-XX-XXX-XXX-XXED XXX-XXXA +20 05 P 02
XXXXXXXX-XXXXXX-XXX-XXYD XXX-XXXA +25 05 P 02
XXXXXXXX-XXXX-XXXUE XXX-XXXA +30 05 P 06
XXXXXXXX-XXXXX-XXXXXXSED XXX-XXXA +37 07 P 06
XXXXXXXX-XXXXXXXX-XXDE XXX-XXXA +38 01 A

//*Here the group data is XXX-XXXA and group data start position is 34 / record length is //*38 / occurrence of 100 times

*
FILE XXXXOUT
XXX-XXC 01 XXX A
XXT-XXXXXM 1 7 N
XXT-XXX-XXT 10 11 N 2
XXX-XXX-XXXX-OCCUR 23 02 P 00
XXX-XXX-XXTA 26 10 A OCCURS 0100
XXX-XXXX-XXX-YXH XXX-XXX-XXTA 05 A
XXX-XXXG-XXXXX-XXXXXX-XXT XXX-XXX-XXTA +5 05 P 02

//*Here the group data is XXX-XXTA and group data start position is 26 / record length is //*10 / occurrence of 100 times

WS-COUNT W 09 N
WS-XXX-XXT W 11 N 2
I W 03 N 0

JOB INPUT FILEIN FINISH DISPLAY-PARA.
IF XXXXXXXX-XXXXX-XXDE = 'AAA'
WS-XXX-XXT = 0
A = 1
XXX-XXC = ' '
DO WHILE A LE XXXXXXXX-XXX-XXXX-OCCUR
XXXXXXXX-XXXXX-XXXXXX-XMT (A) = +
XXXXXXXX-XXXXX-XXXXXX-XMT (A) * -1
WS-XXX-XXT = WS-XXX-XXT + XXXXXXXX-XXXXX-XXXXXX-XMT (A)
XXX-XXXX-XXX-XXH (I) = XXXXXXXX-XXX-XXH (A)
XXX-XXXX-XXXXX-XXXXXX-XMT (A) = +
XXXXXXXX-XXXXX-XXXXXX-XMT (A)
A = A + 1
END-DO
//*The output file variable will be loaded based on input file group data. The working //*storage field WS-XXX-XMT will be added for each record and it will be written in //*output file.
XXT-XXXXXM = IN-XXX-XXXXXM
OUT-XXX-XXT = WS-XXX-XXT
XXX-XXX-XXXX-OCCUR = XXXXXXXX-XXX-XXXX-XCCUR
PUT XXXXOUT
WS-COUNT = WS-COUNT + 1
END-IF

*

//*Once end of the file reached this para will perform and display how many records were //*written into output file.

DISPLAY-PARA. PROC
DISPLAY 'FIND : ' WS-CNT1
END-PROC
//*