TAA Tools
CVTFRMSPLF      CONVERT FROM SPOOLED FILE              TAASPME

The Convert  From Spooled File  tool supports  both the CVTFRMSPLF  and
CVTTOSPLF  commands.  CVTFRMSPLF  converts a  spooled file to  a member
in   a  data  base  file.    Spool  APIs  are  used  so  there  are  no
restrictions  on the  the  type  of  data or  attributes  that  can  be
converted.  CVTTOSPLF converts a member back to a spooled file.

Once the  spooled file has been converted  to a data base  file, it can
have  normal data base  operations performed such as  save and restore,
transfer to another system, etc.

Also see the tool CVTFRMOUTQ  which provides conversion of all  spooled
files in an output queue.

The  data base  file  named is  automatically created  if  it does  not
exist.    SIZE(*NOMAX) is  used  for  each member.    Member  names are
automatically  assigned  using   a  naming   convention  of   MBR00001,
MBR00002, etc.  The text description of the member includes:

        Spooled file name
        Qualified job name
        Spooled file open date

The  DSPMBRS TAA  command  may be  used  to display  a  subfile of  the
members in the data base file.

A typical command to convert the spooled file would be:

            CVTFRMSPLF   FILE(xxx) JOB(yyy) CVTSPLP(zzz)

If the  CVTSPLP file does not  exist in the specified  library, it will
be  created.  The first  member is assigned the name  MBR00001.  If the
file already  exists, the  new  member name  is derived  from the  last
member name in the file.

To convert the  data base member back to a spooled  file, the user must
be authorized to the TAACVTSPLF authorization list.

A  typical command  to  convert the  data base  file  member back  to a
spooled file would be:

            CVTTOSPLF    MBR(MBRnnnnn) CVTSPLP(zzz)

You may  optionally change  one of  the following  as  the the  spooled
file is written:

            Spooled file name
            Output queue
            Spooled file owner

A  separate  command RTVCVTSPLD  exists  to  allow  a retrieve  of  the
spooled file description that was converted.

A  separate  command  DSPCVTSPLD exists  to  display  the spooled  file
description of a member.

Authority
---------

The commands all allow public use.

To use CVTFRMSPLF,  the user must  be authorized to  the spooled  file.
If the  file named on  the CVTSPLP parameter  already exists, the  user
must be authorized to add a member.

To  use CVTTOSPLF, the  user must  be authorized  to the file  named on
the  CVTSPLP parameter,  the output queue  where the  spooled file will
be created,  and have *USE  authority to  the TAACVTSPLF  authorization
list.

Comparison with CVTFRMOUTQ
--------------------------

The CVTFRMOUTQ  tool provides a  means of converting all  spooled files
in  an output queue (those that  are not in a status  of 'Open').  Each
spooled file in the output  queue is determined and CVTFRMSPLF is  used
on each.

The companion command is CVTTOOUTQ.

Comparison to CPYFRMOUTQ
------------------------

The  CPYFRMOUTQ tool  uses  the system  CPYSPLF  command  to convert  a
spooled  file to a data  base file.   This is adequate  for simple use,
but  the  CVTFRMSPLF  command  (and  CVTFRMOUTQ)  offer  the  following
advantages:

  **   No restrictions  exist regarding the  type of  data that can  be
       converted.   CPYSPLF does  not retain special  printer graphics.

  **   The  spooled file attributes  are retained.   The data base base
       file created  by CPYSPLF  does not  contain any  of the  spooled
       file  attributes such  as  page size,  characters  per inch,  or
       form type.

  **   The   convert  performance  is  much   better  with  CVTFRMSPLF.
       System APIs are used to write  the data to a user space where  a
       program  then rewrites  the data  to  a data  base file  member.
       CPYSPLF must  regenerate each print line from  the form which is
       kept internally.  The API writes  the internal form to the  user
       space.

Spooled files without any data
------------------------------

