Adding initialization subroutines
When you log into a UniData account directly, UniData runs a login script that starts any initialization subroutines. When Informer runs a report against that account, the login script does not run, so those subroutines do not start. To make sure they run, add them to the Datasource settings. First, find out what your initialization subroutines are.
Step 1: find the initialization subroutines
Log into your target account (the one listed next to Account Path in the Datasource settings) and run:
AE VOC LOGIN
This shows everything that runs when you log into the account. Look for a line starting with SQLENVINIT and write it down. Also note any ST.JUMPSTART, FR.JUMPSTART, or ENVINIT lines.
Step 2: set up SQLENVINIT
Datatel customers on a Colleague Datasource almost always have a SQLENVINIT call in the login script. That script prompts for a password, so it cannot be added to Informer directly. Instead, set the user's password before calling SQLENVINIT from a small subroutine.
Log into the colon prompt for the account as the Informer user (the one in the Datasource system settings), entering the password when prompted. At the UniData command line, print the encrypted password:
!ECHO $DASP
On Windows, use !ECHO %DASP% instead. The output is the encrypted form of the password you just entered; write it down.
Create a subroutine (for example in the BP file) that sets the user and encrypted password, then runs your SQLENVINIT line:
VAR = SETENV("DASU","informer_username")
VAR = SETENV("DASP","encrypted_password")
EXECUTE "SQLENVINIT DMI:myserver:7200, production"
Replace informer_username with the Informer user from the Datasource settings, encrypted_password with the value you wrote down, and the SQLENVINIT ... line with the one from Step 1. Compile and catalog the subroutine (replace BP with the file you used):
BASIC BP INFORMERINIT
CATALOG BP INFORMERINIT DIRECT
Step 3: add the subroutines to Informer
In Informer, open Datasources, select your Datasource, open the Actions menu, and click Edit Connection. Click Add Subroutine and add INFORMERINIT along with any other subroutines you found in Step 1, then click Save. The change takes effect immediately, with no restart needed.
For more on U2 subroutines, see UniVerse and UniData subroutines.