Any body know , how to invoke project variable that is environment variable in subroutine....
i created one variable say Hash_file_location in project level environment variable...
i need to invoke this variable in my subroutine. is it possible i know how to invoke this variable from job parameter.... using #$Hash_file_location#
but i want to invoke in my subroutine
Project Variable
Moderators: chulett, rschirm, roy
Environment variables have to be setup in the job as job parameters. As for getting any variable into a subroutine (I assume you mean before/after transformer/job subroutine call) you have to pass it as the argument. Your subroutine needs to get it from the argument. Otherwise, you will need to do an "env" command from inside your subroutine and parse it from the screen results of the env command.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
kcbland wrote:Environment variables have to be setup in the job as job parameters. As for getting any variable into a subroutine (I assume you mean before/after transformer/job subroutine call) you have to pass it as the argument. Your subroutine needs to get it from the argument. Otherwise, you will need to do an "env" command from inside your subroutine and parse it from the screen results of the env command.
Please tell me how to parse " env" command from inside my subroutine
rv
Veni,
in a routine you can issue
The EnvironemtString will contain the UNIX output of the env command, with all <LF> converted to @FM. You can then write some code to loop through all the values to find the ones you are interested in.
in a routine you can issue
Code: Select all
EnvironmentString = DSExecute('UNIX','env',ErrorCode)
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 3593
- Joined: Thu Jan 23, 2003 5:25 pm
- Location: Australia, Melbourne
- Contact:
Normally you want to avoid plucking env variables from within a routine as it breaks good modular coding practices. Kind of like using global variables in Visual Basic code. The project specific environment variables are set as the default values for job parameters, it is possible that someone will run the job and change those defaults (for example change the hash file location) when the run or schedule the job, so your jobs will end up using one value and your routines another value.
Passing all variables in a arguments to the routine is a better way to go and it is very easy to set up from a Sequence job.
Passing all variables in a arguments to the routine is a better way to go and it is very easy to set up from a Sequence job.
Certus Solutions
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
Blog: Tooling Around in the InfoSphere
Twitter: @vmcburney
LinkedIn:Vincent McBurney LinkedIn
vmcburney wrote:Normally you want to avoid plucking env variables from within a routine as it breaks good modular coding practices. Kind of like using global variables in Visual Basic code. The project specific environment variables are set as the default values for job parameters, it is possible that someone will run the job and change those defaults (for example change the hash file location) when the run or schedule the job, so your jobs will end up using one value and your routines another value.
Passing all variables in a arguments to the routine is a better way to go and it is very easy to set up from a Sequence job.
i want to get access userdefine variable in project environment from my subroutine ,
it is entripted value that in job i can invoke #$HASH_PATH_Par# BUT I don't know how to invoke from subroutine
rv
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: