Please find the below code and error message I receive while trying to check for DB2 connectivity. Initially started runing the actual SQL and as it failed, wrote the below to check the connectivity and it shows the below error.
LIBDEF ISPLLIB DATASET ID('SDB25A.SDSNLOAD')
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"
ADDRESS TSO "SUBCOM DSNREXX"
IF RC <> 0 THEN DO
S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
IF S_RC <> 0 THEN DO
SAY 'PROBLEM LOADING DB2 ENVIRONMENT'
ADDRESS DSNREXX "CONNECT "LOCDB25
2 +++ LIBDEF ISPLLIB DATASET ID('SDB25A.SDSNLOAD')
IRX0043I Error running DB2LINK, line 2: Routine not found