Hi Gurus,
I am struck here with this issue and need some help:
Input file need to split into two output files as shown below.
The filelayout shown has header and details records I have to identfy the detail records say(105 - shown in below example) and need to be written in to another file with the header info.

Thanks in advance for your help.

********************************
Input File Layout:

1023 450 FINANCE

SA12 103 GEORGE
AE12 103 GEORGE
SD12 103 GEORGE
SA03 105 SMITH
S303 105 SMITH
D303 105 SMITH
SA03 115 CAROL
S303 115 CAROL
D303 115 CAROL

1023 450 FINANCE_END

*****************************
OutPutFiles:

1st O/p File
1023 450 FINANCE

SA12 103 GEORGE
AE12 103 GEORGE
SD12 103 GEORGE
SA03 115 CAROL
S303 115 CAROL
D303 115 CAROL

1023 450 FINANCE_END

***********
2nd O/p File
1023 450 FINANCE

SA03 105 SMITH
S303 105 SMITH
D303 105 SMITH

1023 450 FINANCE_END

****************************




Thanks
S