Say you had maps running on several servers and you wanted a notification sent to you concerning a reject or a report; ...in that type of reporting you wanted to know which Computer /Server/Name it was coming from.
What I dont want to do
I dont want to have a file.txt on each server with the respective computer name. I know I could do that , but should the respective computer name be changed it means I have to change the file.txt .
kumar_s wrote:Yeah, you can read the value and store in to that file before executing you Datastage jobs. And optionally remove the input file after the extract. ...
How? Can this be run as a batch job from within the DSTX/WTX map?
IBM says there is no function available. They recommend that I use the EXIT() map ,function. This functions allows your map to interface with an external application and return the results back to your map.
I believe I am going to try making a .bat file and insert the DOS command 'IPCONFIG'. Feed the results to a .txt file and have a map read the .txt file until I get to the IP address and then when I read the IP address; do a lookup on a table to find the corresponding computer name assigned to that IP address.
wait ,....on the other hand the IPCONFIG/all will give me the name of the computer "Host Name...........computer name".
I should be able to perform the above comfortable in a map. what do you think?
You can have an input card which runs the batch file containing the ipconfig/all
This returns the output of the bat file to the input card. You can then extract the host name.
Might as well just use a file. It's still got to be changed for each machine.
I think a generic solution was required. However, I'm not sure how to do this for different operating systems.
The Run_config.mmc has an output card with a Group Sub class [Item] and a field :
The Group Subclass = Sequence and the component is delimited with a Literal = <CR> <LF>
the Field item is Text and the size is Min=0 Interpret as character.
---------------------------------------------------------------------------------
The result is :
------------------------------------------------------------------------------------
At that point I have another map that reads the above data and capture what I need. In this case all I need is the 'Host Name' .
I used a <CR> instead of <NL> because, for some weird reason, the output from IPCONFIG terminates its lines with <CR><CR><LF>. So using <CR> was the most efficient fix.
"Artificial intelligience is no match for natural stupidity."
The command "Hostname" is supported in both Unix and WinXP (Therefore should be supported in WinServ2003).
That should give you only and exactly what you need.. if i understand the requirement right.
Amey Vaidya<i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
You're right (as always). I was concerned that it might produce the same weirdness that ipconfig does with the double <CR><CR><LF>. But I looked at it's output in binary and it does not have that issue so your method is more simple and efficient!
jgibby < bows to janhess' superiority
"Artificial intelligience is no match for natural stupidity."