IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  Resolve resource registry variable in LEFT function

    Posted 01/23/08 10:16 AM

    Originally posted by: rarw


    Hi,

    I need to compare the input filename (FILE_NAME Field:In1) for a WTx map rule with a string in the Resource Registry.

    In short, I need to be able to resolve the value of %CPS02S_BRG% in the LEFT function. The line of code shown below does NOT work:

    =IF(LEFT(FILE_NAME Field:In1, 7) = LEFT(%CPS02S_BRG%,7), ...)

    The rule works if I hard code the value of the string that I want to match (=IF(LEFT(FILE_NAME Field:In1, 7) = "BCPS02S", ...)). If possible, I would prefer to use the Resource Registry to obtain the string to match, and not hard code it.

    I have tried the following functions: GETRESOURCEALIAS, TEXTTOQUOTED to no avail.

    Thanks for your help,
    Becky
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 2.  Re: Resolve resource registry variable in LEFT function

    Posted 01/23/08 10:22 AM

    Originally posted by: janhess


    You can't use resource registry values in this way - they are limited to certain functions like RUN. You would have to have a card that read in the resource registry file and use that for comparrison.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 3.  Re: Resolve resource registry variable in LEFT function

    Posted 01/23/08 04:00 PM

    Originally posted by: rarw


    Thank you very much for your quick reply janhess, I appreciate it.

    Becky
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 4.  Re: Resolve resource registry variable in LEFT function

    Posted 01/24/08 09:52 AM

    Originally posted by: LaurentB


    That depends on the version you are running.

    In 8.1 there is the function resourcelib->getresourcealias, which takes the mrc name and the resource value (enclosed in % signs) as it 2 arguments, and returns the resource value.

    In all other versions, you could "hack" the system a bit by using the BAT/SHL adapter to issue an echo %myresource% command. This way, the resource manager will translate the resource value before handing the command string to the adapter, and the actual command will become "echo This_is_the_value_of_the_resource". There is a pitfall if doing so on a Unix platform and running multiple maps in parallel, due to large memory utilization in this case, so a better way to do it on Unix would be to use the EXIT function .

    A mapping rule like this one shoudl do the trick :
    =IF(MID(GETDIRECTORY(), 1, 1) = "/", EXIT("echo", "| " + Command, " "), GET("BAT", "cmd /c" + Command))

    As Janhess suggested, there's also the option to get the resource from a card, but the issue might be to identify the proper VirtualServer.

    Hope this helps
    Laurent
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender