TAA Tools
CHGDBFDAT       CHANGE DATA BASE FILE DATE             TAADAUS

The Change Data  Base File Date command  changes date fields in  a file
from an  MMDDYY, DDMMYY, or YYMMDD format to  a different format.  This
allows  rearranging date  fields to  allow for  normal processing based
on your typical date format.

Only fields  defined as  character LEN(6),  zoned LEN(6  0), or  packed
LEN(6 0) may be specified.

You must have *CHANGE authorization to the file to use CHGDBFDAT.

A typical command would be:

             CHGDBFDAT  FILE(xxx) FIELD(DATE1)
                         FROMFMT(MMDDYY) TOFMT(YYMMDD)

If the DATE1  field is character of length 6, the  value in each record
would be changed from MMDDYY to YYMMDD.

No  checking of  the data occurs  to ensure  that a  valid date exists.
If the  field contains  blanks or  zeros, the  data will  still be  the
same.

If a packed field contains invalid data, the command aborts.

If you  have or  suspect invalid  dates, consider  the use  of the  TAA
CHKDBFDAT  command.     It  will  provide  a  listing  of  the  records
containing invalid  date fields  and help  describe the  records  where
the errors exist.

CHGDBFDAT escape messages you can monitor for
---------------------------------------------

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

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

   FILE          The qualified  name of  the file  containing the  date
                 field to  be changed.  The  library qualifier defaults
                 to  *LIBL.  A specific library  or *CURLIB may also be
                 specified.

   FIELD         The field  name  to be  changed.   It  can  only be  a
                 character  field of  length 6,  a zoned  decimal field
                 of length 6, or a packed field of length 6.

   FROMFMT       The  current format  of the field  to be  changed.  It
                 must be defined as MMDDYY, DDMMYY, or YYMMDD.

   TOFMT         The requested format  of the field to  change to.   It
                 must  be defined  as  MMDDYY,  DDMMYY, or  YYMMDD  and
                 cannot be the same as the FROMFMT value.

   MBR           The member to be changed.  *FIRST is the default.

                 A specific member name or *LAST may be specified.


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

You must have *CHANGE authorization to the file to be changed.

The record length may not exceed 9999 bytes.

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

The following TAA Tools must be on your system:

     CHKDBFMBR       Check data base file member
     EDTVAR          Edit variable
     RSNLSTMSG       Resend last message
     RTVFLDA         Retrieve field attributes
     RTVFLDARR       Retrieve field array
     SNDCOMPMSG      Send completion message
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message
     SNDSTSMSG       Send status message

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

None, the tool is ready to use.

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

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

   CHGDBFDAT     *CMD                   TAADAUS       QATTCMD
   TAADAUSC      *PGM       CLP         TAADAUSC      QATTCL
   TAADAUSR      *PGM       RPG         TAADAUSR      QATTRPG
					

Added to TAA Productivity tools April 15, 2011


Home Page Up to Top