|
Scott,
Thanks for testing my code. I was changing the size of the parameter on
PGMB to match the size of the variable name I was testing at the time and
I forgot to change it before I posted the code. I guess my next step is
to see if there are any PTF's related to the SBMJOB command unless you or
someone else has another suggestion.
Dean Eshleman,
MMA, Inc.
On Wed, 09 Dec 2009 17:27:48 -0600, in midrange.midrange-l you wrote:
Hi Dean,for
I tried your code. It works for me both interactively and in batch on
both my V5R4 system and my V5R3 system. No problems on either system.
The only caveat, though, is the parameter to PGMB is only 9 characters
long. The string 'JDETESTVAR' is 10 characters... As long as you pass
a blank parameter to PGMB, it doesn't matter, because PGMB will then
substitute the right value. But, if you pass JDETESTVAR as a parameter,
it fails because JDETESTVAR just doesn't fit in a 9A field.
Dean.Eshleman@xxxxxxxxxxxxxx wrote:
Hi Scott,
I'm glad to hear it does work. However, I still can't get it to work
variable.me. What is interesting is if I call my program interactively, it can
retrieve my *JOB environment variable just fine. If I submit the same
program to batch and specify CPYENVVAR *YES, it can't find the
submitI'm using the DSPLY opcode in RPG to display what it finds. If I
variable,the same program to batch and request a system level environment
Thisit can retrieve that one successfully.
The "getenv" procedure is wrappered in an RPGLE program called PGMA.
Hereprogram has been in production for 3 or 4 years without any problems.
ofis the code for that program.
http://code.midrange.com/0c8c121182.html
I created anothe RPGLE program, PGMB to call PGMA and pass in the name
the Environment variable I want to retrieve. I use the DSPLY opcode to
Idisplay the output from PGMA. Here is the code for that program.
http://code.midrange.com/a494836cc9.html
Activation groups wouldn't have anything to do with it would they?
Dean Eshleman,
MMA, Inc.
On Tue, 08 Dec 2009 16:01:37 -0600, in midrange.midrange-l you wrote:
Hi Dean,doesn't
Dean.Eshleman@xxxxxxxxxxxxxx wrote:
I'm trying to use the CPYENVVAR *YES on the SBMJOB command and it
seem to be working for me. We are at V5R3.It's working for me.
I tried the following test:
ADDENVVAR ENVVAR(JDETESTVAR) VALUE('test')
SBMJOB CMD(CALL ENVMSG) CPYENVVAR(*YES)
To test it, I wrote the following ILE CL program (unfortunately, I
didn't notice that you were at V5R3... this code uses V5R4 features):
PGM
dcl var(&null) type(*char) len(1) value(x'00')
dcl var(&var) type(*char) len(129)
dcl var(&nptr) type(*ptr)
dcl var(&len) type(*int) len(4)
dcl var(&ptr) type(*ptr)
dcl var(&val) type(*char) len(1025) stg(*based) basptr(&ptr)
dcl var(&msg) type(*char) len(1024)
/* Retrieve the JDETESTVAR environment variable */
chgvar var(&var) value('JDETESTVAR' *TCAT &null)
callprc prc('getenv') parm(&var) rtnval(&ptr)
/* Set the &msg variable to the value of JDETESTVAR +
or to (not found) if not found, or (blank) if empty */
if (&ptr *eq &nptr) do
chgvar &msg value('(not found)')
enddo
else do
callPrc prc('__strlen') parm(&val) +
rtnval(&len)
if (&len *le 0) do
chgvar &msg value('(blank)')
enddo
else do
chgvar &msg value(%sst(&val 1 &len))
enddo
enddo
/* Send Scott the message. */
sndmsg msg(&msg) tousr(klemscot)
endpgm
When I run it, I successfully get back a message that says 'test'. If
individual or entity named. If you are not the intended recipient, do nottype RMVENVVAR JDETESTVAR and run it again, ti comes back with '(notfound)'
So it seems to be working for me.
Perhaps there's a bug in the way you're retrieving or setting the
variable? One common mistake... environment variable names are
cAsE-seNsiTivE. Make sure you match upper/lower case...
______________________________________________________________________
Confidentiality Notice: This information is intended only for the
use or disclose this information. If you received this e-mail in error,
please delete or otherwise destroy it and contact us at (800) 348-7468 so
we can take steps to avoid such transmissions errors in the future. Thank
you.
______________________________________________________________________
Confidentiality Notice: This information is intended only for the individual or entity named. If you are not the intended recipient, do not use or disclose this information. If you received this e-mail in error, please delete or otherwise destroy it and contact us at (800) 348-7468 so we can take steps to avoid such transmissions errors in the future. Thank you.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.