Hello Venkatesh,
SQLScript does not provide out of the box the options to convert data to JSON or XML. Of course you could implemented a simple JSON creator with imperative logic in SQLScript, but I think you will not have fun with that.
Would it be an option to use XSJS to convert your data to JSON with well-known JavaScript capabilities? You could select your data from the XSJS script using the HDB interface (e.g. JSDoc: Namespace: hdb) or calling a procedure (e.g. JSDoc: Namespace: procedures) which delivers the data and convert the it to JSON for further processing.
Best Regards,
Florian