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



I keep it simple this way:

DCL &TYPE *CHAR 1

RTVJOBA    TYPE(&JOBTYPE)                            
 IF (&JOBTYPE = '1') THEN(DO)                         

/*  Interactive Process to set job parameters */
/* Don't for get to allow for *INKC and other function keys */
/* If there are no other reason not to submit then: */

 SBMJOB     CMD(CALL PGM(AC0331C) PARM(&LIBRARY)) +   
              JOB(BLDSNDITM) JOBD(DPIJOBD)            
 RETURN                                               
 ENDDO                                                
/* The above code block will be skipped when the job is in batch */
/* Continue with processing the job */

ENDPGM

I use this template to reduce the number of objects that a processing
set has.  This way in almost all cases there is one CL and one RPG
object for any one job 

Hope this helps.

Marvin

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Tony Carolla
Sent: Thursday, September 08, 2005 1:35 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Detection of batch/interactive

Well, it's not so much avoiding CL, but trying to avoid using another 
language and program. The structure is more simple when you have one
command 
object pointing at one program object, rather than a command object, 
pointing at a CL program object, that submits a third RPG program
object. 
Simplification. 

On 9/8/05, Mohammad, Tanveer <TMohammad@xxxxxxxxxxx> wrote:
> 
> Not sure why you are avoiding CL but here is sample code I found for
> you!
> 
> http://www.thomasbishop.com/servlet/sql.tipView?key=6&category=API
> 
> 
> -----Original Message-----
> From: rpg400-l-bounces@xxxxxxxxxxxx
> [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Bob Cozzi
> Sent: Thursday, September 08, 2005 1:02 PM
> To: 'RPG programming on the AS400 / iSeries'
> Subject: RE: Detection of batch/interactive
> 
> Tony,
> If you don't have RPG xTools you have to call CL or the Job Info API.
If
> you
> have RPG xTools use the GetJobType() procedure. It returns "I" for
> Interactive, and "B" for batch.
> 
> -Bob Cozzi
> www.RPGxTools.com <http://www.RPGxTools.com>
> RPG xTools - Enjoy programming again.
> 
> 
> -----Original Message-----
> From: rpg400-l-bounces@xxxxxxxxxxxx
> [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
> On Behalf Of Tony Carolla
> Sent: Thursday, September 08, 2005 2:44 PM
> To: RPG programming on the AS400 / iSeries; RPGIV@xxxxxxxxxxxxxxx
> Subject: Detection of batch/interactive
> 
> I am writing an RPG program that I want users to run in batch mode. My
> standard solution to this is to write a CL program that submits the
RPG
> to
> batch, and point a CMD at the CL program. But I had this idea... What
if
> the
> 
> RPG could detect whether or not it was running in batch, and if it
> wasn't
> submit a job to batch, that would call the same program, and terminate
> the
> interactve one?
> 
> I have the logic mapped out in RPG, but I can't figure out how to
detect
> if
> the program is running in Batch. I don't see anything in the PSDS that
> shows
> 
> this... Can it be done?
> 
> --
> "Enter any 11-digit prime number to continue..."
> "In Hebrew SQL, how do you use right() and left()?..." - Random
Thought
> "If all you have is a hammer, all your problems begin to look like
> nails"
> --
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
> list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
> 
> 
> 
> 
> --
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
> list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
> 
> 
> 
> --
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
> 
> 



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.