TAA Tools
RTVCCSID        RETRIEVE FILE CCSID                    TAADBLB

The Retrieve  File CCSID (Code  Character Set  ID) command retrieves  a
summary  of the  CCSIDs specified  for a  data base  file.   CCSIDs are
assigned  to each  field in  a file  and normally all  character fields
will use  the same  CCSID.   If different  CCSIDs are  used within  the
file, different  processing may  be required.   RTVCCSID allows  you to
determine  if a  file uses  a standard CCSID  for all  character fields
and what the value is.

The system  does  not allow  a  CCSID keyword  to  be specified  for  a
decimal field.   However, the  system assigns a  CCSID of 65535  to all
decimal fields.

Because RTVCCSID  returns information to CL  variables, the command may
only be used in a CL program.

A typical command would be:

             DCL        &SAMECCSID *DEC LEN(5 0)
              .
             RTVCCSID   FILE(xxx) SAMECCSID(&SAMECCSID)

If all  character  fields in  the  file all  use  the same  CCSID,  the
&SAMECCSID  variable will  contain  the CCSID.    If some  fields  have
different  CCSIDs, the  &SAMECCSID return  variable  will be  zeros and
the CHRLIST return variable will contain a summary.

If  the CCSIDs  differ, the  DSPCCSID command may  be used  to list the
values for each field.

RTVCCSID escape messages you can monitor for
--------------------------------------------

      TAA9891    The file is a source file and has no CCSIDs

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

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

   FILE          The qualified name of  the data base file  to retrieve
                 the  CCSIDs  from.    The library  value  defaults  to
                 *LIBL.  *CURLIB may also be used.

   ALLSAME       A  *YES/*NO return  value  that describes  whether all
                 CCSIDs  in  the  file  are  identical.    This  is  an
                 optional return value  that if used must  be specified
                 as *CHAR LEN(4).

   SAMECCSID     The value  of the CCSID if all  CCSIDs within the file
                 have the same  value.   Zeros are  returned if  CCSIDs
                 differ.   This  is an  optional return  value that  if
                 used must be specified as *DEC LEN(5 0).

   NBRCHRFLD     The number  of character fields  in the format  of the
                 file.   This is an optional  return value that if used
                 must be specified as *DEC LEN(5 0).

   CHRLIST       The list of  CCSIDs used  for character fields  within
                 the  file  and a  count  of each  used.    This is  an
                 optional  return value that if  used must be specified
                 as *CHAR LEN(2000).

                 Up to 200 10  byte entries may  exist.  Each entry  is
                 made up of:

                  1 - 5   CCSID
                  7 - 10  Number of fields using that CCSID

                 Any excess entries will be blank.

   NBRDECFLD     The  number of  decimal fields  in the  format of  the
                 file.   This is an optional return  value that if used
                 must be specified as *DEC LEN(5 0).

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

Because RTVCCSID returns information to  CL variables, the command  may
only be used in a CL program.

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

The following TAA Tools must be on your system:

     RSNLSTMSG       Resend last message
     RTVDBFA         Retrieve data base file attributes
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message

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

None, the tool is ready to use.

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

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

   RTVCCSID      *CMD                   TAADBLB       QATTCMD
   TAADBLBC      *PGM       CLP         TAADBLBC      QATTCL
					

Added to TAA Productivity tools April 15, 2006


Home Page Up to Top