help needed for multiline comment deleting script

Hi

I have a script to delete the multiline comments as below

********************************************
#!/usr/bin/sed -f
#Replaces single line comment
s://.::
#Replaces multiline comment present in a single line
s:/\*[^\*/]*\
/::g
#Starting of the loop for checking the starting of the multi-line comment
/\/\/!bc
#Searches for the ending part of the multiline comment
:a
/\
\//!{
N
ba
}
s:/\*.*\/::
:c
*
***************************************************

It is working fine in deleting the comments. However ther is a problem.
I am using it for a dml as below
****************************************************
record
ebcdic string(7) f7ezstat_as_of_date;
ebcdic string(2) f7ezstat_data_source;
packed decimal(15,0,unsigned) f7ezstat_hierarchy_key_1;
packed decimal(15,0,unsigned) f7ezstat_hierarchy_key_2;
ebcdic string(8) f7ezstat_hierarchy_key_3; /* needed /
packed decimal(15,0,unsigned) f7ezstat_hierarchy_key_4;
packed decimal(15,0,unsigned) f7ezstat_hierarchy_key_5;
packed decimal(15,0,unsigned) f7ezstat_hierarchy_key_6;
packed decimal(15,0,unsigned) f7ezstat_channel_id;
packed decimal(15,0,unsigned) f7ezstat_segment_id;
packed decimal(15,2) f7ezstat_volume;
end
*
**************************************************
here there is no new line character after the "end".
This is causing the problem.......
If the no. of fields between "record" and "end" is more than 9....
the o/p is
***************************************************
record
ebcdic string(7) f7ezstat_as_of_date;
ebcdic string(2) f7ezstat_data_source;
packed decimal(15,0,unsigned) f7ezstat_hierarchy_key_1;
packed decimal(15,0,unsigned) f7ezstat_hierarchy_key_2;
ebcdic string(8) f7ezstat_hierarchy_key_3;
packed decimal(15,0,unsigned) f7ezstat_hierarchy_key_4;
packed decimal(15,0,unsigned) f7ezstat_hierarchy_key_5;
packed decimal(15,0,unsigned) f7ezstat_hierarchy_key_6;
packed decimal(15,0,unsigned) f7ezstat_channel_id;
packed decimal(15,0,unsigned) f7ezstat_segment_id;
packed decimal(15,2) f7ezstat_volume;
****************************************************

The "end" goes missing......
but if the same is done with less than 9 fields....
all works fine....

we are using the following command to run it
sed -f sed.ksh f7_ez_f7ezstat_ebcdic.dml

here sed.ksh is the script to delete the comments and f7_ez_f7ezstat_ebcdic.dml is the dml.

Please help

Please edit your post and use code tags [code] to for code and sample data.