102 lines
6.0 KiB
HTML
102 lines
6.0 KiB
HTML
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<!DOCTYPE html
|
||
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html lang="en-us" xml:lang="en-us">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<meta name="security" content="public" />
|
||
|
<meta name="Robots" content="index,follow" />
|
||
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
||
|
<meta name="DC.Type" content="concept" />
|
||
|
<meta name="DC.Title" content="Edit date presentation" />
|
||
|
<meta name="abstract" content="You need to handle the presentation of dates on display and printer files differently, depending on how they are stored." />
|
||
|
<meta name="description" content="You need to handle the presentation of dates on display and printer files differently, depending on how they are stored." />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbagscultconvappdesign.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="../rzakc/rzakcmstdfdate.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="../rzakc/rzakcmstdfdatfmt.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="../rzakc/rzakcmstdfdatsep.htm" />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
|
||
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
|
||
|
<meta name="DC.Format" content="XHTML" />
|
||
|
<meta name="DC.Identifier" content="rbagsdatepresentation" />
|
||
|
<meta name="DC.Language" content="en-us" />
|
||
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
||
|
<!-- US Government Users Restricted Rights -->
|
||
|
<!-- Use, duplication or disclosure restricted by -->
|
||
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
||
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
||
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
||
|
<title>Edit date presentation</title>
|
||
|
</head>
|
||
|
<body id="rbagsdatepresentation"><a name="rbagsdatepresentation"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Edit date presentation</h1>
|
||
|
<div><p>You need to handle the presentation of dates on display and printer
|
||
|
files differently, depending on how they are stored.</p>
|
||
|
<ul><li>As a normal decimal data field <p>Your application program has responsibility
|
||
|
for the way the date is entered, stored, and presented. The application must
|
||
|
check to see that the date is entered in the right format, remove any date
|
||
|
separators, convert the date to another format when necessary, and edit it
|
||
|
on the display file or printer file.</p>
|
||
|
<p>The DDS keyword DATE is used as
|
||
|
an output-only field. DATE uses the job attributes DATE, DATFMT, and DATSEP.
|
||
|
You can edit DATE using the edit code keyword, EDTCDE, for 6- and 8-digit
|
||
|
date fields.</p>
|
||
|
<p>Editing with EDTCDE includes the following changes to the
|
||
|
appearance of displayed fields, depending on which edit code is specified:</p>
|
||
|
<ul><li>Leading zeros are suppressed.</li>
|
||
|
<li>Zero values can be displayed as zero or blanks.</li>
|
||
|
<li>The field can be further edited using a user-defined edit code.</li>
|
||
|
</ul>
|
||
|
<p>For all other types of fields using the EDTCDE Y keyword, the program
|
||
|
has to specify the format, and the system uses the date separator of the job
|
||
|
that created the device file. The date separator is integrated in the object,
|
||
|
and you are not able to change it dynamically at run time.</p>
|
||
|
</li>
|
||
|
<li>As an SAA<sup>®</sup> data
|
||
|
type DATE (L) field <p>The DDS date format (DATFMT) keyword allows you to
|
||
|
specify different date formats, including default date separators, at the
|
||
|
database field level. For the *MDY, *DMY, *YMD, and *JUL parameters, the default
|
||
|
date separator can be changed with the date separator (DATSEP) keyword. The
|
||
|
*ISO, *USA, *EUR, and *JIS values have a fixed separator, and the DATSEP keyword
|
||
|
is not allowed with these values. The DATFMT and DATSEP keywords allow you
|
||
|
to specify the format and editing characters for storing date fields. The
|
||
|
date is shown as a character string, including the separators.</p>
|
||
|
<p>Any format
|
||
|
conversion between the date input and the format the database asks for can
|
||
|
be done by:</p>
|
||
|
<ul><li>Application program routines</li>
|
||
|
<li>Field mapping through logical files that define different date formats
|
||
|
and separators</li>
|
||
|
</ul>
|
||
|
<p>For example, you can provide a date conversion that is dependent on
|
||
|
the actual job attributes by using the following CL program:</p>
|
||
|
<pre>PGM PARM(&fromfmt &fromfld &tofld );
|
||
|
DCL VAR(&fromfmt); TYPE(*CHAR) LEN(4)
|
||
|
DCL VAR(&fromfld); TYPE(*CHAR) LEN(10)
|
||
|
DCL VAR(&tofld); TYPE(*CHAR) LEN(10)
|
||
|
CVTDAT DATE(&fromfld); TOVAR(&tofld);
|
||
|
FROMFMT(&fromfmt); TOFMT(*JOB) TOSEP(*JOB)
|
||
|
ENDPGM</pre>
|
||
|
</li>
|
||
|
</ul>
|
||
|
<p>Your application program has to pass the format of the date you want to
|
||
|
convert and the date itself to the CL program. The CL program assumes that
|
||
|
the job attributes represent the way the user expects to see date fields edited.
|
||
|
It retrieves these values and does the conversion, conforming to these values,
|
||
|
and passes back the date in that way. The *ISO, *USA, *EUR, and *JIS values
|
||
|
have a fixed separator that cannot be changed. If the TOFMT parameter contains
|
||
|
one of these values, the TOSEP value is ignored.</p>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbagscultconvappdesign.htm" title="Different countries have different standards that must be taken into account when developing an NLS-enabled application. This culturally sensitive information must be placed outside the program the same way as the textual data is handled.">Cultural-dependent design</a></div>
|
||
|
</div>
|
||
|
<div class="relconcepts"><strong>Related concepts</strong><br />
|
||
|
<div><a href="../rzakc/rzakcmstdfdate.htm">DATE</a></div>
|
||
|
<div><a href="../rzakc/rzakcmstdfdatfmt.htm">date format (DATFMT)</a></div>
|
||
|
<div><a href="../rzakc/rzakcmstdfdatsep.htm">date separator (DATSEP)</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|