ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/CEEDATE.htm

466 lines
11 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<title>Convert Lilian Date to Character Format (CEEDATE) API</title>
<!-- Begin Header Records ========================================== -->
<!-- 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. -->
<!-- Change History: -->
<!-- YYMMDD USERID Change description -->
<!-- ILE4A SCRIPT A converted by B2H R4.1 (346) (CMS) by NLJONES at -->
<!-- RCHVMX on 25 Feb 1999 at 10:53:17 -->
<!-- Edited by Kersten Oct 2001 -->
<!-- End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!--Java sync-link-->
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
</script>
<a name="Top_Of_Page"></a>
<h2>Convert Lilian Date to Character Format (CEEDATE) API</h2>
<div class="box" style="width: 60%;">
<br>
&nbsp;&nbsp;Required Parameter Group:<br>
<!-- iddvc RMBR -->
<br>
<table width="100%">
<tr>
<td align="center" valign="TOP" width="10%">1</td>
<td align="LEFT" valign="TOP" width="40%">input_Lilian_date</td>
<td align="LEFT" valign="TOP" width="25%">Input</td>
<td align="LEFT" valign="TOP" width="25%">INT4</td>
</tr>
<tr>
<td align="center" valign="TOP">2</td>
<td align="LEFT" valign="TOP">picture_string</td>
<td align="LEFT" valign="TOP">Input</td>
<td align="LEFT" valign="TOP">VSTRING</td>
</tr>
<tr>
<td align="center" valign="TOP">3</td>
<td align="LEFT" valign="TOP">output_char_date</td>
<td align="LEFT" valign="TOP">Output</td>
<td align="LEFT" valign="TOP">VSTRING</td>
</tr>
</table>
<br>
&nbsp;&nbsp;Omissible Parameter:<br>
<!-- iddvc RMBR -->
<br>
<table width="100%">
<tr>
<td align="center" valign="TOP" width="10%">4</td>
<td align="LEFT" valign="TOP" width="40%">fc</td>
<td align="LEFT" valign="TOP" width="25%">Output</td>
<td align="LEFT" valign="TOP" width="25%">FEEDBACK</td>
</tr>
</table>
<br>
&nbsp;&nbsp;Service Program Name: QLEAWI<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: Yes<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>The Convert Lilian Date to Character Format (CEEDATE) API formats a number
representing a Lilian date. The output is a character string such as
1988/07/26.</p>
<!-- Please NOTE: DO NOT DELETE THIS SECTION if this API has no authorities and locks. -->
<!-- Instead, use the commented out coding below to indicate NONE. -->
<h3>Authorities and Locks</h3>
<!-- Use this if there are no authorities and locks. -->
<p>None.</p>
<br>
<h3>Required Parameter Group</h3>
<dl>
<dt><strong>input_Lilian_date (input)</strong></dt>
<dd>A 32-bit binary integer representing the Lilian date, which is the number
of days since 14 October 1582. For example, 16 May 1988 is day number
148&nbsp;138. Valid range is 1 to 3&nbsp;074&nbsp;324 (31 December 9999).<br>
<br>
</dd>
<dt><strong>picture_string (input by descriptor)</strong></dt>
<dd>A character string representing the desired format of
<em>output_char_date</em>, for example <samp>MM/DD/YY</samp>. Each character in
<em>picture_string</em> represents a character in <em>output_char_date</em>. If
delimiters such as the slash (<samp>/</samp>) appear in the picture string,
they are copied as is to <em>output_char_date</em>.
<p><a href="CEEDAYS.htm#TBLPICHAR">Picture Characters Used in Picture
Strings</a> has a list of valid picture characters, and <a href=
"CEEDAYS.htm#TBLPICXMP">Examples of Picture Strings Recognized by ILE Date and
Time APIs</a> contains examples of valid picture strings.</p>
<p>If <em>picture_string</em> is null or blank, CEEDATE obtains
<em>picture_string</em> based on the current job value for the country or
region ID (CNTRYID). For example, if the current job value for CNTRYID
is US (United States), the date format is <samp>MM/DD/YYYY</samp>. If the
current job value for CNTRYID is FR (France), the date format is
<samp>DD.MM.YYYY</samp>.</p>
<p>This default mechanism makes it easy for translators to specify the
preferred date format, and also easy for application programs and library
procedures to automatically use this format.</p>
</dd>
<dt><strong>output_char_date (output by descriptor)</strong></dt>
<dd>A character string that is the result of converting
<em>input_Lilian_date</em> to the format specified by <em>picture_string</em>.
If necessary, output will be truncated to the length of
<em>output_char_date</em>. <a href="#TBLDATXMP">Sample Output of the CEEDATE
API</a> contains sample output dates. If <em>input_Lilian_date</em> is not
valid, <em>output_char_date</em> is set to all blanks and CEEDATE ends with a
nonzero <em>feedback-code</em>.</dd>
</dl>
<br>
<h3>Omissible Parameter</h3>
<dl>
<dt><strong>fc (output)</strong></dt>
<dd>A 12-byte feedback code passed by reference. If specified as an argument,
feedback information (a condition token) is returned to the calling procedure.
If not specified and the requested operation was not successfully completed,
the condition is signaled to the condition manager.</dd>
</dl>
<br>
<h3>Feedback Codes and Conditions</h3>
<table cellpadding="3">
<!-- cols="15 85" -->
<tr>
<td align="LEFT" valign="TOP">CEE0000</td>
<td align="LEFT" valign="TOP">The API completed successfully</td>
</tr>
<tr>
<td align="LEFT" valign="TOP">Severity: 00</td>
<td align="LEFT" valign="TOP">&nbsp;</td>
</tr>
<tr>
<td>CEE0501</td>
<td align="LEFT" valign="TOP">The operational descriptor data type is not
valid</td>
</tr>
<tr>
<td align="LEFT" valign="TOP">Severity: 30</td>
<td align="LEFT" valign="TOP">&nbsp;</td>
</tr>
<tr>
<td align="LEFT" valign="TOP">CEE0502</td>
<td align="LEFT" valign="TOP">Missing operational descriptor</td>
</tr>
<tr>
<td align="LEFT" valign="TOP">Severity: 30</td>
<td align="LEFT" valign="TOP">&nbsp;</td>
</tr>
<tr>
<td>CEE2512</td>
<td align="LEFT" valign="TOP">The value for the given Lilian date is not
valid</td>
</tr>
<tr>
<td align="LEFT" valign="TOP">Severity: 30</td>
<td align="LEFT" valign="TOP">&nbsp;</td>
</tr>
<tr>
<td>CEE2518</td>
<td align="LEFT" valign="TOP">The picture string specification is not
valid</td>
</tr>
<tr>
<td align="LEFT" valign="TOP">Severity: 30</td>
<td align="LEFT" valign="TOP">&nbsp;</td>
</tr>
<tr>
<td>CEE2522</td>
<td align="LEFT" valign="TOP">Lilian date outside of era</td>
</tr>
<tr>
<td align="LEFT" valign="TOP">Severity: 30</td>
<td align="LEFT" valign="TOP">&nbsp;</td>
</tr>
<tr>
<td>CEE2526</td>
<td align="LEFT" valign="TOP">Date truncated</td>
</tr>
<tr>
<td align="LEFT" valign="TOP">Severity: 30</td>
<td align="LEFT" valign="TOP">&nbsp;</td>
</tr>
<tr>
<td>CEE9902</td>
<td align="LEFT" valign="TOP">Unexpected user error occurred in &amp;1</td>
</tr>
<tr>
<td align="LEFT" valign="TOP">Severity: 30</td>
<td align="LEFT" valign="TOP">&nbsp;</td>
</tr>
</table>
<br>
<h3>Usage Notes</h3>
<ul>
<li>
<p>The inverse of CEEDATE is CEEDAYS. The CEEDAYS API converts character dates
to the Lilian format.</p>
</li>
<li>
<p>If <em>picture_string</em> includes a Japanese era symbol
<samp>&lt;JJJJ&gt;</samp>, the <samp>YY</samp> position in
<em>output_char_date</em> is replaced by "year within Japanese era". <a href=
"CEEDAYS.htm#TBLPICXMP">Examples of Picture Strings Recognized by ILE Date and
Time APIs</a> has an example. <a href="CEEDAYS.htm#TBLERANAME">Japanese Eras
Used by ILE Date and Time APIs When &lt;JJJJ&gt; Specified</a> contains a list
of Japanese eras supported by CEEDATE.</p>
</li>
<li>
<p>If <em>picture_string</em> includes a Republic of China (ROC) Era symbol
<samp>&lt;CCCC&gt;</samp> or <samp>&lt;CCCCCCCC&gt;</samp>, the <samp>YY</samp>
position in <em>output_char_date</em> is replaced by the year within ROC era.
<a href="CEEDAYS.htm#TBLPICXMP">Examples of Picture Strings Recognized by ILE
Date and Time APIs</a> has an example. <a href="CEEDAYS.htm#TBLROCERA">Republic
of China Eras Used by ILE Date and Time APIs When &lt;CCCC&gt; or
&lt;CCCCCCCC&gt; Specified</a> contains a list of ROC eras supported by
CEEDATE.</p>
</li>
</ul>
<br>
<p><strong><a name="TBLDATXMP">Sample Output of the CEEDATE
API</a></strong></p>
<table border cellpadding="3">
<!-- cols="25 37 38" -->
<tr>
<th align="LEFT" valign="TOP">input_Lilian_date</th>
<th align="LEFT" valign="TOP">picture_string</th>
<th align="LEFT" valign="TOP">output_char_date</th>
</tr>
<tr>
<td align="LEFT" valign="TOP">148138</td>
<td align="LEFT" valign="TOP">
<pre>
<samp>YY</samp>
<samp>YYMM</samp>
<samp>YY-MM</samp>
<samp>YYMMDD</samp>
<samp>YYYYMMDD</samp>
<samp>YYYY-MM-DD</samp>
<samp>YYYY-ZM-ZD</samp>
<samp>&lt;JJJJ&gt; YY.MM.DD</samp>
<samp>&lt;CCCC&gt; YY.MM.DD</samp>
</pre>
<br>
</td>
<td align="LEFT" valign="TOP">
<pre>
88
8805
88-05
880516
19880516
1988-05-16
1988-5-16
<em>Showa</em> 63.05.16 (in a DBCS string)
<em>MinKow</em> 77.05.16 (in a DBCS string)
</pre>
</td>
</tr>
<tr>
<td align="LEFT" valign="TOP">148139</td>
<td align="LEFT" valign="TOP">
<pre>
<samp>MM</samp>
<samp>MMDD</samp>
<samp>MM/DD</samp>
<samp>MMDDYY</samp>
<samp>MM/DD/YYYY</samp>
<samp>ZM/DD/YYYY</samp>
</pre>
<br>
</td>
<td align="LEFT" valign="TOP">
<pre>
05
0517
05/17
051788
05/17/1988
5/17/1988
</pre>
</td>
</tr>
<tr>
<td align="LEFT" valign="TOP">148140</td>
<td align="LEFT" valign="TOP">
<pre>
<samp>DD</samp>
<samp>DDMM</samp>
<samp>DDMMYY</samp>
<samp>DD.MM.YY</samp>
<samp>DD.MM.YYYY</samp>
<samp>DD Mmm YYYY</samp>
</pre>
<br>
</td>
<td align="LEFT" valign="TOP">
<pre>
18
1805
180588
18.05.88
18.05.1988
18 May 1988
</pre>
</td>
</tr>
<tr>
<td align="LEFT" valign="TOP">148141</td>
<td align="LEFT" valign="TOP">
<pre>
<samp>DDD</samp>
<samp>YYDDD</samp>
<samp>YY.DDD</samp>
<samp>YYYY.DDD</samp>
</pre>
<br>
</td>
<td align="LEFT" valign="TOP">
<pre>
140
88140
88.140
1988.140
</pre>
</td>
</tr>
<tr>
<td align="LEFT" valign="TOP">148142</td>
<td align="LEFT" valign="TOP">
<pre>
<samp>YY/MM/DD HH:MI:SS.99</samp>
<samp>YYYY/ZM/ZD ZH:MI AP</samp>
</pre>
<br>
</td>
<td align="LEFT" valign="TOP">
<pre>
88/05/20 00:00:00.00
88/5/20 0:00 AM
</pre>
</td>
</tr>
<tr>
<td align="LEFT" valign="TOP">148143</td>
<td align="LEFT" valign="TOP">
<pre>
<samp>WWW., MMM DD, YYYY</samp>
<samp>Www., Mmm DD, YYYY</samp>
<samp>Wwwwwwwwww, Mmmmmmmmmm DD, YYYY</samp>
<samp>Wwwwwwwwwz, Mmmmmmmmmz DD, YYYY</samp>
</pre>
</td>
<td align="LEFT" valign="TOP">
<pre>
SAT., MAY 21, 1988
Sat., May 21, 1988
Saturday , May 21, 1988
Saturday, May 21, 1988
</pre>
</td>
</tr>
</table>
<br>
<h3>Example</h3>
<p>See <a href="../apiref/aboutapis.htm#codedisclaimer">Code disclaimer information</a>
for information pertaining to code examples.</p>
<ul>
<li>
<p>Convert a date from the Lilian format to IBM USA standard format
MM/DD/YYYY:</p>
<pre>
CALL CEEDATE (lildate, 'MM/DD/YYYY', usadate, fc);
</pre>
</li>
</ul>
<br>
<hr>
API introduced: V2R3
<hr>
<center>
<table cellpadding="2" cellspacing="2">
<tr align="center">
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
"ile1a1.htm">ILE CEE APIs</a> | <a href="aplist.htm">APIs by category</a></td>
</tr>
</table>
</center>
</body>
</html>