Is it possible to access Unix environment variables from within the DS Job Control script ?
regards,
Peter Oates
Unix env variables
Yes. For example to set the FRED environment variable to FLINTSTONE:
PERFORM "ENV SET FRED=FLINTSTONE"
To clear the environment variable:
PERFORM "ENV CLEAR FRED"
-----Original Message-----
From: Peter Oates [mailto:Peter.Oates@macquarie.com]
Sent: Tuesday, 23 October 2001 13:19
To: datastage-users@oliver.com
Subject: Unix env variables
Is it possible to access Unix environment variables from within the DS Job Control script ?
regards,
Peter Oates
PERFORM "ENV SET FRED=FLINTSTONE"
To clear the environment variable:
PERFORM "ENV CLEAR FRED"
-----Original Message-----
From: Peter Oates [mailto:Peter.Oates@macquarie.com]
Sent: Tuesday, 23 October 2001 13:19
To: datastage-users@oliver.com
Subject: Unix env variables
Is it possible to access Unix environment variables from within the DS Job Control script ?
regards,
Peter Oates
PERFORM is documented in the BASIC manual.
ENV is a UniVerse command; get to a UniVerse prompt (perhaps in the Administrator client) and type HELP ENVIRONMENT, or get the User Reference manual from the web. Unfortunately, the only display at this level displays all variables.
However, by using the CAPTURING clause of EXECUTE, you can do what youre after.
EXECUTE SH -c "echo $HOME" CAPTURING EnvHOME
Call DSSetParam(hJob, "MyHomeDir", EnvHOME)
-----Original Message-----
From: Peter Oates [mailto:Peter.Oates@macquarie.com]
Sent: Tuesday, 23 October 2001 13:36
To: ray.wurlod@Informix.Com
Subject: RE: Unix env variables
Ray,
Where is this documented ? I cant seem to find this in the on-line doco.
More specifically, how do I set a DS variable to the value of a UNIX env variable ?
i.e. MyHomeDir = $home
thanks,
Peter
ENV is a UniVerse command; get to a UniVerse prompt (perhaps in the Administrator client) and type HELP ENVIRONMENT, or get the User Reference manual from the web. Unfortunately, the only display at this level displays all variables.
However, by using the CAPTURING clause of EXECUTE, you can do what youre after.
EXECUTE SH -c "echo $HOME" CAPTURING EnvHOME
Call DSSetParam(hJob, "MyHomeDir", EnvHOME)
-----Original Message-----
From: Peter Oates [mailto:Peter.Oates@macquarie.com]
Sent: Tuesday, 23 October 2001 13:36
To: ray.wurlod@Informix.Com
Subject: RE: Unix env variables
Ray,
Where is this documented ? I cant seem to find this in the on-line doco.
More specifically, how do I set a DS variable to the value of a UNIX env variable ?
i.e. MyHomeDir = $home
thanks,
Peter
Thanks for that Ray...it seems to work.
Im having problems with the DSSetParam in that it returns -4 - not happy with the value being set - even though the Parameter is type String.
-----Original Message-----
From: Ray Wurlod [mailto:ray.wurlod@Informix.Com]
Sent: Tuesday, 23 October 2001 2:53 PM
To: Peter Oates
Cc: datastage-users@oliver.com
Subject: RE: Unix env variables
PERFORM is documented in the BASIC manual.
ENV is a UniVerse command; get to a UniVerse prompt (perhaps in the Administrator client) and type HELP ENVIRONMENT, or get the User Reference manual from the web. Unfortunately, the only display at this level displays all variables.
However, by using the CAPTURING clause of EXECUTE, you can do what youre after.
EXECUTE SH -c "echo $HOME" CAPTURING EnvHOME
Call DSSetParam(hJob, "MyHomeDir", EnvHOME)
-----Original Message-----
From: Peter Oates [mailto:Peter.Oates@macquarie.com]
Sent: Tuesday, 23 October 2001 13:36
To: ray.wurlod@Informix.Com
Subject: RE: Unix env variables
Ray,
Where is this documented ? I cant seem to find this in the on-line doco.
More specifically, how do I set a DS variable to the value of a UNIX env variable ?
i.e. MyHomeDir = $home
thanks,
Peter
Im having problems with the DSSetParam in that it returns -4 - not happy with the value being set - even though the Parameter is type String.
-----Original Message-----
From: Ray Wurlod [mailto:ray.wurlod@Informix.Com]
Sent: Tuesday, 23 October 2001 2:53 PM
To: Peter Oates
Cc: datastage-users@oliver.com
Subject: RE: Unix env variables
PERFORM is documented in the BASIC manual.
ENV is a UniVerse command; get to a UniVerse prompt (perhaps in the Administrator client) and type HELP ENVIRONMENT, or get the User Reference manual from the web. Unfortunately, the only display at this level displays all variables.
However, by using the CAPTURING clause of EXECUTE, you can do what youre after.
EXECUTE SH -c "echo $HOME" CAPTURING EnvHOME
Call DSSetParam(hJob, "MyHomeDir", EnvHOME)
-----Original Message-----
From: Peter Oates [mailto:Peter.Oates@macquarie.com]
Sent: Tuesday, 23 October 2001 13:36
To: ray.wurlod@Informix.Com
Subject: RE: Unix env variables
Ray,
Where is this documented ? I cant seem to find this in the on-line doco.
More specifically, how do I set a DS variable to the value of a UNIX env variable ?
i.e. MyHomeDir = $home
thanks,
Peter
It may be that there is a line feed on the end of the captured output. This will have been translated to a "field mark" by CAPTURING. (I forgot about this gotcha.)
Try:
EXECUTE SH -c "echo $HOME" CAPTURING EnvHOME
Call DSSetParam(hJob, "MyHomeDir", Trim(Convert(@FM,"",EnvHOME)))
-----Original Message-----
From: Peter Oates [mailto:Peter.Oates@macquarie.com]
Sent: Wednesday, 24 October 2001 10:14
To: datastage-users@oliver.com
Subject: RE: Unix env variables
Thanks for that Ray...it seems to work.
Im having problems with the DSSetParam in that it returns -4 - not happy with the value being set - even though the Parameter is type String.
Try:
EXECUTE SH -c "echo $HOME" CAPTURING EnvHOME
Call DSSetParam(hJob, "MyHomeDir", Trim(Convert(@FM,"",EnvHOME)))
-----Original Message-----
From: Peter Oates [mailto:Peter.Oates@macquarie.com]
Sent: Wednesday, 24 October 2001 10:14
To: datastage-users@oliver.com
Subject: RE: Unix env variables
Thanks for that Ray...it seems to work.
Im having problems with the DSSetParam in that it returns -4 - not happy with the value being set - even though the Parameter is type String.
Fixed.....Works a dream !
-----Original Message-----
From: Ray Wurlod [mailto:ray.wurlod@Informix.Com]
Sent: Wednesday, 24 October 2001 10:29 AM
To: datastage-users@oliver.com
Subject: RE: Unix env variables
It may be that there is a line feed on the end of the captured output. This will have been translated to a "field mark" by CAPTURING. (I forgot about this gotcha.)
Try:
EXECUTE SH -c "echo $HOME" CAPTURING EnvHOME
Call DSSetParam(hJob, "MyHomeDir", Trim(Convert(@FM,"",EnvHOME)))
-----Original Message-----
From: Peter Oates [mailto:Peter.Oates@macquarie.com]
Sent: Wednesday, 24 October 2001 10:14
To: datastage-users@oliver.com
Subject: RE: Unix env variables
Thanks for that Ray...it seems to work.
Im having problems with the DSSetParam in that it returns -4 - not happy with the value being set - even though the Parameter is type String.
-----Original Message-----
From: Ray Wurlod [mailto:ray.wurlod@Informix.Com]
Sent: Wednesday, 24 October 2001 10:29 AM
To: datastage-users@oliver.com
Subject: RE: Unix env variables
It may be that there is a line feed on the end of the captured output. This will have been translated to a "field mark" by CAPTURING. (I forgot about this gotcha.)
Try:
EXECUTE SH -c "echo $HOME" CAPTURING EnvHOME
Call DSSetParam(hJob, "MyHomeDir", Trim(Convert(@FM,"",EnvHOME)))
-----Original Message-----
From: Peter Oates [mailto:Peter.Oates@macquarie.com]
Sent: Wednesday, 24 October 2001 10:14
To: datastage-users@oliver.com
Subject: RE: Unix env variables
Thanks for that Ray...it seems to work.
Im having problems with the DSSetParam in that it returns -4 - not happy with the value being set - even though the Parameter is type String.