How can I get to know the rows affected by DML(Insert, Update, Merge, Delete) statements executed in a BTEQ? I need to use this data for logging purpose.
Logging where ?
You can test it in a BTEQ script using ActivityCount but BTEQ does not have a capability to extract that information so that you can write it anywhere (e.g. a table).
You have to have a shell script or similar to read the BTEQ output log.
You and lots of other people
If using BTEQ there is no built-in way to do this. if using TPT then you can do it. Not straight forward but you can do it. If this is of interest then look in the "Teradata Parallel Transporter User Guide" manual, chapter 14 (TTU 15.10).
One further thought about this.
The only way I can see doing this in a BTEQ environment is to use the NOTIFY feature. This causes BTEQ to pass certain information including the ActivityCount to a user-written module ('notify exit') at different points in the processing.
To get ActivityCount you'll need to use the HIGH verbosity option and trap the 'fetch start' or 'fetch start 2' event.