× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Dean,

Dean.Eshleman@xxxxxxxxxxxxxx wrote:
I'm trying to use the CPYENVVAR *YES on the SBMJOB command and it doesn't 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 I type RMVENVVAR JDETESTVAR and run it again, ti comes back with '(not found)'

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...

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.