TAA Tools
FAVCMD          FAVORITE COMMAND                       TAACMEB

The Favorite Command  tool provides a  simple method of  executing your
favorite commands.   Your favorite  commands would be placed  in a data
base  file  by either  a  Work function  or an  Add  command.   The Add
command  extracts  the  previous  command  from  the   current  program
message  queue.    A  unique  ID  must be  assigned  to  each  favorite
command.   A  favorite  command is  then executed  by either  a special
command or from a display.

You must  first create  the files  used by  the  Favorite command  tool
such as:

            CRTFAVCMD   FAVCMDPLIB(xxx)

This  would normally  be  your current  library or  a  library on  your
library  list.  The  files FAVCMDP and  FAVCMDL would be  created.  See
the later discussion of Security Considerations.

The normal  method of  adding commands  to the  FAVCMDP file  would  be
with  the ADDFAVCMD  command.   Assume  you have  entered  one of  your
favorite  commands on a  command entry display  such as a  CPYF command
which  uses the same  set of complex  parameters.  You  now want to add
the specific CPYF  as one of  your favorite commands  and assign it  an
ID CPY1.

You would follow the CPYF command with ADDFAVCMD such as:

             CPYF       ....
             ADDFAVCMD  FAVID(CPY1)

The  ADDFAVCMD  extracts  the   previously  entered  command  from  the
current  program's message queue and  adds it to the  FAVCMDP data base
file.  The command string  can be any combination of upper/lower  case.

The next  time you  want to  execute the  same CPYF  command you  would
enter:

            FV CPY1

The FV  command is a shorthand version of  the EXCFAVCMD command.  Both
commands use the  same CPP.   FV  is preferred because  it reduces  the
number of keystrokes needed.

When the  FV  command runs,  it extracts  the record  from the  FAVCMDP
file  with a  key of  CPY1.   It  executes the  command  using QCMDEXC.
Before  executing  the  command,  the  command  is  sent  as  a request
message and then received.   This allows you to see the  actual command
that  was executed  and  you may  duplicate  it and  change  it as  any
normal  command.  Following the  command that is  executed would be the
last message  sent  by  the  executed command  (such  as  a  completion
message).

Thus for the CPYF command, you would see:

            FV CPY1
            CPYF      ...
            nnn records copied from ...

If FV  is used without  any parameters,  it uses the  DSPFAVCMD command
and  displays a subfile  of your favorite  commands.  Options  exist to
execute and for SBMJOB  for any favorite  command in the  file.  F4  is
also  available  to   prompt  for  the  command  before   execution  or
submitting  to  batch.    The  display  is  similar  to  the  WRKFAVCMD
display,  but no options  exist to change, add,  or delete the favorite
commands.

Using a ?  to prompt for a command
---------------------------------

You can use the  '?' option on WRKFAVCMD to  add a leading ?   to allow
prompting  for a  command  with  certain filled  in  parameters.   This
could  be   helpful  when  using  FV  when  some  standard  values  are
required, but still allow other parameters to be entered.

For example, the TAA DSPQHST2 command  allows a list of message IDs  to
be excluded with  the EXCLUDEID parameter.   You may want to  exclude a
standard list  and enter some unique values  for other parameters.  You
could enter the command:

             DSPQHST2

When the command prompt appears you  could enter in your standard  list
of message IDs to be excluded.

           DSPQHST2   EXCLUDEID(xxx yyy zzz)

You would then follow it with ADDFAVCMD such as:

           ADDFAVCMD  FAVID(QHST)

Then use  WRKFAVCMD and the '?'  option to add  a leading '?'  to cause
prompting.

When you  want to run the command with  the standard excluded list, you
would enter:

           FV QHST

The  command prompt would  appear and you  could enter other parameters
such as the beginning and ending dates.

WRKFAVCMD Command
-----------------

The WRKFAVCMD  command provides  an  editing function  for the  FAVCMDP
file.  The command would be entered as:

           WRKFAVCMD

A subfile is  displayed of your favorite commands  with typical options
for  display, change, delete, etc.  You  may also add favorite commands
using the F6 function.

You may  execute one of  your favorite  commands (Option  8) or  submit
the command to batch with SBMJOB (Option 9).

The Favorite Command  tool keeps track of  the last time you  have used
each  favorite command, the number  of times you have  used it, and the
last user profile  to cause  an action that  changes the  record.   The
information  is intended  to  assist  you  in maintaining  the  FAVCMDP
file.   The  date of  last use  is seen  on the  subfile display.   The
other information may be seen on the detail display.

