CHKTIMSTM CHECK TIME STAMP TAATIMR |
The Check Time Stamp tool provides a command to check timestamps as
defined by the data base type Z fields. The major intent of the tool
is to call the processing program from a HLL program and pass it an
Externally Described Data Structure of information and receive a
message back in the Data Structure.
Unlike most timestamp checking functions, the error messages describe
the specific error (such as Day 31 is not valid for April or the
Second portion is invalid) rather than a general description that the
timestamp is invalid. The error messages are designed to be
displayed to end users. The function is useful whenever timestamps
must be validated.
A typical command would be:
CHKTIMSTM TIMSTM(yyyy-mm-dd-hh.mm.ss.nnnnnn)
Separator values are also checked.
An exception is made for default timestamp values which have a value
of:
0001-01-01-00.00.00.000000
9999-12-31-24.00.00.000000
CHKTIMSTM escape messages you can monitor for
---------------------------------------------
TAA9891 Bad condition (the text explains the error)
(Only sent if the CHKTIMSTM command is used)
If the function is called from a HLL program, the bad date conditions
will appear in the Externally Described Data Structure.
Escape messages from based on functions will be re-sent.
Command parameters *CMD
------------------
TIMSTM The time stamp to be checked. The only format is
that defined for Z type data base fields. The
timestamp must be 26 characters in the format
'yyyy-mm-dd-hh.mm.ss.nnnnnn'.
Time stamps of 0001-01-01-00.00.000000 and
9999-12-31-24.00.00.000000 are considered valid.
SETLR How to set LR to end the RPG program. The major
processing of the function is done by an RPG
program. The default is *ON to end the RPG program
when the function is complete. This de-activates
the program. This is not a good performance choice
if you are going to iteratively use the function.
*OFF may be specified to cause the RPG program to
return, but the program remains active and may be
called again with better performance results. *OFF
should be used when you are going to iteratively use
the function.
*IMMED may be specified to cause the RPG program to
end without performing a timestamp check. The
program is de-activated. The next time the program
is called, the program must be activated. *IMMED
should be used if you have been iteratively using
the function and now want to end it.
Using the function from a HLL program
-------------------------------------
The major intent of the tool is to call the processing program
(written in RPG) and communicate using an Externally Described Data
Structure. The Data Structure is shipped as a Physical file which
can be displayed with the command:
DSPFMT FILE(TAATIMRP)
The following describes the fields:
TMINP The Input timestamp to be checked. The format of
the date must adhere to that defined for Z type data
base fields. The field length is 26 bytes. It must
be in a format of 'yyyy-mm-dd-hh.mm.ss.nnnnnn'.
TMLR The LR setting to be used. The values that may be
entered are the same as described for the SETLR
command parameter. If the value is left blank, *ON
is assumed. The value must be left adjusted.
TMERR The return value if an error exists. A one byte
field that will be blank on the return of a valid
date check.
The field will contain an 'X' if an error occurred.
You may either check TMERR or TMMSG to determine an
error exists.
TMMSG The return message if any. The field is defined as
78 bytes so it may fit on one line of a display.
The value will be blank if the date is valid.
If the date is not valid, the text describes the
specific error condition which is intended to be
displayed to the end user.
TMRSV A reserved field of 50 bytes.
RPG III Code
------------
The following code would be typical and is in a format that can be
copied directly into an RPG III program.
I* Externally described DS supplied by CHKTIMSTM
ITIMDS E DSTAATIMRP
.
.
C MOVELxxx TMINP Time stamp
C CALL 'TAATIMRR' CHKTIMSTM
C PARM TIMDS Time DS
C TMERR IFEQ 'X' If error
C*
C* The TMMSG field contains the error text
C*
C ENDIF If error
RPG IV Code
-----------
The Time Stamp may be checked in an RPG IV program with the TEST
operation code (plus modifier Z). If an error occurs, the only
feedback is an error indicator as opposed to the CHKTIMSTM function
which provides message text.
The following code would be typical and is in a format that can be
copied directly into an RPG IV program.
D* Externally described DS supplied by CHKTIMSTM
D TIMDS E DS EXTNAME(TAATIMRP)
.
.
C MOVEL xxx TMINP
C CALL 'TAATIMRR'
C PARM TIMDS
C TMERR IFEQ 'X'
C*
C* The TMMSG field contains the error text
C*
C ENDIF
Restrictions
------------
None.
Prerequisites
-------------
The following TAA Tools must be on your system:
CHKDAT3 Check date 3
SNDESCMSG Send escape message
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
CHKTIMSTM *CMD TAATIMR QATTCMD
TAATIMRC *PGM CLP TAATIMRC QATTCL
TAATIMRR *PGM RPG TAATIMRR QATTRPG
TAATIMRP *FILE PF TAATIMRP QATTDDS
|
Added to TAA Productivity tools February 28, 2000