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

There was a thread on this list around 12 March 2008 titled "How to get job
type". My response was:

<snip>
If you don't want to go to the trouble of creating a simple sub-procedure to
return the values you want or having a CLLE module bound to the program then
you have a couple of choices:

1) If your workstation names follow any sort of convention, e.g.
QPADEVxxxx, then you could simply pull the job name from the PSDS and check
it. It's not pretty, but may be sufficient for your needs.

2) Place a call to the QUSRJOBI system API. This can take minimal coding if
all you want is the one piece of information as the sample program shows.
You can cut this down further if you need to:

D oRcvVar s 85a
Inz(*Blanks)
D iRcvVarLen s 10i 0
Inz(%Len(oRcvVar))
D iFormat s 8a
Inz('JOBI0100')
D iQualJob s 26a
Inz('*')
D iIntJobID s 16a
Inz(*Blanks)



D RtvJobInf pr
ExtPgm('QUSRJOBI')
D oRcvVar
85a
D iRcvVarLen 10i 0
Const
D iFormat 8a
Const
D iQualJob 26a
Const
D iIntJobID 16a
Const



D JobType s
1a



C CallP(e) RtvJobInf(oRcvVar : iRcvVarLen :
iFormat :
C iQualJob :
iIntJobID)



C If Not
%Error
C If Not %Error
C Eval JobType = %Subst(oRcvVar : 61 : 1)
C JobType Dsply
C EndIf

C Eval *InLR = *On

</snip>

All the best

Jonathan


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of James Lampert
Sent: 10 April 2008 18:16
To: RPG programming on the AS400 / iSeries
Subject: Quick question: identifying whether running batch or interactive

How can an RPG program tell whether it's running in a terminal session
or a batch job?


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.