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



Either I'm completely lost (that's how I feel right about now) or you have
three different questions.

1) How do I run a program with a screen in batch?
2) How do I tell if I'm in batch?
3) How do I change the user profile of my job?

I understand how questions 1 & 2 are related, but I don't understand how
question #3. fits into the picture.  Is there some security obstacle that
you need to change user profiles to get past?

Yes, there are APIs that will change user profiles, but there are
"gotchas" in doing so.  Such as, you'll need the password of the user you
want to switch to, unless the job is being run as QSECOFR.  And, the
PSDS does not change when you switch them, since that's initialized
when the job starts, not when the API is called.   You could also adopt
authority, but since I have no idea why you're changing profiles, I don't
know what will and what won't solve your dilemna.

As for running the program in batch...   you can declare the display file
as USROPN and simply not open it and read/write from it if you're running
in batch.  You can detect whether you're running in batch either by using
the RTVJOBA TYPE(&var) CL command or the QUSRJOBI API.

But again, I don't understand why you're saying your problem is running
a program with a screen in batch, and that your question is how to switch
user profiles... the two things seem completely unrelated to me.

On Thu, 19 Jun 2003, John Furniss wrote:
>
> How would I determine who (or how) this program was called within the
> RPG program?
>
> Scott Klement wrote:
>
> > What does this have to do with the user name?!
> >
> > On Thu, 19 Jun 2003, John Furniss wrote:
> >
> > >     In pseudo code:
> > >     If <interactive job>
> > >         call PROGA as usual
> > >     Else   (batch job)
> > >          call PROGA without screen displays
> > >     Endif.

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.