You  may store any command in the  favorite command file.  For example,
you may  want  to store  some  SNDCMDDTAQ commands  as  defined by  the
CMDDTAQ TAA  Tool.  The  only restriction is  that the command  must be
valid for a command entry display.

You  may delete an entry from  the subfile with the  Delete option.  Or
the RMVFAVCMD  command  may  be used  to  remove one  of  the  favorite
commands from the file.

EXCFAVCMDL Command
------------------

The EXCFAVCMDL  (Execute Favorite Command  List) command allows  you to
execute  multiple commands in a  specified sequence.   IDs must already
exist in the  FAVCMDP file.   For  example, assume you  have added  the
individual commands:

       ID             Command
       --             -------

       A              CALL PGMA ...
       B              CALL PGMB ...

You can use EXCFAVCMDL as:

             EXCFAVCMDL  FAVID(A B)

This will execute both ID 'A' followed by ID 'B'.

You can then  add the EXCFAVCMDL command  to the FAVCMDP file  and give
it an ID such as:

             ADDFAVCMD   FAVID(AB)

The next time you need the same two IDs, you would specify:

             FV AB

Using a CLP program instead of EXCFAVCMDL
-----------------------------------------

You  may prefer  to use  a CL  program instead  of EXCFAVCMDL  to allow
better  error  handling.    Using the  same  FAVIDs  from  the previous
example, you could have a CL program named CALLAB as follows:

             PGM
             FV        A
             MONMSG    ... EXEC(DO)
                       /* Your error handling */
             ENDDO
             FV        B
             ENDPGM

After the program  is created, you  could call the  program and add  it
to the FAVCMDP file such as:

             CALL       CALLAB
             ADDFAVCMD  FAVID(AB)

Using SBMJOB
------------

If  you have  a command  that  you normally  submit to  batch, you  may
enter  the SBMJOB command and then use  ADDFAVCMD.  The complete SBMJOB
command  would be  entered  as  your  favorite  command  including  the
command that will be executed in batch.

Since the  command stored  in the  FAVCMDP file  is SBMJOB, you  should
not  use  the option  from  the  WRKFAVCMD subfile  for  SBMJOB  of the
favorite  command.    This  would  result  in  two  batch  jobs   being
submitted.

Multiple FAVCMDP files
----------------------

You may  have one or more  FAVCMDP files on  your system, but  only one
per  library.   The  intent  of the  tool  is to  allow  individuals to
tailor  the use for  their own needs.   See the  discussion on Security
Considerations.


Security Considerations
-----------------------

The Favorite  Command tool  does  not adopt  any authority.   The  user
must be authorized to any commands that will be executed.

When CRTFAVCMD  is run, the  user of the  command becomes the  owner of
the  two data base  files FAVCMDP and  FAVCMDL.  The  owner can perform
any functions against the files.

The FAVCMDP  physical  file  is  created  with  an  authorization  that
provides  for *PUBLIC  rights of  *OBJMGT, *READ,  and *UPD.   This  is
similar to *USE authority, but also allows update of the file.

By default,  the EXCFAVCMD (or FV)  command may be used  by the *PUBLIC
user to execute  any of the favorite  commands in the  file.  The  *UPD
right is  needed  because the  tool will  update the  data base  record
with the last used information.

The WRKFAVCMD  command will also  allow the *PUBLIC user  to access the
file,  display any favorite  command, and execute  a command.  However,
the WRKFAVCMD  command internally checks  for *ADD  and *DLT  authority
and  ensures  that  they  exist  for the  options  that  allow  change,
delete,  or to add  a new  record to the  file.   The ADDFAVCMD command
cannot be used by the *PUBLIC  user because *PUBLIC does not have  *ADD
and *DLT  rights.  Similarly, the  RMVFAVCMD command cannot be  used by
the  *PUBLIC user because *PUBLIC  does not have *ADD  and *DLT rights.

By default then, the *PUBLIC user can:

        - Use EXCFAVCMD (or FV) for any of the favorite  commands
        - Use WRKFAVCMD to display or execute any of the commands
        - Use DSPFAVCMD to display or execute any of the commands

By default, the *PUBLIC user cannot:

        - Use ADDFAVCMD
        - Use change, delete, or add from the WRKFAVCMD display.

However, because the  *PUBLIC user  has the  *UPD right  to FAVCMDP,  a
DFU application or  a HLL program could  be used to change  an existing
favorite  command.  Since  the *ADD  and *DLT  rights do not  exist, no
additions or deletions could be made.

