TAA Tools
SCNUSRSPC       SCAN USER SPACE                        TAASPCL

The  Scan User  Space command  provides  a method  of  scanning a  user
space for  a value.  A  return parameter exists for  the start position
of  the value.   The  function is  supported on the  DSPUSRSPC command.
SCNUSRSPC may only be used in a CL program.

A typical series of commands would be:

             DCL           &RTNPOS *DEC LEN(9 0)
              .
             SCNUSRSPC     USRSPC(xxx) SCNVAL(ABC) RTNPOS(&RTNPOS)
             IF            (&RTNPOS *EQ 0) DO /* Not found */

                                /* Your code for not found */

             ENDDO         /* Not found */

                                /* Your code for found */

The value ABC  would be scanned  for in the specified  user space.   If
not found,  a 0  would be  returned.  If  found, the  starting location
where the value exists is returned.

The maximum size user space is supported.

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

   USRSPC        The   qualified  name   of  the   user  space   to  be
                 displayed.  The  library defaults  to *LIBL.   *CURLIB
                 may also be specified.

   SCNVAL        The value to  be scanned for.   Up to 20 bytes  may be
                 entered.   The value  is automatically  trimmed to the
                 last blank.

                 The value  must  be entered  in  the proper  case  (no
                 folding to upper case occurs).

   STRPOS        The  position  within  the user  space  to  begin  the
                 scan.  The default is 1.

   RTNPOS        The  position within  the user  space where  the value
                 was  found.   This is a  return variable  that must be
                 declared  as  *DEC  LEN(9  0).    A   0  return  value
                 indicates the scan value was not found.

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

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

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

The following TAA Tools must be on your system:

     EDTVAR          Edit variable
     RTVUSRSPCA      Retrieve user space attributes
     RTVVALA         Retrieve value attributes
     SNDESCMSG       Send escape message

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

None, the tool is ready to use.

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

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

   SCNUSRSPC     *CMD                   TAASPCL       QATTCMD
   TAASPCLC      *PGM       CLP         TAASPCLC      QATTCL
					

Added to TAA Productivity tools May 1, 1998


Home Page Up to Top