Cognos Analytics

 View Only
  • 1.  $Mashine Parameter returns a different value (CA 11.0.13 / 11.1.7)

    IBM Champion
    Posted Fri December 11, 2020 01:07 PM
    Hi.

    We are using a Cognos macro to read out the $Machine parameter. Now we have noticed a change between version 11.0.13 and 11.1.7:
    Result:
    11.0.13: servername.domain.de (fully qualified name)
    11.1.7: servername

    Does anyone know a way to get the full name again?

    (We use the macro in the Framework Manager to control the database schema in different environments).

    Thanks Jens

    ------------------------------
    Jens Bäumler
    Senior Consultant and Trainer
    Apparo Group
    ------------------------------

    #CognosAnalyticswithWatson


  • 2.  RE: $Mashine Parameter returns a different value (CA 11.0.13 / 11.1.7)

    Posted Fri December 11, 2020 10:37 PM

    Hi Jens,
    As far as I can tell, this code hasn't changed in years.

    To set up the value a call is made in jave as this:   InetAddress.getLocalHost().getHostName()
    In my environment testing 11.0.13 gives a short name as well.

    If Cognos 11.0.13 and 11.1.7 are on different machines, is there something different in the setups of those machines ?

    // Henk



    ------------------------------
    HENK CAZEMIER
    ------------------------------



  • 3.  RE: $Mashine Parameter returns a different value (CA 11.0.13 / 11.1.7)

    IBM Champion
    Posted Sat December 12, 2020 02:51 AM
    Hello Henk. 

    Thanks for your reply. It was a "on top installation". Same server, same configuration, same content store.

    In cognos configuration: Do you have full qualified names in your 11.0.13 environment? 

    thx Jens


    ------------------------------
    Jens Bäumler
    Senior Consultant and Trainer
    Apparo Group
    ------------------------------



  • 4.  RE: $Mashine Parameter returns a different value (CA 11.0.13 / 11.1.7)

    Posted Fri December 18, 2020 03:09 PM
    Edited by System Fri January 20, 2023 04:25 PM

    Hi,

    I have noted that using CQM, this macro returns server name and using DQM returns FQN.

    In my case, we have different database schema names based on type of environment (dev, production, test, etc).

    My solution for that was creating an environment parameter (Local Config > advanced configuration) in Cognos Configuration called "ambiente", what means "environment" in my language. And then, I put the prefix of database of related environment, kind of DEV_, PRD_, etc.

    So, in my Cognos data sources (Framework Manager), I have used this macro to get this parameter value of Cognos Configuration at run time.

    #substitute('''' ; '' ; substitute('</crn:value'''; '' ; csv( grep('crn:value$' ; split('>' ; grep('ambiente' ; split('crn:parameter' ; getConfigurationEntry('advancedProperties' )))))))) + 'SUFIX_DATABASE_NAME'#

    Using this way, you might change your server name or add more servers to your environment with no problems.



    ------------------------------
    JEAM COELHO
    Cognos Solution Architect

    LinkedIn: https://www.linkedin.com/in/jeamcoelho/
    ------------------------------



  • 5.  RE: $Mashine Parameter returns a different value (CA 11.0.13 / 11.1.7)

    IBM Champion
    Posted Sat December 19, 2020 07:41 AM

    Hi Jeam. Yes, it's the same situation as ours (different database schema in PROD and DEV).

    Your macro is a good and more stable alternative.

    Thanks. Jens



    ------------------------------
    Jens Bäumler
    Senior Consultant and Trainer
    Apparo Group
    ------------------------------



  • 6.  RE: $Mashine Parameter returns a different value (CA 11.0.13 / 11.1.7)

    IBM Champion
    Posted Wed December 23, 2020 04:10 AM

    Hello Jens,

    we use "#$dbschema{$machine}#" in datasource > schema of FM model. All queries (of course) must then be without schema.

    $dbschema is a parameter map, where we specify a machine name (with and without FQDN) and the corresponding dbschema.

    dbschema macro in datasource of fm modell

    Machine names parameter map:

    Another alternative is setting in Open session commands of datasource in Cognos portal to use a "set current schema" 

    example for DB2: <commandBlock><commands><sqlCommand><sql>SET CURRENT SCHEMA=FK1C_T1D</sql></sqlCommand></commands></commandBlock>

    This of course requires that none of your queries holds information about schema like: select * from cognos.gosales

    Hth, 

    Ralf



    ------------------------------
    Ralf Roeber
    ------------------------------



  • 7.  RE: $Mashine Parameter returns a different value (CA 11.0.13 / 11.1.7)

    IBM Champion
    Posted Wed December 23, 2020 08:45 AM

    Hello Ralf.

    Using another parameter map is also a good idea.
    Then I can specify both variants in the macro

    server1 --> DEV
    server1.domain.tl --DEV

    server2 --> PROD
    server2.domain.tl -->PROD

    Thanks, Jens



    ------------------------------
    Jens Bäumler
    Senior Consultant and Trainer
    Apparo Group
    ------------------------------



  • 8.  RE: $Mashine Parameter returns a different value (CA 11.0.13 / 11.1.7)

    Posted Wed December 23, 2020 03:03 PM

    In the past we use parameter map like that. The problem is with changing server names or adding more servers to environment.

    You will should add new entry in every FM and publish all packages again.



    ------------------------------
    JEAM COELHO
    Cognos Solution Architect

    LinkedIn: https://www.linkedin.com/in/jeamcoelho/
    ------------------------------