TAA Tools
PMTFLD          PROMPT FIELD                           TAADBHZ

The Prompt  Field  command is  intended to  be used  in an  application
where  the  user  should   select  a  few  fields  from  an  externally
described  data base  file.   A subfile is  displayed of  the fields in
the record  and the  user  can arrange  the fields  in  sequence.   The
fields are passed back in a return variable.

A typical command would be:

             DCL           &RTNLST *CHAR LEN(9000)
             DCL           &RTNCNT *DEC LEN(5 0)
              .
             PMTFLD        FILE(xxx) RTNLST(&RTNLST) RTNCNT(&RTNCNT)
             IF            (&RTNCNT *EQ 0) DO /* None selected */
              .
             ENDDO
             IF            (&RTNCNT *GT 0) DO /* Some selected */
              .
             ENDDO         /* Some selected */

The user  would see a  subfile for the  described file.  Each  field in
the  format   is  displayed  along  with  its  type,  length  and  text
description.

The user enters  his selections into  the subfile.   For example,  when
the subfile is  first displayed, the user  may enter X's to  select the
fields  he  wants.   When  the Enter  key  is pressed,  the  subfile is
sorted so that the  selected records appear at  the top.  New  sequence
numbers are  assigned (010, 020,  030...) and the  user can change  the
sequence  numbers to  arrange  the  order, eliminate  a  selected field
(blank  the sequence  number), or add  additional fields  by entering a
sequence number.

When the Enter  key is pressed without  having made any changes  on the
display, the selected  fields are passed back in  the RTNLST parameter.
The  RTNLST parameter provides  180 bytes per field  which includes the
name of  the field  and the  attributes (see  later  discussion).   The
RTNLST2 parameter  could have been specified.   It returns only  a list
of the field names.

If  the  user presses  F3  or  F12 before  or  entering  selecting some
fields, a  return count  of  0 and  a  blank list  are returned.    You
should program for this possibility.

An optional parameter  lets you define the  use of the F6  command key.
The  default is  that the  key is  not operable.    If operable,  F6 is
defined  as a  CA key.   When  pressed, the  1st element of  the return
list of  names  is set  to ***F6***  and  the count  is set  to  1.   A
typical use of F6 is when the user wants all of the fields.

Return list parameter
---------------------

The  RTNLST parameter must  be declared  as *CHAR  LEN(9000).   It will
contain  up to 50  selected fields.   Each field is  described with 180
bytes and  can  be  processed  with an  RPG  multiple  occurrence  data
structure.

The  definition  of  the  180  byte are  can  be  specified  using  the
Externally  described file  TAADBHZP.  It  contains field  names PMxxxx
which describe the field name, the type, the length in bytes, etc.

The  RPG  specification   to  define  the   multiple  occurrence   data
structure with the maximum of 50 occurrences would be as follows:

     IRTNDS     E DSTAADBHZP                 50

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

   FILE          The  qualified file  name  of the  file.   A  physical
                 file   or  a  single   format  logical  file   may  be
                 specified.    The  library  value  defaults  to *LIBL.
                 *CURLIB may also be used.

   RTNLST        The list of  returned fields that have  been selected.
                 The  variable must  be  declared  as *CHAR  LEN(9000).
                 Each  field takes  180 bytes.   The first  field is in
                 1-180, the second in 181-360,  etc.  The fields  which
                 are  not selected  are  blank.   For  example, if  the
                 user  has only  selected two  fields, positions  361 -
                 9000 will be blank.

                 Each returned field is a  data structure which can  be
                 defined  by  the  TAADBHZP external  file.    See  the
                 previous documentation for how to specify.

   RTNLST2       The list  of returned fields that  have been selected.
                 The  variable  must  be  declared  as  *CHAR LEN(500).
                 Only the field names are returned.

                 The 1st element  will contain  ***F6*** if the  F6TEXT
                 parameter is defined and the user presses F6.

   RTNCNT        A count of  the returned fields.  This  is an optional
                 return  variable and if specified  must be declared as
                 *DEC LEN(5 0).

                 If no fields  are selected (user  pressed F3 or  F12),
                 the count will be zero.

   MAXFLDS       The  maximum  number  of  fields  that  the  user  may
                 select.   If  the user  exceeds  the number,  an error
                 message  is   displayed.     This  is   designed   for
                 applications   that  cannot   process   more  than   a
                 specified  number  of  fields  being  returned.    The
                 default is 50.

   FLDTYP        The  field types  to be displayed.   *  is the default
                 for all field types.

                 A list  of up  to  20 values  may be  entered for  the
                 data base  field types of A, B,  D, E, F, G,  H, I, J,
                 L, M, N, O, P, S, T, W, X, Y, and Z.

   TITLE         The  title of the  screen.  The default  is *DFT which
                 produces a  value  of  'Prompt  fields'.    Up  to  30
                 characters  may  be  entered.     The  value  is  left
                 adjusted.   You may  choose to  insert leading blanks.

   SELTEXT       The  selection   text   which   appears   before   the
                 selection  prompt.     The   default  is  *DFT   which
                 produces a  message with the MAXFLDS  value within the
                 text  as 'Select up  to N fields,  and their sequence,
                 press Enter.'

   F6TEXT        The text  for  the F6  command key.    The default  is
                 *NONE  in  which  case  the  F6  command  key  is  not
                 operable.

                 If  text   is  entered,  it  should  be  in  the  form
                 'F6=...'.  Up to  15 bytes may  be entered.  The  text
                 will appear with  the other operable function  keys at
                 the bottom of the display.

                 F6  is  defined as  a  CA key  meaning  no  other data
                 comes into the  program if  the key is  pressed.   The
                 RTNCNT field is set  to 1 and the value  '***F6***' is
                 placed  in  the  1st  element  of the  RTNLST2  return
                 value.   The  corresponding RTNLST  value will  be all
                 blanks.

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

A physical or single format logical file may be specified.

Up to 998 fields may exist in the file.

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

The following TAA Tools must be on your system:

     FILEFDBCK       File feedback
     RTVFLDARR       Retrieve field array
     SNDESCMSG       Send escape message

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

None, the tool is ready to use.

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

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

   PMTFLD        *CMD                   TAADBHZ       QATTCMD
   TAADBHZC      *PGM       CLP         TAADBHZC      QATTCL
   TAADBHZR      *PGM       RPG         TAADBHZR      QATTRPG
   TAADBHZD      *FILE      DSPF        TAADBHZD      QATTDDS
   TAADBHZP      *FILE      PF          TAADBHZP      QATTDDS
					

Added to TAA Productivity tools December 1, 1996


Home Page Up to Top