Page 1 of 1

DSHOME on Windows

Posted: Mon Dec 10, 2007 11:11 pm
by adamski
Hi All

I am wanting to derive the location of $DSHOME\Engine\bin in a routine on a Windows installation. However it seems that this environment variable $DSHOME (or eqivalent) does not exist, or I just cant find it. It is mkdbfile I need run.

I have found the variable "SPackagePath" which returns "E:\Ascential\DataStage\Package". I know I can manipulate this to get what I want, however is there a more direct method.

Thanks in advance.

Posted: Tue Dec 11, 2007 12:00 am
by lstsaur
Just create a systems variable DSHOME and enter E:\Ascential\DataStage\Engine\bin in the value field. Then you can use %DSHOME% in your routine the same way as you use the $DSHOME variable in Unix environment.

Posted: Tue Dec 11, 2007 1:17 am
by adamski
Thanks lstsaur, however I have considdered this and would prefer a dynamic solution that does not require re-configuration between environments. Unfortunately they differ from server to server.

Posted: Tue Dec 11, 2007 1:51 am
by ray.wurlod
I'm not aware of any more direct method, which is why I documented the scriptbeginning from DSPackagePath. Gee, that was so long ago! I'd forgotten it! Must get around to changing the accreditation notice.

Posted: Tue Dec 11, 2007 4:55 am
by adamski
Thanks Ray

DSPackagePath it is.

Posted: Wed Dec 12, 2007 1:27 am
by ray.wurlod
Actually, that's not the case. You could create a small function (exposed by OLE Automation) that read the relevant registry entry and returned the pathname contained therein.

If you're already in DataStage, the System(32) function returns the pathname.