Environment variable in a tps

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Environment variable in a tps

  • Creator
    Topic
  • #50729
    Jacques Talbot
    Participant

    Hi

    I am trying to use Sybtcl from a tps context but it doesn’t work.

    I can use it from a tcl shell. I think that in the shell the environment variable SYBASE is set but not in the tps.

    How can I set the environment variable so it exist in a tps context.

    Thanks

    On AIX 5.3 QDX 5.6 TCL 8.4.12

Viewing 7 reply threads
  • Author
    Replies
    • #67283
      John Mercogliano
      Participant

      Try adding

      Code:

      global env

      to the top of the tps, if it works in the tps shell the global command should give you access to the env variable from within the tps.

      John Mercogliano
      Sentara Healthcare
      Hampton Roads, VA

    • #67284
      Jacques Talbot
      Participant

      I added

      global env

      but it doesn’t make my variable SYBASE visible

    • #67285
      John Mercogliano
      Participant

      Then you might want to check your login scripts (i.e. .profile, .kshrc, etc) Your login might be setting something that might not be available to the engine process.

      John Mercogliano
      Sentara Healthcare
      Hampton Roads, VA

    • #67286
      Jacques Talbot
      Participant

      That file doesn’t exist

      /hci/quovadx/qdx5.6/integrator/tcl/lib/localInit.tcl

      Can I create it ?

      In tps:

      echo $env(SYBASE)

      gave me:

      ‘can’t read “env(SYBASE)”: no such variable’

      from a tcl shell:

      tcl>package require Sybtcl

      3.0

      tcl>sybconnect interface_ro inter10 snap01

      sybtcl0

      from tps:

      puts [package require Sybtcl]

      3.0

      sybconnect interface_ro inter10 snap01

      Error: sybconnect: sybconnect failed in dbopen

      For today I can no more testing the BD is down, but I will comeback tomorow

      Thanks

    • #67287
      John Mercogliano
      Participant

      Yes, you can create it.  That file is there for you to set things to run when tcl first starts up so every tcl interpreter starts with the same local environment you want.  

      It looks like your package portion is setup correctly.  So, if you can do the same echo command in the interactive environment then you need to find where it is being set.  

      To start with, I would do a set env(SYBASE)

      right before you call your command to make sure that is the problem and if it is then move it to the localInit.tcl file.

      This would create the SYBASE env value in the interpreter.

      Good luck

      John Mercogliano
      Sentara Healthcare
      Hampton Roads, VA

    • #67288
      Charlie Bursell
      Participant

      before you change init.tcl did you try setting the environment in the Tcl script like?

             set ::env(SYBASE) something

    • #67289
      Jacques Talbot
      Participant

      Thanks all for your answers but it still not working.

      I tried to set

      set ::env(SYBASE) /path/to/sybase

      didn’t work.

      Tried in localInit.tcl no success…

      I have no more time to try to make it work so I decided to write my script in a tcl shell and communicate with it with a socket.

      Thanks again

    • #67290

      This example is from the tcl wiki: http://wiki.tcl.tk/706

      [code]

      -- Max Drown (Infor)

Viewing 7 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,119
Forums
28
Topics
9,293
Replies
34,435
Topic Tags
286
Empty Topic Tags
10