TAA Tools

The  Edit  Large   Variable  command  provides  editing  for   a  large
character variable  that contains numeric data.   Some system functions
return  large character variables that exceed  15 digits and place them
in *CHAR  variables.    A  *CHAR input  value  of  up to  30  bytes  is
supported.    The  return  CHROUT  value  must  be  declared  as  *CHAR
LEN(43).  RPG type edit codes are used.

See  also the CLCLRGVAR  tool command to perform  calculations on large

A typical series of commands would be:

             DCL        &CHAR43 *CHAR LEN(43)
             EDTLRGVAR  CHROUT(&CHAR43) NUMINP(&xxx)

The &xxx value  must be a *CHAR  variable (or literal)  up to 30  bytes
in length.   The value  is right adjusted  before editing.   The edited
return value in the &CHAR42 variable would be left adjusted.

The defaults used are:

             EDTCDE   = J
             NBRDEC   = 0
             SIGN     = +
             LDGSYM   = *NO

For example, if &xxx contained:


The &CHAR42 return value would be:


If NBRDEC(2) had been specified, the return value would be:


Number of decimals

EDTLRGVAR  only operates  on a  whole number (no  decimal point).   You
can specify the  number of decimal  positions in the  return value  for
presentation purposes.

If  you are  dealing  with a  large  value that  contains  a number  of
decimal positions other  than 0, you will need  to convert the value to
a  whole number before using EDTLRGVAR.   For example, it the value has
2 decimal positions, you could do the following:

             DCL        &CHAR43 *CHAR LEN(43)
             DCL        &WHOLENBR *CHAR LEN(30)
             CLCLRGVAR  OPER(*MULT) FACTOR1(&xxx) FACTOR2(100)

NUMINP rules and examples

  **   Up to 30 bytes in a *CHAR variable (or literal).

  **   Leading blanks or zeros are valid.

  **   Trailing  blanks are  valid  (because  the date  will  be  right
       adjusted before editing).

  **   Embedded  blanks  or  non-digits  are  not valid  in  the  input

  **   A  minus sign  or decimal  notation are not  valid in  the input
       value.  See the SIGN and NBRDEC parameters.

Examples where 'b' is equal to blank.

         Valid Values


         Invalid values                         Reason
         --------------                         ------

         '1 3'                                  Embedded blank
         '123.45'                               Non-digit
         '123A45'                               Non-digit
         '12345-'                               Non-digit
         '-12345'                               Non-digit
         '12,345'                               Non-digit

EDTLRGVAR escape messages you can monitor for

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

EDTLRGVAR Command parameters                          *CMD

   CHROUT        The edited  return  value.   It  must be  declared  as
                 *CHAR  LEN(43).    The  edited   value  will  be  left
                 adjusted followed by blanks.

   NUMINP        The  value to  be edited.   It may  up to 30  bytes in
                 length.  The  value is right  adjusted before  editing
                 begins.   The value may  not contain  embedded blanks,
                 a  minus sign,  nor other  non-digit values.   Leading
                 blanks  or  zeros  are  valid.    Trailing  blanks are

   SIGN          Whether the  NUMINP value  should  be considered  plus
                 or minus.

                 '+' is the default,

                 '-' may  be entered for  a negative value.   Note that
                 the  NUMINP value  cannot  contain a  minus sign.   If
                 SIGN(-) is entered, the  edited result will contain  a
                 trailing  '-'  or  'CR'  depending on  the  edit  code

   NBRDEC        The  number of  decimal positions  to  be used  in the
                 CHROUT value.  The default is  0.  It must be a  value
                 between 0 and 9.

                 Note that the  NUMINP value may not contain  a decimal
                 position.   You must  use a  whole number as  an input
                 value,  but  the NBRDEC  parameter  lets you  edit the
                 value as  if it  had decimal positions.   The  decimal
                 format  of the  job  determines  the decimal  notation

   EDTCDE        The edit code to be used for editing.

                 The valid values are:

                    1 2 3 4 A B C D J K L M N O P Q

                 The  edit codes have the same  meaning as the RPG edit
                 codes.   Date editing  via the  'Y' edit  code is  not
                 supported nor  is the 'W'  edit code for  time editing
                 supported by EDTVAR.

                 'J'  is  the  default  which  provides for  separation
                 characters, a trailing minus  sign (if negative),  and
                 at  least  one  zero  for  an  all  zero  input  value
                 (multiple zeros  are inserted after  the decimal point
                 if any).

                 Use  DSPEDTCDE  for  a review  of  the  supported edit
                 codes and the results.

                 The edit code also  controls the result if the  NUMINP
                 value is  0 (such as  whether blanks appear,  a single
                 zero, or a value such as '.00').

                 Note  that  the  system  defined  edit  codes  are not

   LDGSYM        A *YES/*NO parameter  for whether  a leading  currency
                 symbol should appear in the result.

                 *NO is the default for no leading currency symbol.

                 *YES may be  specified to begin the  CHROUT value with
                 a  leading currency symbol.   The QCURSYM system value
                 determines the currency symbol used.


Because EDTLRGVAR returns a  value, the command may  only be used in  a
CL like program.


The following TAA Tools must be on your system:

     ADJVAR          Adjust variable
     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
   ------        ----    ---------      ----------    ----------

   EDTLRGVAR     *CMD                   TAACLUC       QATTCMD
   TAACLUCC      *PGM       CLP         TAACLUCC      QATTCL

Added to TAA Productivity tools October 15, 2012

Home Page Up to Top