× 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 Mike,

In V4R3, IBM added a CPYENVVAR parameter to the SBMJOB command to let you copy environment variables from one job to another. Prompt the SBMJOB command, scroll down to the bottom, and hit HELP for more info.

The spawn() API also lets you copy environment variables when starting a new child job, and has had this capability since V3R6. If you're attempting to write an application that works similarly to a multi-threaded app, spawn() is probably a better fit than SBMJOB is.

More info on spawn() can be found here:
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/apis/spawn.htm

I don't think that multi-threaded support will make SBMJOB a thing of the past. There are some situations where people might use SBMJOB from RPG to try to replicate the behavior of a multi-threaded app, but in my experience, these are few and far between. For most cases, people will still use SBMJOB the way they always have.


Mike Cunningham wrote:
Thanks Scott. I will give this a try. I was doing some reading and
thinking overnight on environment variables. From what I have read
the environment variables are job specific and unlike the *LDA they
are not replicated to a submitted job. So environment variables would
be a good way to pass data between programs within on job but it
would not be a way to collect a bunch of run time options for a
report and then submit a job to run the report which would pick up
those environment variables and use them. But then maybe in V6R1 when
there is the ability to span a thread off an RPG application SBMJOB
might be a thing of the past. In the mean time, can you think of any
way that the interactive jobs environment could be replicated to a
submitted job?

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.