I'm not sure what you seek is possible. The DNS >>> IS <<< the designated means of connecting to the database, and the paramemters for the connections are specified in that DNS.
If you want to change connection parameters at runtime I suggest you 1) create a new DNS synamically OR have a separate DNS available (i.e. already created but not in use), 2) close the existing connections, and 3) reconnect with the new DNS.
If you wish, you can connect to the database without a DNS at runtime. Here's an example of such a connection that you would use with SQLCA (or whatever transaction object you choode):
DBPARM = ConnectString='DSN=PostgreSQL35W;UID=cabdevusr;PWD=cabdevusr',DelimitIdentifier='No',LoginTimeOut=99",DisableBind=1