TAA Tools
SORTRPGARR      SORT RPG ARRAY                         TAARPHW

The  Sort  RPG  Array  command  sorts  compile  time  array  data  into
ascending  sequence for  a named array  in an  RPG type  source member.
This  simplifies making source changes to  compile time array data when
it is required to be in ascending sequence.

You must  have *OBJOPR,  *OBJMGT, *READ,  *ADD, and  *DLT authority  to
the file to use SORTRPGARR.

A typical command would be:

              SORTRPGARR  ARRAY(xxx)  MBR(yyy)

Each  source record  prior  to the  compile  time array  data would  be
copied  to a  temporary source  member in QTEMP.   The  specified array
name is searched for.   When the array data  is read in the source,  it
is  copied to  an internal  array,  sorted in  ascending sequence,  and
then  output  to the  temporary  source  file.   The  remainder  of the
source (additional compile time  array data) if any  is then copied  to
the temporary  source  member.   The temporary  source  member is  then
copied back to the original source member.

Additional comments

  **   Only  the  RPG source  type  is supported  and  must have  valid

  **   Multiple  compile time arrays  may exist.   The named array data
       may be anywhere  in the sequence (it  does not have to  be first
       or last).

  **   The  sort  occurs on  the  entire  source  statement so  only  a
       single  element  per array  data  is valid.   If  more  than one
       element  per  statement  is  specified,  an  escape  message  is

  **   If data  from an  alternating array exists  in the  compile time
       array data, it remains in the resequenced data.

  **   When  the source is  written back  from the temporary  member to
       the named member, the sequence numbers are reset.

  **   The source statement date  value in the  compile time data  that
       is  resequenced is  changed  to  the  current date.    No  other
       source statement dates are changed.

SORTRPGARR escape messages you can monitor for

None.  Escape messages from based on functions will be re-sent.

SORTRPGARR Command parameters                         *CMD

   ARRAY         The  array  name to  sequence  the  compile time  data

   MBR           The member to be processed.

   SRCFILE       The  qualified  name of  the source  file to  be used.
                 QRPGSRC is the  default.   The library value  defaults
                 to *LIBL.   A specific library or *CURLIB  may also be


See the Additional comments section.


The following TAA Tools must be on your system:

     CHKDBFMBR       Check data base file member
     RSNLSTMSG       Resend last message
     RTVDAT          Retrieve date
     RTVVALA         Retrieve value attributes
     SNDCOMPMSG      Send completion message
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message


None, the tool is ready to use.

Objects used by the tool

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

   SORTRPGARR    *CMD                   TAARPHW       QATTCMD
   TAARPHWC      *PGM       CLP         TAARPHWC      QATTCL
   TAARPHWR      *PGM       RPG         TAARPHWR      QATTRPG

Added to TAA Productivity tools April 15, 2011

Home Page Up to Top