the tasks always fails
This tells us absolutely nothing that we could use to help you. When you say "fails", do you mean:
- the task abends (and if so, WHAT IS THE ABEND CODE CICS TELLS YOU?)
- the task goes into a loop and has to be canceled
- the updates are not applied to the database (and if so, what are the SQL codes?)
- the write to the VSAM data set fails (and if so, what are the file status codes for the write?)
- some other problem / issue / result?
I have actually seen this exact behavior in the past. The CICS program was issuing improper MAP commands (it's been many years so I don't recall the exact sequence of commands). When run with CEDF, the screen displays between each command prevented the map problem from happening. The root cause turned out to be COBOL code that was falling through an exit and getting into the CICS MAP code when it should not have been.