hot to pass environment variable in server routine
Moderators: chulett, rschirm, roy
hot to pass environment variable in server routine
Hi,
I would like to pass environment variable $TargetFilePath into server routine.
if i write this code, it is giving an error
strFileLoc = DSGetParamInfo(DSJ.ME,"#$TargetFileDir#", DSJ.PARAMVALUE)
Call DSLogInfo("strACRFileLoc :":strFileLoc, DSJ.ME)
how to read environment variable's valve in server routine
do i need to define anything
Thanks
I would like to pass environment variable $TargetFilePath into server routine.
if i write this code, it is giving an error
strFileLoc = DSGetParamInfo(DSJ.ME,"#$TargetFileDir#", DSJ.PARAMVALUE)
Call DSLogInfo("strACRFileLoc :":strFileLoc, DSJ.ME)
how to read environment variable's valve in server routine
do i need to define anything
Thanks
Re: hot to pass environment variable in server routine
Pass the environment variable to Input Argument
pongal wrote:Hi,
I would like to pass environment variable $TargetFilePath into server routine.
if i write this code, it is giving an error
strFileLoc = DSGetParamInfo(DSJ.ME,"#$TargetFileDir#", DSJ.PARAMVALUE)
Call DSLogInfo("strACRFileLoc :":strFileLoc, DSJ.ME)
how to read environment variable's valve in server routine
do i need to define anything
Thanks
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Tell us the exact error.
Also tell us if you've included JOBCONTROL.H in your routine, where the DEFFUN for DSGetParamInfo() function lives. (It is not necessary to include it in a job control routine.)
If there's no DEFFUN, the error is likely to be something like "dimensioned array not defined".
Also tell us if you've included JOBCONTROL.H in your routine, where the DEFFUN for DSGetParamInfo() function lives. (It is not necessary to include it in a job control routine.)
If there's no DEFFUN, the error is likely to be something like "dimensioned array not defined".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
What kind of server routine do you use ? Before/After ?
Where do you call the routine ? Before/After job routine or within Job Sequence ?
Maybe you should add the env variable to Job properties first, and then code as #$env_var# in Before/After job routine, only $env_var in sequence routine activity.
Where do you call the routine ? Before/After job routine or within Job Sequence ?
Maybe you should add the env variable to Job properties first, and then code as #$env_var# in Before/After job routine, only $env_var in sequence routine activity.
elavenil wrote:Tried using the dummy environment variable with $ symbol and it gives error message. And tried assigning this env variable to the argument and it gives error.
Can you pls share us how the env variable can be assigned to Argument of the routine.
Thanks for the inputs.
Regards
Saravanan
Re: hot to pass environment variable in server routine
Hi,
why do you have # signs around the parameter name?
why do you have # signs around the parameter name?
pongal wrote:Hi,
I would like to pass environment variable $TargetFilePath into server routine.
if i write this code, it is giving an error
strFileLoc = DSGetParamInfo(DSJ.ME,"#$TargetFileDir#", DSJ.PARAMVALUE)
Call DSLogInfo("strACRFileLoc :":strFileLoc, DSJ.ME)
how to read environment variable's valve in server routine
do i need to define anything
Thanks
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Re: hot to pass environment variable in server routine
It seems it can't be compiled with $TargetFileDir, "$" unexpected.
roy wrote:Hi,
why do you have # signs around the parameter name?pongal wrote:Hi,
I would like to pass environment variable $TargetFilePath into server routine.
if i write this code, it is giving an error
strFileLoc = DSGetParamInfo(DSJ.ME,"#$TargetFileDir#", DSJ.PARAMVALUE)
Call DSLogInfo("strACRFileLoc :":strFileLoc, DSJ.ME)
how to read environment variable's valve in server routine
do i need to define anything
Thanks
Well
this is part of a job control code added automatically when adding a job with env variable as above
it compiles fine
Code: Select all
ErrCode = DSSetParam(hJob1, "$DS_ENABLE_RESERVED_CHAR_CONVERT", "True")
it compiles fine
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Hi All,
Thanks for your inputs.
Hi Ray,
The error message is as follows.
Compiling: Source = 'DSU_BP/DSU.ttrd', Object = 'DSU_BP.O/DSU.ttrd'
*
WARNING: Variable 'TestInput' never assigned a value.
Compilation Complete.
Pls let me know if any of the header file to be included.
Hi Benny,
I am trying to create this as new server routine.
Hi Roy,
Tried using the variable without $ but it did not work.
The test code is as follows.
SS = TestInput
If SS = 'S' Then
Ans = 'RRRR'
End
If SS <> 'S' Then
Ans = 'TTT'
End
TestInput has been defined as env variable in the Administrator.
Pls let me know your inputs.
Regards
Saravanan
Thanks for your inputs.
Hi Ray,
The error message is as follows.
Compiling: Source = 'DSU_BP/DSU.ttrd', Object = 'DSU_BP.O/DSU.ttrd'
*
WARNING: Variable 'TestInput' never assigned a value.
Compilation Complete.
Pls let me know if any of the header file to be included.
Hi Benny,
I am trying to create this as new server routine.
Hi Roy,
Tried using the variable without $ but it did not work.
The test code is as follows.
SS = TestInput
If SS = 'S' Then
Ans = 'RRRR'
End
If SS <> 'S' Then
Ans = 'TTT'
End
TestInput has been defined as env variable in the Administrator.
Pls let me know your inputs.
Regards
Saravanan
I have create a very simple routine only contain , but the output is string "$APT_CONFIG_FILE"
Code: Select all
Call DSLogInfo("$APT_CONFIG_FILE", 'RoutineName')
roy wrote:Wellthis is part of a job control code added automatically when adding a job with env variable as aboveCode: Select all
ErrCode = DSSetParam(hJob1, "$DS_ENABLE_RESERVED_CHAR_CONVERT", "True")
it compiles fine