the scenario is like this. one KSDS file has to used by both online and batch program . what is the logic?
As long as the KSDS data set is read-only to online and batch, there are no issues and allocate the file in batch with DISP=SHR. If you want online OR batch to update the data set, you will some issues but they can be resolved by using an enqueue / dequeue method in both batch and online. If you want online AND batch to update the data set, you will have major issues since CICS often holds the buffers for a period of time before updating the data set.