Grep output to file result not as expected

Hi Gurus,
I run command grep ABC file1 > file2 against below file. I got all ABC_xxx in one line in file2. I expect to get multiple lines in file2. If I print result in screen, the result is expected.
thanks in advance
My os is SunOS 5.10 Generic_150400-64 sun4v sparc sun4v

ABC_123
XXXXX
ABC_456
XXXXX
ABC_567
XXXXX

result

ABC_123 ABC_456 ABC_567

expected result:

ABC_123
ABC_456
ABC_567

try:

dos2ux < file1 | grep ABC > file2

Your given grep command on your given input file DOES produce the expected output.
Are you using a special grep program? Try /bin/grep