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



Not so fast. What you've done is replaced the routing program, not the
command processor. Eventually the command has to get to the command
processor.

So a job starts and that routing program runs. As soon as it hands control
off to the next program in the program stack, it won't get back to the
routing program until that program ends. That's not the command processor.
Most routing programs do the following (including QCMD) :
* Set the attention key if desired
* Set the initial iASP if there is one (SETASPGRP)
* Call the initial program on the users initial program parameter
* Go to the initial menu set on the user profile
* Loop back to the initial menu

Once your program stack includes the initial application it won't get back
there until the user leaves the initial program. Then control is handed
over to the menu system. The routing program will not be able to grab each
command as it's entered.



--
Jim Oberholtzer
Agile Technology Architects


-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of
Charles Wilt
Sent: Tuesday, August 30, 2016 10:09 AM
To: Midrange Systems Technical Discussion
Subject: Re: Replace command processor

Vern's on the right track...

If you look at the routing entries of QINTER...you'll see for example:
Seq Nbr Program Library Compare Value
10 QCMD QSYS 'QCMDI'
15 QCMD QSYS 'QIGC'
20 QCMD QSYS 'QS36MRT'
40 QARDRIVE QSYS '525XTEST'
700 QCL QSYS 'QCMD38'
9999 QCMD QSYS *ANY


Those routing entries determine which program get's control of a job.

That last line, defaults an interactive job into QCMD.

Replace that line with your own, and you've substituted your command
processor for QCMD.

Charles

On Tue, Aug 30, 2016 at 9:19 AM, Vernon Hamberg <vhamberg@xxxxxxxxxxxxxxx>
wrote:

Paul

Have you considered changing the class used for interactive? I believe
you can specify the program associated with it.

Of course, anything you change is at your own risk, right?

Vern


On 8/30/2016 7:35 AM, Paul Nicolay wrote:

Hi Chris,

Guess I've seen this before (my current fake command line is
something similar)... but you need to call this new command processor
yourself (for example in the initial program), it's not that it
replaces QCMD by default or can even do so ?

Also if you enter for example WRKSPLF on this command processor, it
offers you a new command line which is the default systems command
processor... and not yours.

Kind regards,
Paul
________________________________________
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxx> on behalf of Chris
Pando <chris.pando@xxxxxxxxx>
Sent: Monday, August 29, 2016 23:59
To: Midrange Systems Technical Discussion
Subject: Re: Replace command processor

On Mon, Aug 29, 2016 at 6:29 AM, Paul Nicolay
<paul.nicolay@xxxxxxxxxx>
wrote:

?Hi,


I wonder if it is possible to replace the OS/400 command processor ?

I would like to be able to control the command (ie. additional
verifications and/or change) before it is executed.

Kind regards,
Paul

A replacement for QCMD? Absolutely. What does QCMD do? It attempts to
retrieve a *RQS message from the *EXT message queue. If any requests
are there, QCMD executes them(1). If the message queue does not have
any requests, the command entry screen is displayed. After a string
is typed and enter is hit, it (essentially) drops the string into a
QCMDEXC and executes it. You can do all of this yourself, inserting
whatever behavior you want, and defaulting to executing the command
as entered (essentially a giant Select, with the Other clause
executing the string). Search on writing a request-processor program.
https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_72/
rbam6/wrppg.htm

I haven't used QCMD since it was QCL (I learned how to do all of this
from the CPF 3.0 Programmer's Guide). A stripped down bare bones
example can be found at:
http://code.midrange.com/35edc13a37.html). It was pointed out
elsewhere that allowing a System Request could result if falling out
to the (true) command entry screen, which would constitute a security
vulnerability - the referenced program does *not* allow this.

My command processor is considerably more complicated than the
contrived example (I've been working on it more than 30 years), but I
included the logic for 'stealth' mode (I can turn logging on and
off), and the logic for command prompting (the trickiest part of all
of this).

(1) This makes writing a CL source member interpreter trivial:
http://brilligware.com/cp0050.html

Hope some of the above is useful.

Chris Pando
chris@xxxxxxxxx
www.brilligware.com - the home of MineSweeper5250!
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.


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.