It is possible to create  a spooled file without any print  data.  This
could  occur  if a  program  opened  a spooled  file,  did  a skip  and
printed a blank line.

If  such a  file exists  and is attempted  to be  displayed, CPF3429 is
issued with an appropriate reason code.

If such a spooled file is  used with CVTFRMSPLF, no error occurs.   The
exact same spooled  file will be created by CVTTOSPLF  and will also be
non-displayable.

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

   FILE          The spooled file name to be converted.

   JOB           The  qualified name of the job  which owns the spooled
                 file.  The default is * meaning the current job.

   SPLFNBR       The number  of  the  spooled  file.   The  default  is
                 *ONLY  meaning there  is  only a  single spooled  file
                 using the FILE name in the job.

                 *LAST  may be specified meaning  if there are multiple
                 files of the  same name  in the  job to  use the  last
                 one.

                 A  number  1  - 9999  may  be  named  for  a  specific
                 spooled file number.

   CVTSPLP       The  file to  output the  converted spooled  file data
                 to.   CVTSPLP  is the  default.   The library defaults
                 to *LIBL.   *LIBL  may not be  used if  the file  does
                 not exist on the library list.

                 If  the file  does not  exist and  a member  is named,
                 the  file  will  be created  and  the  assigned member
                 name will be  MBR00001.  If  the file already  exists,
                 the  assigned member  name will  be  one greater  than
                 the last member name in the file.

                 The  file to  be used  must be  a data  physical file.
                 Source files or  logical files  may not be  used.   If
                 you   create  your   own   file  (rather   than   have
                 CVTFRMSPLF  or   CVTFRMOUTQ  create  the   file),  use
                 CRTDUPPF of the file TAASPMEP in TAATOOL.

   TEXT          The  text  description  for  the  CVTSPLP  file.   The
                 default  is  *DFT  meaning  1)  If  the  CVTSPLP  file
                 exists,  the  text  is  not  changed  and  2)  If  the
                 CVTSPLP  file does not  exist, default text 'Converted
                 spooled file' is used.

                 If a  value is  entered, it  becomes the  text of  the
                 CVTSPLP file.

   DTAARA        A  *YES/*NO  parameter  for whether  to  place  member
                 information  in the TAACVTSPL  data area.   *NO is the
                 default meaning the member  information is not  placed
                 in the TAACVTSPL data area in QTEMP.

                 If  *YES is  specified,  the  TAACVTSPL data  area  of
                 type  *CHAR and length  of 100  will be created  if it
                 does  not exist  and the  data will  appear as follows
                 in the data area.

            1 - 10  Member name
           11 - 20  Spooled file name
           23 - 32  Job name
           33 - 42  User name
           43 - 48  Job number
           51 - 57  Spooled file open date

   FRCMBR1       A  *YES/*NO  parameter  for  whether  to   always  use
                 MBR00001  as the  member  name.   *NO  is the  default
                 which means the member name is assigned normally.

                 *YES  may be specified  to always use  MBR00001 as the
                 member name.   This  is intended  for application  use
                 where  the CVTSPLP  file  will be  used  for a  single
                 member only.

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

   MBR           The  member name  to be converted.   Member  names are
                 assigned a value of MBR00001, MBR00002, etc.

                 The member  text  description  contains  the  original
                 spooled file  name, the  qualified job  name, and  the
                 spooled file  open date.  The TAA  Tool DSPMBRS may be
                 used  to display a subfile  of the existing members in
                 the file.

                 The member must  have been  written by the  CVTFRMSPLF
                 or the CVTFRMOUTQ commands.

   CVTSPLP       The  file  where  the   converted  spooled  file  data
                 exists.     CVTSPLP  is  the  default.    The  library
                 defaults to *LIBL.

   SPLFNAME      The name  of the  spooled  file to  be written.    The
                 default  is  *SAME  meaning   the  same  name  as  the
                 original file is used.

   OUTQ          The   qualified  name  of  the   output  queue  to  be
                 assigned to the  spooled file.   The default is  *SAME
                 meaning  the  same   output  queue  as   the  original
                 spooled  file.   If  no  library  is  named, the  same
                 library  as  the original  spooled file  is used.   If
                 *SAME is used and  the original output queue  does not
                 exist on th

                 *SAME  may be  used for  the same  output queue  and a
                 different library named.

                 If  a different output  queue is named  and no library
                 qualifier exists, *LIBL is assumed.

   OWNER         The owner  of the  spooled file  to be  written.   The
                 default  is  *SAME  meaning  the  same  owner  as  the
                 original  spooled   file.    If  *SAME  is  used,  the
                 original owner  name must  be a  user profile  on  the
                 current  system  and   the  job  name  that   will  be
                 assigned is QPRTJOB.

                 *CURRENT may  be entered to allow the  current user to
                 become  the owner of  the spooled file.   The job name
                 assigned will be the current job.

   HOLD          Whether to  hold the  spooled  file.   The default  is
                 *SAME  meaning  the same  value  as  when the  spooled
                 file was converted.

                 *NO may be specified to not hold the spooled file.

                 *YES may be specified to hold the spooled file.

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

   CVTSPLP       The  file   where  the  converted  spooled  file  data
                 exists.    CVTSPLP  is  the  default.     The  library
                 defaults to *LIBL.  *CURLIB may also be specified.

   MBR           The member name to retrieve the description for.

                 The  default is  *FIRST for  the first  member of  the
                 file.

                 Member  names   are  assigned  a  value  of  MBR00001,
                 MBR00002, etc.    by  the  CVTFRMSPLF  command.    The
                 member must  have been  written by  the CVTFRMSPLF  or
                 the CVTFRMOUTQ commands.

   RTNLIB        The library  name where the  CVTSPLP file exists.   An
                 optional   return   value  which   if  used   must  be
                 specified  as  *CHAR  LEN(10).    This  value  may  be
                 helpful  if  a library  qualifier  such  as *LIBL  was
                 used.

   RTNMBR        The  member name  in  the CVTSPLP  file.   An optional
                 return value  which  if  used  must  be  specified  as
                 *CHAR  LEN(10).    This  value may  be  helpful  if  a
                 *FIRST was specified for the MBR parameter.

   SPLF          The  name of  the spooled  file.   An  optional return
                 value  which  if  used  must  be  specified  as  *CHAR
                 LEN(10).

   JOB           The name of the  job that wrote the spooled  file.  An
                 optional   return  value   which  if   used   must  be
                 specified as *CHAR LEN(10).

   USER          The  name  of the  user that  wrote the  spooled file.
                 An  optional  return  value  which  if  used  must  be
                 specified as *CHAR LEN(10).

   JOBNBR        The  job number  of  the job  that  wrote the  spooled
                 file.   An  optional return  value which if  used must
                 be specified as *CHAR LEN(6).

   SPLFNBR       The spooled  file  number of  the  spooled file.    An
                 optional   return  value   which  if   used  must   be
                 specified as *CHAR LEN(5).

   OPENDATE      The  date  the  spooled  file  was  opened in  CYYMMDD
                 format.  An optional return  value which if used  must
                 be specified as *CHAR LEN(7).

   OPENTIME      The  time  the  spooled  file  was  opened  in  HHMMSS
                 format.   An optional return value which  if used must
                 be specified as *CHAR LEN(6).

   OUTQ          The  output  queue of  the  spooled file  when  it was
                 converted.   An optional  return value  which if  used
                 must be specified as *CHAR LEN(10).

   OUTQL         The output  queue library of the spooled  file when it
                 was  converted.   An  optional return  value  which if
                 used must be specified as *CHAR LEN(10).

   SYSTEM        The system the  spooled file was  converted from.   An
                 optional   return  value   which  if   used  must   be
                 specified as *CHAR LEN(8).

   PAGES         The  number  of   pages  in  the  spooled  file.    An
                 optional  return   value  which   if  used   must   be
                 specified as *DEC LEN(9 0).

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

   CVTSPLP       The  file  where  the  converted   spooled  file  data
                 exists.    CVTSPLP   is  the  default.    The  library
                 defaults to *LIBL.  *CURLIB may also be specified.

   MBR           The member name to retrieve the description for.

                 The  default  is *FIRST  for the  first member  of the
                 file.

                 Member  names  are  assigned  a  value   of  MBR00001,
                 MBR00002,  etc.    by  the CVTFRMSPLF  command.    The
                 member  must have  been written  by the  CVTFRMSPLF or
                 the CVTFRMOUTQ commands.

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

Any use of CVTTOSPLF assumes  that either CVTFRMSPLF or CVTFRMOUTQ  was
used to create the member.

Spooled files in an 'Open' status cannot be converted.

You  should  not  make  any  modifications to  the  data  in  the  file
containing the converted data.

The   member  must  have   been  created  from   either  CVTFRMSPLF  or
CVTFRMOUTQ.

RTVCVTSPLD will only  operate on a  member that was  created by  either
CVTFRMSPLF or CVTFRMOUTQ.

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

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

The following TAA Tools must be on your system:

     CHKOBJ3         Check object 3
     CRTDUPPF        Create duplicate physical file
     CRTUSRSPC       Create user space
     CVTSPLNBR       Convert spooled file number
     HLRMVMSG        HLL Remove message
     RPGSTSDS        RPG Status DS
     RTVDBFA         Retrieve data base file attributes
     RTVSPLFID       Retrieve spooled file ID
     RTVSYSVAL3      Retrieve system value 3
     RTVVALA         Retrieve value attributes
     SNDCOMPMSG      Send completion message
     SNDESCMSG       Send escape message

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

None, the tool is ready to use.

The   user  of  CVTTOSPLF   must  be   authorized  to   the  TAACVTSPLF
authorization list.

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

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

   CVTFRMSPLF    *CMD                   TAASPME       QATTCMD
   CVTTOSPLF     *CMD                   TAASPME2      QATTCMD
   RTVCVTSPLD    *CMD                   TAASPME3      QATTCMD
   DSPCVTSPLD    *CMD                   TAASPME4      QATTCMD
   TAASPMEC      *PGM       CLP         TAASPMEC      QATTCL
   TAASPMEC2     *PGM       CLP         TAASPMEC2     QATTCL
   TAASPMEC3     *PGM       CLP         TAASPMEC3     QATTCL
   TAASPMEC4     *PGM       CLP         TAASPMEC4     QATTCL
   TAASPMER      *PGM       RPG         TAASPMER      QATTRPG
   TAASPMER2     *PGM       RPG         TAASPMER2     QATTRPG
   TAASPMER3     *PGM       RPG         TAASPMER3     QATTRPG
   TAASPMER11    *PGM       RPG         TAASPMER11    QATTRPG
   TAASPMEP      *FILE      PF          TAASPMEP      QATTDDS
   TAASPMED      *FILE      DSPF        TAASPMED      QATTDDS
   TAACVTSPLF    *AUTL

The TAACVTSPLF authorization list is in QSYS.


Structure
---------

CVTFRMSPLF  Cmd
   TAASPMEC   CL pgm
     TAASPMER   RPG Pgm
     TAASPMER11  RPG Pgm

CVTTOSPLF   Cmd
   TAASPMEC2   CL pgm
     TAASPMER2   RPG Pgm

RTVCVTSPLD  Cmd
   TAASPMEC3   CL pgm
     TAASPMER3   RPG Pgm

DSPCVTSPLD  Cmd
   TAASPMEC4   CL pgm
     TAASPMED    Dsp file
					

Added to TAA Productivity tools July 1, 1998


Home Page Up to Top