TAA Tools
SORTSRC         SORT SOURCE                            TAASRFN

The  Sort Source  command allows  a  range of  source  statements in  a
source  member to  be sorted.   The default  is to  sort on  the entire
source  data value.   From/To positions  may be specified.   The output
is always  to  the SORTSRC  member  of the  TAASORTSRC source  file  in
QTEMP.  You may  then use the SORTSRC member to copy  to wherever it is
needed.

To  sort  the  DCL  statements in  a  CL  program,  use  the SORTCLPDCL
command.  To sort RPG array data, use the SORTRPGARR command.

A typical SORTSRC command would be:

             SORTSRC   SRCFILE(fff) SRCMBR(mmm)
                         FROMSTMT(105.00) TOSTMT(125.00)

The source member would be  read and the statements between 105.00  and
125.00  would be  written to  a  work file.    The work  file would  be
sorted in  ascending sequence and copied to  the TAASORTSRC source file
in QTEMP.

If you wanted the  sorted statements to replace  those in the  original
file, you must  use SEU and the  copy function to replace  the records.

Note that  if you have  lower case values,  they are sorted  per EBCDIC
value.  For example, if your data contains:

         SHARE
         Spool

The  data will be reversed because the  lower case 'p' sorts before the
upper case 'H'.

SORTSRC escape messages you can monitor for
-------------------------------------------

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

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

   SRCFILE       The qualified name  of the source file  containing the
                 source statements to be sorted.

                 The library  qualifier defaults to *LIBL.   A specific
                 library may be named or the special value *CURLIB.

   SRCMBR        The source member of the source file to be sorted.

   FROMSTMT      The  From statement number in the  source member.  The
                 number should be  entered with a  decimal point.   For
                 example, if the  first number you want  to describe is
                 displayed  with SEU as  105.00, enter 105.00.   If the
                 number  does  not  exist,   no  error  occurs.     The
                 FROM/TOSTMT parameters act as a range.

   TOSTMT        The To  statement number  in the  source member.   The
                 number should  be entered with  a decimal point.   For
                 example,  if the last  number you want  to describe is
                 displayed with SEU  as 125.00, enter  125.00.  If  the
                 number does not exist, no error occurs.

   SEQ           The  sequence of  the sort.   *ASCEND  is  the default
                 for  ascending sequence.    *DESCEND may  be specified
                 for descending sequence.

   FROMPOS       The From position  within the  record to describe  the
                 sort field.  The default is 1.

   TOPOS         The  To position  within  the record  to describe  the
                 sort  field.   The default  is  *END meaning  the last
                 position in the source data.


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

A source file of up to 240 bytes in length must be specified.

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

The following TAA Tools must be on your system:

     CHKOBJ3         Check object 3
     EDTVAR          Edit variable
     HLRMVMSG        HLL Remove message
     RSNLSTMSG       Resend last message
     RTVDAT          Retrieve date
     RTVDBFA         Retrieve data base file attributes
     SNDCOMPMSG      Send completion message
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message
     SORTDBF         Sort data base file

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

None, the tool is ready to use.

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

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

   SORTSRC       *CMD                   TAASRFN       QATTCMD
   TAASRFNC      *PGM       CLP         TAASRFNC      QATTCL
   TAASRFNR      *PGM       RPG         TAASRFNR      QATTRPG
   TAASRFNR2     *PGM       RPG         TAASRFNR2     QATTRPG
					

Added to TAA Productivity tools July 15, 2013


Home Page Up to Top