Calling Command with Prompt from RPG ILE

15 pts.
Tags:
AS/400
RPG ILE
Hi Everyone, From my RPG ILE program, when I press F4, I want to have a Command Prompt screen similar to as if I typed CALL then F4 from the command line. What should I do to accomplish this? Thank you in advance. Lap Nguyen

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

You can try calling QCMDEXC with a ? in front of the command that you want prompted. For example if you wanted to prompt the WRKACTJOB command :-

CALL “QCMDEXC”
PARM COMAND 132
PARM 132 LENGTH 155

COMAND is 132 char and contains “? WRKACTJOB”, LENGTH is 15,5 dec and contains 132 (the length of your command string. There should be a space between the ? and the command.

There are better ways of doing this, but this is probably the quickest.

Regards,

Martin Gilbert.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • joederoche
    One thing that you can do is use to prototypes: To prompt the command use the follwoing: d Cmd S 2000A d ChkCmd PR ExtPgm('QCMDCHK') d CmdString 2000A d CmdStringLen 15P 5 Const d CmdOption 3A Const Options(*NoPass) /free Cmd = '?' + %Trim(W$OBJCMD); CallP(E) ChkCmd(Cmd:%Len(Cmd)); /end-free the W$OBJCMD contains an AS/400 command with parameters, ect. When the call is done, you can use the following: d Command S 2000A Inz Varying d ExecCmd PR ExtPgm('QCMDEXC') d CmdString 3000A Const Options(*VarSize) d CmdStringLen 15P 5 Const d CmdOption 3A Const Options(*NoPass) /free Command = Cmd CallP(E) ExecCmd(Command:%Len(Command)); /end-free This should allow you to place a command the CMD field; use the CHKCMD prototype, and then use that string that is returned to initiate a call to the processor on the 400. -Joe-
    55 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following