Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: How to Add Datatel Initialization Subroutines? (3x Version)  (Read 1650 times)

Entrinsik Support

  • Administrator
  • Jr. Member
  • *****
  • Posts: 55
    • View Profile
    • Email
How to Add Datatel Initialization Subroutines? (3x Version)
« on: November 09, 2010, 10:09:42 am »
I originally said that we were not going to discuss version 3x on this board, but this is such a prevalent issue I had to make an exception.  Before reading on, please check the version number of your Informer.  If you are on version 4x or later please see this post instead:

http://delivery.entrinsik.com/portal/index.php?topic=33.0

When you log into a Datatel UniData account directly, UniData will run a login script automatically and start any initialization subroutines.  When you run a report from Informer on this same account the login script will not be executed, and your initialization subroutines will not be started.  To make sure these subroutines are started when Informer runs reports you must add them to your context settings in the /admin site.  But first, we must figure out what our initialization subroutines are!

Step One: Finding Initialization Subroutines

Log into your target account (that is the account listed next to "Target Data Account" in your System Settings section) and type the command

Code: [Select]
AE VOC LOGIN

This will show you all the code that is executed when you log into the account.  Look for a line that starts with "SQLENVINIT", when you find it, write it down, we will need it later.  You may also see a line that says "ST.JUMPSTART" or "FR.JUMPSTART" or "ENVINIT", make a note of which ones you see listed.

Step Two: Set-up SQLENVINIT

If you are a Datatel customer looking at a Colleague data source, then you will almost always see the call to "SQLENVINIT" in your login script.  Unfortunately this script prompts the user for a password (you may have noticed you needed to re-enter your password when you logged into the colon prompt, this was for the SQLENVINIT script) so we cannot simply add it straight to Informer.  

To solve this problem we will have to set the user's password before the call to SQLENVINIT.  To do this we will need to log into the colon prompt for this account as the Informer user.  The Informer user is the one listed in your context settings in the /admin site.


When you log into the colon prompt, remember to enter the user's password correctly when prompted.  Then, once you are at the UniData command line, enter the following command:

If you are using Unix:
Code: [Select]
!echo $DASP
If you are using Windows:
Code: [Select]
!ECHO %DASP%
The output of this command will be the encrypted version of the user's password (the one you just entered when you logged into the account).  It will look like a series of random characters, write this down.

Next, we will have to add a subroutine to this account.  You may add this subroutine to any binary programs folder, as a standard practice I usually add it to the BP file:


IMPORTANT: Remember, you must replace "informer_username" with your own username from data source settings (see beginning of step two).  You must also replace "encrypted_password" with the encrypted password you wrote down earlier.  Lastly, you must replace "SQLENVINIT DMI:myserver:7200, production" with the line you wrote down from step 1.

Once the subroutine has been properly filed and compiled, you must catalog the subroutine directly by using this command:

Code: [Select]
CATALOG BP INFORMERINIT DIRECT
Step Three: Synchronizing the Informer VOC

The Informer account uses a completely separate VOC file, so even thou you just cataloged this new subroutine in your target account, it is still not cataloged in the Informer account.  Any time you make changes to your target account's VOC file, you must synchronize with the Informer VOC.

First, log into your Informer Unidata/Universe account (this is the account listed next to the context name in the /admin site).

When you get to the database command line, the second thing we need to do is make sure that we don't already have an INFORMERINIT in this account.  If you have been on 3x for a while it is likely that you set this up previously in the INF_METH file.  We will be removing this reference since it will no longer be valid when you move to version 4x.  Type the following commands in to remove the old reference to INFORMERINIT (if you have one) and to catalog the new reference:

Code: [Select]
SELECT VOC WITH @ID="INFORMERINIT"
IMPORTANT: If the above statement does not select anything DO NOT run the next statement, or you risk deleting the entire VOC file.  Only run the next command if you have an active select list containing the one INFORMERINIT record.

Code: [Select]
DELETE VOC
Next, run this to synchronize the VOC.  You can also run the VOC synchronization command from the System Settings screen in your Informer web application to accomplish the same thing (sometimes running from the web application is faster)

Code: [Select]
SYSTEM.synchronizeVoc
Finally, double check to make sure the VOC sync brought over the correct reference to INFORMERINIT:

Code: [Select]
AE VOC INFORMERINIT
If this record contains the path to the INFORMERINIT you setup in step 2 then move on to step 4:

Step Four: Add Initialization Subroutines to Informer

Log back into you Informer /admin site, from the reports home page, click on the name of the context you are editing.  Add the newly created INFORMERINIT subroutine to Initialization Subroutines along with any other subroutines you found from Step One:


Save your changes and we are finished!  You must submit changes and restart Informer for the changes to take effect.
« Last Edit: November 09, 2010, 11:29:01 am by Jason Vorenkamp »
Thanks,
Jason Vorenkamp
Direct: (888) 703-0016
jason@entrinsik.com
http://www.entrinsik.com

vanhove

  • Guest
Re: How to Add Datatel Initialization Subroutines? (3x Version)
« Reply #1 on: March 11, 2012, 08:34:45 am »
Everytime I type in the subroutines it always returns a "fatal error" message. Why is this? Any help is greatly appreciated.