TAA Tools
ALCTMPMBR       ALLOCATE TEMPORARY MEMBER              TAATMPC

The Allocate  Temporary Member  command is  designed for a  performance
advantage  for  those  programs  that  need  a  temporary  file.    For
example,  if a  CL program  is creating an  outfile that  it only needs
for  the  duration  of  the  program,  ALCTMPMBR  can  be   used  as  a
performance  advantage rather  than writing  the  file to  QTEMP.   The
same is true for temporary source files and work files.

The  functions which  create  a file  and add  a member  are relatively
slow.  In addition,  a program which needs  a temporary file should  be
coded to ensure it  has the correct format for the file  to be written.
This normally  means the program would attempt to  delete a file of the
same name in  QTEMP (monitor for  the 'not found'  escape message)  and
then create  the file  using the appropriate  DSP or  CRT command.   At
some point (such  as end of job), the file  and member must be deleted.

This overhead can be avoided by using the ALCTMPMBR command.

The  ALCTMPMBR  command  has  provided  typical  outfiles  in  TAATOOL.
Multiple members exist in each  of the files.  When ALCTMPMBR  is used,
it  attempts to allocate  one of  the members  for the  requesting job.
The  allocated  member  name is  passed  back.   The  member  names are
MBR0001, MBR0002 etc.   in each  of the files.   Normally, the  program
will  not care  what the  member name  is,  but only  use the  variable
value.   If all of the existing members are  allocated, a new member is
added.

The companion  command is  DLCTMPMBR.   It should  be  issued when  the
member  is no  longer  needed.   It  will  clear  the member  and  then
deallocate the member.

Standard  file names  are used  in TAATOOL  and must  be used  with the
program  using ALCTMPMBR.   A return  parameter eliminates  the need to
know the details.  The file names are described in a later section.

        ******************************************************
        *                                                    *
        *   The member is cleared on each use of ALCTMPMBR   *
        *                  and DLCTMPMBR.                    *
        *                                                    *
        ******************************************************

Both ALCTMPMBR and DLCTMPMBR adopt the command processing program (CPP)
owners authority.  This  allows  the  members  to  be  cleared or added
regardless of who  issues  the commands and also allows the files to be
excluded from the general use by the public for other commands.

If DLCTMPMBR is  not issued and another  ALCTMPMBR is issued, the  same
member may or  may not be allocated again (it  would be cleared first).
If  the same member  is used, an  additional lock occurs  (same rule as
ALCOBJ).  If DLCTMPMBR is not  used, the member will still contain  any
data written  to it and  the lock  will be released  at the end  of the
job.

No  error occurs if DLCTMPMBR  attempts to deallocate a  member it does
not have a lock on (same as DLCOBJ).

Typical use
-----------

An outfile  is needed  of the  members in  file SOURCE  in LIB1.    The
DSPFD *MBRLIST function will  be used.  The outfile is  only needed for
the  duration of the  program.   Rather than  write the file  to QTEMP,
ALCTMPMBR  will be  used.  The  member name returned  by ALCTMPMBR will
be used to  determine which member  in a file  in TAATOOL can  be used.
The file  names in  TAATOOL are TAATMPxxxx  where the xxxx  is replaced
with  the  type  of request.    You  must specify  a  variable  for the
RTNFILE parameter.    This variable  is  then  used in  the  subsequent
commands and  eliminates the need to  know the file  naming convention.
When  the member  is no longer  needed, the  DLCTMPMBR command  is used
with the same member name.

             DCLF       FILE(QAFDMBRL) /* DSPFD Member list outfile */
             DCL        &MBR *CHAR LEN(10)
             DCL        &FILE *CHAR LEN(10)
                        /* ALCTMPMBR returns an allocated member */
                        /*   and the file it exists in.          */
             ALCTMPMBR  FILETYPE(*MBRL) RTNMBR(&MBR) RTNFILE(&FILE)
             DSPFD      FILE(LIB1/SOURCE) TYPE(*MBRLIST) +
                          OUTPUT(*OUTFILE) +
                          OUTFILE(TAATOOL/&FILE) OUTMBR(&MBR)
             OVRDBF     FILE(QAFDMBRL) TOFILE(TAATOOL/&FILE) +
                          MBR(&MBR) SECURE(*YES)
 READ:       RCVF       /* Read a record */
             MONMSG     MSGID(CPF0864) EXEC(GOTO EOF)
                        /* Your code to process the member */
             GOTO       READ /* Loop back for next record */
 EOF:                   /* All records have been read */
             RCVMSG     MSGTYPE(*EXCP) /* Remove EOF message */
             DLCTMPMBR  FILETYPE(*MBRL) ALCMBR(&MBR)
             RETURN     /* Normal end of program */