You  may use EDTOBJAUT  of the FAVCMDP  file to make  the file excluded
to the  *PUBLIC user.   This  would make a  private file  for your  use
only or you could authorize specific individuals.

You  may  use  EDTOBJAUT  of   the  FAVCMDP  file  to  provide  *CHANGE
authority to  the *PUBLIC user or any user.   This will allow them full
access to the ADDFAVCMD and WRKFAVCMD functions.

CRTFAVCMD Command parameters                          *CMD
----------------------------

   FAVCMDPLIB    The  name  of  the  library  where  the   FAVCMDP  and
                 FAVCMDL files will be created.

                 The files  are created  to allow  the *PUBLIC user  to
                 use the  EXCFAVCMD (or FV) command.   *PUBLIC may also
                 use the  WRKFAVCMD command  to  display or  execute  a
                 favorite  command   (either  directly   or  by   using
                 OPTION(*DSP).     See   the   Security  Considerations
                 discussion.

   SRCLIB        The  source  library  to  use  for  the  QATTDDS  file
                 source.   The default  is  *TAAARC to  use the  source
                 from the TAA Archive.

                 A specific  user library may be named,  but the source
                 file must be QATTDDS.

WRKFAVCMD Command parameters                          *CMD
----------------------------

   FAVCMDPLIB    The  library which  contains  the FAVCMDP  and FAVCMDL
                 files created  by CRTFAVCMD.   The  default is  *LIBL.
                 A specific library or *CURLIB may also be used.

ADDFAVCMD Command parameters                          *CMD
----------------------------

   FAVID         The unique ID assigned to the favorite command.

   REPLACE       A  *YES/*NO  parameter  for   whether  to  replace  an
                 existing favorite ID with a different command.

                 *NO  is  the  default.   If  the  favorite ID  already
                 exists, an escape message is issued.

                 *YES  may  be   specified  to   replace  the   command
                 associated with the  favorite ID.  If the  favorite ID
                 does  not exist,  the command  is added  and ADDFAVCMD
                 completes normally.

   FAVCMDPLIB    The  library  which contains  the FAVCMDP  and FAVCMDL
                 files created  by CRTFAVCMD.   The  default is  *LIBL.
                 A specific library or *CURLIB may also be used.

EXCFAVCMD Command parameters (same for FV command)    *CMD
--------------------------------------------------

   FAVID         The unique  ID assigned to the favorite  command.  The
                 default  is *ALL  which causes the  DSPFAVCMD function
                 to be performed.   A subfile is  displayed of all  the
                 favorite  commands and  you may  execute  or submit  a
                 command to batch.

                 If  an ID  is entered,  it must  exist in  the FAVCMDP
                 file.

   FAVCMDPLIB    The library  which contains  the FAVCMDP  and  FAVCMDL
                 files created  by CRTFAVCMD.   The  default is  *LIBL.
                 A specific library or *CURLIB may also be used.

DSPFAVCMD Command parameters                          *CMD
----------------------------

   FAVID         The ID  to begin the subfile display.   The default is
                 *ALL  to display all the  records in the FAVCMDP file.

                 If  a value  is  entered,  it  acts as  a  'set  lower
                 limit'  to the  file.   For  example,  if you  entered
                 FAVID(JO),   the  display  would   contain  the  first
                 record starting at  JO.  If no  JO record exists,  the
                 first  record before  the  value  JO would  begin  the
                 subfile.

   FAVCMDPLIB    The  library which  contains  the FAVCMDP  and FAVCMDL
                 files created  by CRTFAVCMD.   The  default is  *LIBL.
                 A specific library or *CURLIB may also be used.

DLTFAVCMD Command parameters                          *CMD
----------------------------

   FAVCMDPLIB    The library  which  contains the  FAVCMDP and  FAVCMDL
                 files.   The default is *LIBL.   A specific library or
                 *CURLIB may also be used.

RMVFAVCMD Command parameters                          *CMD
----------------------------

   FAVID         The unique ID assigned to the favorite command.

   FAVCMDPLIB    The  library  which contains  the FAVCMDP  and FAVCMDL
                 files created  by CRTFAVCMD.   The  default is  *LIBL.
                 A specific library or *CURLIB may also be used.

EXCFAVCMDL Command parameters                         *CMD
-----------------------------

   FAVID         A list of  up to 25 IDs that are  in the FAVCMDP file.
                 Each  ID identifies  a command  to be executed.   They
                 will be executed consecutively.

   FAVCMDPLIB    The library  which contains  the FAVCMDP  and  FAVCMDL
                 files created  by CRTFAVCMD.   The  default is  *LIBL.
                 A specific library or *CURLIB may also be used.

Restrictions
------------

The command to be stored must be 750 bytes or less.

Prerequisites
-------------

The following TAA Tools must be on your system:

     ADJVAR          Adjust variable
     CHKOBJ2         Check object 2
     CPYTAA          TAA Archive
     EDTVAR2         Edit variable 2
     EXTCMD          Extract command
     FILEFDBCK       File feedback
     HLRMVMSG        HLL Remove message
     LOCKMSG         Lock message
     RPGSTSDS        RPG status data structure
     RCVLSTMSG       Receive last message
     RSNLSTMSG       Resend last message
     RTVDAT          Retrieve date
     SNDCOMPMSG      Send completion message
     SNDESCMSG       Send escape message
     SNDSTSMSG       Send status message
     TRNVAL          Translate value
     WRTSRC          Write source

Implementation
--------------

None, the tool is ready to use.

Objects used by the tool
------------------------

   Object        Type    Attribute      Src member    Src file
   ------        ----    ---------      ----------    ----------

   WRKFAVCMD     *CMD                   TAACMEB       QATTCMD
   CRTFAVCMD     *CMD                   TAACMEB2      QATTCMD
   EXCFAVCMD     *CMD                   TAACMEB3      QATTCMD
   FV            *CMD                   TAACMEB3      QATTCMD
   ADDFAVCMD     *CMD                   TAACMEB4      QATTCMD
   DLTFAVCMD     *CMD                   TAACMEB5      QATTCMD
   DSPFAVCMD     *CMD                   TAACMEB6      QATTCMD
   RMVFAVCMD     *CMD                   TAACMEB7      QATTCMD
   EXCFAVCMDL    *CMD                   TAACMEB8      QATTCMD
   TAACMEBC      *PGM       CLP         TAACMEBC      QATTCL
   TAACMEBC2     *PGM       CLP         TAACMEBC2     QATTCL
   TAACMEBC3     *PGM       CLP         TAACMEBC3     QATTCL
   TAACMEBC4     *PGM       CLP         TAACMEBC4     QATTCL
   TAACMEBC5     *PGM       CLP         TAACMEBC5     QATTCL
   TAACMEBC6     *PGM       CLP         TAACMEBC6     QATTCL
   TAACMEBC7     *PGM       CLP         TAACMEBC7     QATTCL
   TAACMEBC8     *PGM       CLP         TAACMEBC8     QATTCL
   TAACMEBC11    *PGM       CLP         TAACMEBC11    QATTCL
   TAACMEBR      *PGM       RPG         TAACMEBR      QATTRPG
   TAACMEBR3     *PGM       RPG         TAACMEBR3     QATTRPG
   TAACMEBR4     *PGM       RPG         TAACMEBR4     QATTRPG
   TAACMEBR6     *PGM       RPG         TAACMEBR6     QATTRPG
   TAACMEBR8     *PGM       RPGLE       TAACMEBR8     QATTRPG
   TAACMEBD      *FILE      DSPF        TAACMEBD      QATTDDS
   TAACMEBE      *FILE      DSPF        TAACMEBE      QATTDDS
   TAACMEBP      *FILE      PF          TAACMEBP      QATTDDS
   TAACMEBL      *FILE      LF          TAACMEBL      QATTDDS

The FV  command is a shorthand  version of the EXCFAVCMD  command.  The
same source is used for both command objects.

Structure
---------

CRTFAVCMD   Cmd
   TAACMEBC2  CL pgm

WRKFAVCMD   Cmd
   TAACMEBC    CL pgm
     TAACMEBR    RPG Pgm
       TAACMEBD    Display file
       TAACMEBC11  CL Pgm for command checking

EXCFAVCMD (also FV) Cmd
   TAACMEBC3   CL pgm
     TAACMEBR3   RPG Pgm

ADDFAVCMD   Cmd
   TAACMEBC4   CL pgm
     TAACMEBR4   RPG Pgm

DLTFAVCMD   Cmd
   TAACMEBC5   CL pgm

DSPFAVCMD   Cmd
   TAACMEBC6   CL pgm
     TAACMEBR6   RPG Pgm
       TAACMEBE    Display file

RMVFAVCMD   Cmd
   TAACMEBC4   CL pgm
     TAACMEBR4   RPG Pgm

EXCFAVCMDL  Cmd
   TAACMEBC8   CL pgm
     TAACMEBR8   RPG Pgm
					

Added to TAA Productivity tools October 1, 1997


Home Page Up to Top