Question

  Asked: Jun 11 2008   12:48 AM GMT
  Asked by: ShatteredRaven77


F9=Retrieve...


DSPF, AS/400 command functions, AS/400 command keys, RPGLE, Menu, QCMDEXC

I'm creating a DSPF and want to put in some common AS/400 command functions, and one of them would be to hit F9 to retrieve the last command entered. How would I go about doing this? I'm using a mock command line input field and would be sending any commands via QCMDEXC. Any ideas on the F9 feature?

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0




Hi,

I remember doing this many years ago. I seem to recall using the RCVMSG command to retrieve the last messages that were written to the joblog to retrieve the commands. Bear in mind that this may not work if you have no logging for your job.

Otherwise you could write your commands that you execute via QCMDEXC to a file, data queue, user space, etc and retrieve them yourself in your program.

Regards,

Martin Gilbert.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on AS/400 and Development.

Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

Sloopy  |   Jun 13 2008  3:32PM GMT

All you need to do is call QUSCMDLN (no parameters) from your program. This will bring up the command line window - the same one you get from SEU when you press F21.

It already has a full F9=Retrieve function, built in.

However, you would have no control over the commands that could be entered. What the user can do from that command line is limited only by their security level and user type.

If you use the RCVMSG method, you want to receive message of type *RQS.

Regards,

Sloopy

 

Vatchy  |   Jun 16 2008  4:29PM GMT

If you’re using the display file in RPG then just create an array in which to save the commands.