Cleanup of the files
--------------------

If you use  ALCTMPMBR,  you  should  also use the CLNTAATEMP command to
cleanup the files. CLNTAATEMP should be submitted periodically. See the
description of it.

New release and re-create implications
--------------------------------------

When the TAATOOL  library is create  on a new  release, the  TAATMPxxxx
files  in TAATOOL  are  deleted  and  re-created automatically.    This
ensures  that  the description  of  the files  will  match the  current
release.

If  you re-create the  tool, the files  will also be  deleted if a lock
can be  established.   If a  member  is currently  allocated, the  file
cannot  be  deleted.    The   next  time  CRTTAATOOL  is  used  or  the
CLNTAATEMP  command, the  file will  again attempt  to be  allocated to
allow re-creation.

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

   FILETYPE      The file  type  to be  used.    The valid  values  are
                 described in a later section.

   RTNMBR        The name of  the allocated member that  is returned to
                 your program.   It must be  declared as *CHAR LEN(10).
                 This is  the name  that  you must  use on  the  DSPxxx
                 command and the OVRDBF command.

   RTNFILE       The name  of the  file that  is used in  TAATOOL.   It
                 must  be declared as  *CHAR LEN(10).   The  file names
                 used   are   standard,   but   this   required   value
                 simplifies  what you  need  to  code so  that  only  a
                 variable  name need  be specified  on the  DSP command
                 and the OVRDBF command.

   INTFILE       The  internal file name.  This  prompt does not appear
                 unless F9 is pressed.   The internal file is  designed
                 for use  within the  TAA tools.   You  should not  use
                 this parameter.

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

   FILETYPE      The  file  type to  be  used.   The  valid  values are
                 described in a later section.

   ALCMBR        The name  of the  allocated  member.   Normally,  this
                 will be  the same  variable name  as was  used on  the
                 ALCTMPMBR command.

   INTFILE       The internal  file name.  This prompt  does not appear
                 unless  F9 is pressed.   The internal file is designed
                 for use  within the  TAA tools.   You  should not  use
                 this parameter.

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

The command can only be entered in a CL program.

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

The following TAA Tools must be on your system:

         SNDESCMSG      Send escape message

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

None, the tool is ready to use.

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

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

   ALCTMPMBR     *CMD                       TAATMPC       QATTCMD
   DLCTMPMBR     *CMD                       TAATMPC2      QATTCMD
   TAATMPCC      *PGM           CLP         TAATMPCC      QATTCL
   TAATMPCC2     *PGM           CLP         TAATMPCC2     QATTCL

The files  described  in  a  later  section are also created in TAATOOL
using the corresponding commands for outfiles or CRTPF/CRTSRCPF.

Structure
---------

ALCTMPMBR
    TAATMPCC    CL pgm

DLCTMPMBR
    TAATMPCC2   CL pgm

File names used
---------------

The file names used  are  all  TAATMPxxxx in TAATOOL. The xxxx value is
changed to  be  the  same as the ALCTMPMBR FILETYPE parameter requested
without the *.

 FILETYPE     File name in TAATOOL     Used for
 --------     --------------------     --------

 *OBJD          TAATMPOBJD             DSPOBJD
 *OBJA          TAATMPOBJA             DSPOBJAUT
 *MBR           TAATMPMBR              DSPFD TYPE(*MBR)
 *MBRL          TAATMPMBRL             DSPFD TYPE(*MBRLIST)
 *PF            TAATMPPF               DSPFD TYPE(*ATR) FILEATR(*PF)
 *LF            TAATMPLF               DSPFD TYPE(*ATR) FILEATR(*LF)
 *ACCP          TAATMPACCP             DSPFD TYPE(*ACCPTH)
 *DBR           TAATMPDBR              DSPDBR
 *XREF          TAATMPXREF             DSPPGMREF
 *SRC           TAATMPSRC              Note 1
 *SRC2          TAATMPSRC2             Note 1
 *SRC3          TAATMPSRC3             Note 1
 *SPLF          TAATMPSPLF             Note 2
 *WRK           TAATMPWRK              Note 3
 *INT           xxxx                   Note 4

  1.   *SRC, *SRC2, *SRC3  are source files for temporary  source.  The
       source area is 240 bytes.

  2.   *SPLF  is intended for those cases where  a spooled file must be
       read.    The  file  is  256  bytes  in  length  and  is  program
       described.

  3.   *WRK  is intended  for those  cases where  a work  file must  be
       used.    The  file  is  1000  bytes  in  length and  is  program
       described.

  4.   *INT is for internal use within  the TAA tools.  You should  not
       use this value.
					

Added to TAA Productivity tools April 1, 1995


Home Page Up to Top