SQL adaptation guide For IBM DB2 UDB 8.x, 9x / Connecting to DB2 OS/400 |
The relational database directory is equivalent to the database directory of the DB2® client. This is necessary to access the database with DRDA® clients (Distributed Relational Database Architecture™) like DB2 client.
Use the WRKRDBDIRE tool to add the entry in the database directory:
WRKDBDIRE
ADDRESS = *LOCAL
TYPE = *IP
Start the DDM server on the OS/400® which listens on the DRDA 446 port:
Start the database server:
SERVER TYPE = *DATABASE
REQUIRED PROTOCOL: *ANY
The DDM/DRDA server that listens on TCP/IP port 446 handles requests from a DRDA client (examples are DB2 Connect™ or another AS/400®).
The database server is not needed for DRDA clients, but it is needed for Client Access.
If a TCP/IP connection is desired, then your AS/400 server cannot have a release prior to V4R2 installed.
To manually configure the connection via the DB2 command line, you will need to enter catalog commands:
> db2 catalog tcpip node <node-name> remote <as400-adress> server 446
> db2 catalog db <db-name-alias> at node <node-name> authentication dcs
> db2 catalog dcs db <db-name-alias> as <local-RDB-name-of-AS400>
If you catalogue the DB2 UDB for iSeries® server incorrectly, you may get an SQL5048N error message. SQL7008N is another common error in that the DB2 UDB for iSeries tables being accessed on the server are not being journaled. To correct the SQL7008N error, you need to start journaling your tables or change the isolation level to No Commit.
The proper CCSID value (normally 37 for US English customers) is needed for any tables on the iSeries accessed via DB2 Connect. You can view the CCSID value with the DSPFD CL command or Operations Navigator. CCSID values can be changed with the ALTER TABLE statement or CHGPF CL command. Furthermore, to successfully connect, you may need to change one of the following: the CCSID of the job, the CCSID of the user profile used, or the system CCSID value (QCCSID) if it's the default 65535.