Originally posted by: SystemAdmin
I finally
got the documentation on the BAT & SHL resource adapters. I don't know what it is, but sometimes I just cannot get what they are trying to say. I finally figured out how do the ECHO cmd on both Windows & Unix the same way and get the value back without using a batch file. It still requires switching between the BAT adapter for Windows and the SHL adapter for UNIX, but I solved that with another Resource Registry value. Here's what I do:
code:1:d4842282a5WORD(
GET(
"%SHELL_TYPE%"
,"-cmd 'echo %RESOURCE_ALIAS%" + "' -CLI "
)
,"<NL>"
,1
)[/code:1:d4842282a5]
The "-CLI" after the command is what I couldn't understand from the documentation, but I get it now. It does come back with a trailing <NL> but that is easily removed via the WORD function. And the "%SHELL_TYPE%" RR alias picks the correct adapter "SHL" or "BAT" based on the system I am running on.
Then I started thinking about how to use this method to get the values from the RR loaded into a file that could be used as input for maps, taking advantage of the WorkArea
i:d4842282a5Reuse[/i:d4842282a5] option. However, I'm not as familiar with the IFD and don't know if my idea will work as expected. What I was thinking is having a map that would be triggered off a time event that would happen just once when the EventServer is started. It would build the file for other maps to use. Those maps would have the input card's WorkArea set to Reuse.
Sounds like it might work, but I don't have the cycles to test it right now.
#IBM-Websphere-Transformation-Extender#IBMSterlingTransformationExtender#DataExchange