Creating a shortcut on the AS/400 main menu

20 pts.
Tags:
AS 400
Hi, can anybody tell me how to shorten a command from the Main menu on the command line. I have created a crtcmd WA (short for WRKACTJOB) and a user defined option which work when you are on a STRPDM screen but not when on the main menu. It is a nuisance when needing to use this continually. I am having no luck. Julie


Software/Hardware used:
shortening a WRKACTJOB command
1

Answer Wiki

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

Depending on your systems software you may have to change the initial menu. It may currently be set only to accept valid menu options and will ignore any custom commands. Because you created the WA with the CRTCMD it will work any place you can enter a command, like the command line. IF you users do not have command line access,you may want to consider creating a custom menu. 

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.
  • azohawk

    @ToddN2000, I don't think she created a command, I think Julie created a shortcut option in PDM (and I have done the same thing). But that won't work on a command line.

    @Julie You have a couple of options. a) You can create a command with the CRTCMD command.  You would have to create a CL program that has the instruction WRKACTJOB in it and link your shorter instruction (i.e. WA) to call that program. or you could use the CRTCMD to link your new command to instructions in WRKACTJOB command (use DSPCMD to see the details).  b) you can add the option to a menu. But first, this requires you go back to that menu-which doesn't really resolve your issue; second, adding a menu option to a native menu is very likely to get wiped out with an OS update.  c) create a menu with commands you frequently use (WRKACTJOB, WRKLIB, WRKSPLF, WRKWTR, etc.), give it a short name (like your initials. then on a command line just type go xyz and take the menu option. d) I know that some have done this by altering the attention button function.-but not sure I can recommend that.  e) create a macro that will type WRKACTJOB on the command line and press enter.



    3,990 pointsBadges:
    report
  • WoodEngineer
    Hello Julie, we have done the same thing with other commands, such as XX for SIGNOFF.
    This should create your WA command which could then be executed from any command line which has your_lib in the library list.
    CRTDUPOBJ OBJ(WRKACTJOB) 
              FROMLIB(*LIBL) 
              OBJTYPE(*CMD)  
              TOLIB(your_Lib)  
              NEWOBJ(WA)     
    8,225 pointsBadges:
    report
  • ToddN2000
    We have very few custom commands but we did it with the CL program and CRTCMD. WE have a simple one of "S" for signing off the system.  They put the command in QGPL, not my first choice of libraries but I figured they put it here so it would remain during our software upgrades. The downside is if IBM decides to use it, you may lose it.

    Object      Type      Library     Attribute   Text     
    S             *PGM      QGPL        CLP         Sign Off.
    S             *CMD      QGPL                        Sign Off.


    125,840 pointsBadges:
    report
  • TheRealRaven
    For such a simple "shortcut", no CL programming is needed. Simple shortcuts are effectively directly supported. A specific requirement is that the command string be CHAR(32) or shorter.

    For a "WA" shortcut standing for WRKACTJOB, the command source is substantially like this:
    WA:          CMD        PROMPT('WRKACTJOB shortcut')
    
                 PARM       KWD(CMDSTR) TYPE(*CHAR) LEN( 9 ) +
                              CONSTANT('WRKACTJOB')
    
                 PARM       KWD(CMDLEN) TYPE(*DEC) LEN(15 5) CONSTANT( 9 )
    To create:
    CRTCMD CMD( WA )
           PGM(QSYS/QCMDEXC)
           ALLOW( *EXEC *INTERACT )
    Here's source for WUJ -- WRKUSRJOB STATUS(*ACTIVE).
    WUJ:        CMD        PROMPT('Work user jobs (*active)') +
                             ALLOW(*EXEC *INTERACT) MODE(*PROD) +
                             PRDLIB(*NOCHG)
    
                PARM       KWD(CMDSTR) TYPE(*CHAR) LEN(32) +
                             CONSTANT('wrkusrjob *n *active')
    
                PARM       KWD(CMDLEN) TYPE(*DEC) LEN(15 5) CONSTANT( 32 )
    It shows a minor variation of the CONSTANT() command string. It's all lower-case and uses positional parameters with a *N placeholder to help shorten the string by leaving the STATUS() parameter name off. A couple extra parameters are added to the CMD statement so that they can be left off of CRTCMD.

    Note that QSYS/QCMDEXC is always the CPP.
    32,380 pointsBadges:
    report
  • GregManzo
    CRTDUPOBJ (as suggested by WoodEngineer) is a simpler approach, and allows all the same parameters & options as the original command.
    2,905 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.

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

Following

Share this item with your network: