Command line in AS/400

275 pts.
Tags:
AS/400
AS/400 Command Line
Command Prompt screen
Command Prompt window
If I have a program with 2 screens. how I can add a command line

at the bottom of my screen. what command or procedure I usRegards

 

M Khan



Software/Hardware used:
software
ASKED: September 10, 2010  10:57 PM
UPDATED: September 14, 2010  7:12 AM

Answer Wiki

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

the program you want is QCMD. you can call this from QCMDEXEC inside your program or set it up as a external prototype and call it with your command line as the parameter.

d Command Pr ExtPgm(‘QCMD’)
d CMD 300

/Free
CMD = ‘DSPJOB’;
Command(CMD);
/End-Free

i have not tested the above code……..it may need some tweaking.

d qCmdExc pr ExtPgm(‘QCMDEXC’)
d Command 50a Const Options(*VarSize)
d Len 15p 5 Const
d Flag 3a Const Options(*NoPass)

/Free
Command = ‘DSPJOB’;
Call qCmdExc(Command : %Len(Command);
/End-Free

i have tested this with other commands, but not with QCMD. i dont know why this wont work though.

-Sarge

Discuss This Question: 5  Replies

 
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
  • TomLiotta
    Should we assume that you are asking about interactive programming on the AS/400 line of systems? You don't actually create "command lines" unless perhaps you are creating UIM applications with UIM panels. For most DSPFs, you simply define an input field and process the input as a command string -- e.g., you pass the string to QCAPCMD (or QCMDEXC or a related function) for actual processing. You choose which function-keys to implement. For example, if you want to implement <F9=Retrieve>, you either keep track of everything that has been entered into your input field or you extract each *RQS (Request) message out of the program's message queue. If you want <F4=Prompt>, then you prepend a "?" onto the string before passing it to the API. Overall, you simply create an input field and pass the input to a command-processing API. There are plenty of details such as function keys, messages from the command, handling <SysReq-2> for EndRequest and others; but a command line is just an input field. What you do with the input is up to your programming. Tom
    125,585 pointsBadges:
    report
  • khan23
    Yes it is an interactive program with 2 screens. First one asks to enter an option 1 and the next screen has 12 options. I just want to see AS/400 normal command line. I am not an experienced programmer and I do not know if I should ask this question or not.
    275 pointsBadges:
    report
  • Batman47
    There are lots of ways to get a command line: CALL QCMD, WRKSPLF, WRKOUTQ, WRKSBMJOB, GO MAIN, GO MAJOR (Major Command Groups, useful if you want to go command crazy). These are all options that you can plug into a menu. However, we have our users 'Limited Capability' set to '*NO' on their user profile to prevent from using the command line. You and other folks in IT would need to set this to '*YES'. Of course, security is a whole other subejct. Good luck.
    1,050 pointsBadges:
    report
  • Batman47
    Wow, sorry for giving the wrong info about Limited Capabilities. For users, set to *YES to prevent them from using the command line. IT users should have it set to *NO.
    1,050 pointsBadges:
    report
  • TomLiotta
    I just want to see AS/400 normal command line. You can't create a "normal command line". All you can create is an input field. You create it the same way you create any input field. The only thing that makes it like a "normal command line" is that you call one of the command-processing APIs and pass the input valu as a parm to the API. If you want your input field to support everything that a "normal command line" supports, then you write all of the support in your own programming. The API will execute the command and do all of the processing over the command itself, but you will write everything that extra such as retrieving previous commands. For users, set to *YES to prevent them from using the command line. A minor clarification is that LMTCPB(*YES) does not prevent the use of a command line. On a "normal command line", it prevents using commands that have the ALWLMTUSR(*NO) attribute set. Commands that do not have that attribute set can still be used by those users on any command line. The attribute can be changed with the CHGCMD command to turn it on or off. If you don't review all of the commands on your system, you don't know which ones can be run by your users. (Almost all IBM commands have the attribute set by default.) It also doesn't necessarily prevent users from using a command line such as the one discussed in this thread unless the API enforces it. (Numerous other methods exist for those users to run those commands.) Tom
    125,585 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