My main doubt is, Same program is running perfectly
if i give Tso ex'dataset name'
why its erroring when i run the same program thru JCL .

Contact your site support group. Since a number of data sets are allocated during the sign on processing for TSO, obviously you are missing one or more of these allocated files in your batch job. Since we do not know the environment at your site, only your site support group can tell you which files you need to add to your batch job to get it working.

The more important question is why on earth would you expect something to run just the same in batch as in TSO? They are very different environments and there are things you can do in your TSO session you cannot do in batch and vice versa.

00F30002
Explanation:
The requested DB2 subsystem, as specified by the subsystem name, is not active. The option to notify the requester, either via an ECB post or a
SEND/MODIFY MVS command, is accepted.

I was also facing similar issue where my REXX/DB2 code was working fine on line(TSO EXEC) while it was failing with -924 DB2 code in batch. When I changed the CLASS as (CLASS=DB2TSTD) and it worked for me. This class might be site-specific.