TAA Tools
RTVDSPFMT       RETRIEVE DISPLAY FILE FORMAT           TAADSPI

The  Retrieve Display  File  Format command  retrieves  the number  and
names of  the formats in  a display file.   A large  return variable is
provided  with the format names and  level IDs assigned to each format.
The command can  be used to  help determine if one  of the formats  has
changed since a program was last created that uses the file.

The API QDFRTVFD is used.

A maximum  of 400  formats may  be returned.   However, because  of the
variable  length  format returned  from  the  API, the  actual  size is
dependent on file and format  attributes.  the maximum may be  exceeded
before the 400 limit is reached.

The following  is CL code  that is  in a format  that may be  copied to
retrieve the information:

             DCL        &NBRFMTS *DEC LEN(5 0)
             DCL        &AREA *CHAR LEN(9200)
             DCL        &COUNT *DEC LEN(5 0)
             DCL        &WX *DEC LEN(5 0)
             DCL        &WORK23 *CHAR LEN(23)
             DCL        &FMTNAM *CHAR LEN(10)
             DCL        &LVLID *CHAR LEN(13)
              .
             RTVDSPFMT  FILE(xxx) NBRFMTS(&NBRFMTS) FMTAREA(&AREA)
             CHGVAR     &WX -22
 LOOP:       CHGVAR     &COUNT (&COUNT + 1)
             IF         (&COUNT *LE &NBRFMTS) DO /* Get format */
             CHGVAR     &WX (&WX + 23)
             CHGVAR     &WRK23 %SST(&AREA &WX 23)
             CHGVAR     &FMTNAM %SST(&WRK23 1 10)
             CHGVAR     &LVLID %SST(&WRK23 11 13)
                        /********************************************/
                        /*   Do your thing with FMTNAM and LVLID    */
                        /********************************************/
             GOTO       LOOP
             ENDDO      /* Get format */

RTVDSPFMT  escape messages you can monitor for
----------------------------------------------

      TAA9891    The file is not a display file.
      TAA9892    The maximum number of formats that can be returned
                   has been exceeded.

Escape messages from system commands will be re-sent.

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

   FILE          The qualified  name of the display  file.  The library
                 value defaults to  *LIBL.  *CURLIB  may also be  used.

   NBRFMTS       The  number of  formats  in  the  file.   This  is  an
                 optional  return   variable  that  if   used  must  be
                 declared as *DEC LEN(5 0).

   FMTAREA       The  format names and level IDs  of each format.  This
                 is an optional  return variable that  if used must  be
                 declared as *CHAR LEN(9200).

                 Each  entry is  23  bytes  made up  of  a format  name
                 (bytes  1 - 10) and the level  ID of the format (bytes
                 11 - 23).

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

Because the command  returns variables,  it may  only be used  in a  CL
program.

A maximum  of 400  formats may be  returned.   However, because  of the
variable  length  format returned  from  the API,  the  actual  size is
dependent on file and format attributes.   the maximum may be  exceeded
before the 400 limit is reached.

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

The following TAA Tools must be on your system:

     EDTVAR          Edit variable
     SNDESCMSG       Send escape message

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

None, the tool is ready to use.

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

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

   RTVDSPFMT     *CMD                   TAADSPI       QATTCMD
   TAADSPIC      *PGM       CLP         TAADSPIC      QATTCL
					

Added to TAA Productivity tools March 1, 1999


Home Page Up to Top