TAA Tools
CVTSPLNBR       CONVERT SPOOLED FILE NUMBER            TAASPMB

The Convert Spooled  File Number command  converts the 6  digit decimal
value  passed from a  typical SPLNBR command  prompt to  a 5 or  6 byte
character  variable for  use in commands  using a  spooled file number.
Two return parameters (length 5  or 6) will contain *ONLY, *LAST,  or a
specific  spooled file  number.   CVTSPLNBR  is useful  when writing  a
user command with a SPLNBR parameter.

The command definition for a SPLNBR parameter would be:

             PARM       KWD(SPLNBR) TYPE(*DEC) LEN(6 0) DFT(*ONLY) +
                          SPCVAL((*ONLY 0)(*LAST -1)) +
                          RANGE(1 999999) +
                          PROMPT('Spooled file number')

The typical use of CVTSPLNBR would be:

             DCL        &SPLNBR *DEC LEN(6 0)
             DCL        &RTNSPLNB2 *CHAR LEN(6)
              .
             CVTSPLNBR  SPLNBR(&SPLNBR) RTNSPLNBR(&RTNSPLNB2)
              .
             xxxSPLF    ...  SPLNBR(&RTNSPLNB2)

For  example,  if the  user of  the  command enters  SPLNBR(*LAST), the
command definition converts  the value to -1.   CVTSPLNBR converts  the
value  back  to  *LAST  for  use   on  a  command  requiring  a  SPLNBR
parameter.

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

   SPLNBR        The  spooled file number  to be converted.   The value
                 is typically a  6 digit decimal  field containing  the
                 special values 0  (*ONLY), -1 (*LAST) or a  specific 6
                 digit spooled file number.

   RTNSPLNBR     The  return spooled  file number.    This was  the old
                 return  value  when  spooled  file  numbers  could not
                 exceed 4 digits.

                 The variable  must  be declared  as  *CHAR LEN(5)  and
                 will  contain  *ONLY,  *LAST,   or  a  4  digit  (left
                 justified)  specific  spooled  file  number.   If  the
                 spooled file number is greater  than 9999, 0s will  be
                 returned.

   RTNSPLNB2     The return  spooled file  number.   The variable  must
                 be  declared as *CHAR  LEN(6) and  will contain *ONLY,
                 *LAST, or a 6 digit specific spooled file number.


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

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

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

None.

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

None, the tool is ready to use.

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

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

   CVTSPLNBR     *CMD                   TAASPMB       QATTCMD
   TAASPMBC      *PGM       CLP         TAASPMBC      QATTCL
					

Added to TAA Productivity tools January 1, 1998


Home Page Up to Top