186 lines
5.3 KiB
HTML
186 lines
5.3 KiB
HTML
|
<!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>_SETCCSID()--Set i5/OS PASE CCSID</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 -->
|
||
|
<!-- Created by V2DCIJB on 23 Nov 1999 -->
|
||
|
<!-- Edited by Kersten Jan 02 -->
|
||
|
<!-- End Header Records -->
|
||
|
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
||
|
</head>
|
||
|
<body>
|
||
|
<!-- Java sync-link -->
|
||
|
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript">
|
||
|
</script>
|
||
|
|
||
|
<a name="Top_Of_Page"></a>
|
||
|
|
||
|
<h2>_SETCCSID()--Set i5/OS PASE CCSID</h2>
|
||
|
|
||
|
<div class="box" style="width: 60%;">
|
||
|
<br>
|
||
|
Syntax
|
||
|
|
||
|
<pre>
|
||
|
#include <as400_protos.h>
|
||
|
|
||
|
int _SETCCSID(int <em>ccsid</em>);
|
||
|
</pre>
|
||
|
|
||
|
<br>
|
||
|
Default Public Authority: *USE<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
Library: Standard C Library (libc.a)<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
Threadsafe: No<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
</div>
|
||
|
|
||
|
<p><strong>Note:</strong> This function can only be used in an i5/OS PASE
|
||
|
program. See <a href="../rzalf/rzalfintro.htm">i5/OS PASE</a> for more
|
||
|
information about creating i5/OS PASE programs.</p>
|
||
|
|
||
|
<p>The _SETCCSID() function returns the previous value of the i5/OS PASE Coded
|
||
|
Character Set Identifier (CCSID) and optionally sets a new i5/OS PASE
|
||
|
CCSID.</p>
|
||
|
|
||
|
<br>
|
||
|
|
||
|
|
||
|
<h3>Parameters</h3>
|
||
|
|
||
|
<dl>
|
||
|
<dt><strong>ccsid</strong></dt>
|
||
|
|
||
|
<dd>(Input) Specifies the new i5/OS PASE CCSID value, or -1 to retrieve the
|
||
|
current i5/OS PASE CCSID without changing it. An i5/OS PASE CCSID must be
|
||
|
either a single-byte ASCII encoding that the ILE version of
|
||
|
<strong>iconv</strong> can convert to and from the job default CCSID, or 1208
|
||
|
for UTF-8 encoding.</dd>
|
||
|
</dl>
|
||
|
|
||
|
<br>
|
||
|
|
||
|
|
||
|
<h3>Authorities</h3>
|
||
|
|
||
|
<p><strong>_SETCCSID</strong> requires no authority.</p>
|
||
|
|
||
|
<br>
|
||
|
|
||
|
|
||
|
<h3>Return Value</h3>
|
||
|
|
||
|
<p><strong>_SETCCSID</strong> returns either the original i5/OS PASE CCSID
|
||
|
(before it was changed), or -1 if an error occurred and the i5/OS PASE CCSID
|
||
|
was left unchanged.</p>
|
||
|
|
||
|
<br>
|
||
|
|
||
|
|
||
|
<h3>Error Conditions</h3>
|
||
|
|
||
|
<p>The only error condition that causes a function result of -1 is that the new
|
||
|
<em>ccsid</em> cannot be converted to or from the i5/OS job default CCSID.</p>
|
||
|
|
||
|
<br>
|
||
|
|
||
|
|
||
|
<h3>Usage Notes</h3>
|
||
|
|
||
|
<ol>
|
||
|
<li>The initial i5/OS PASE CCSID value is specified as a parameter on the
|
||
|
Qp2RunPase API. The i5/OS PASE CCSID has two primary uses:<br>
|
||
|
<br>
|
||
|
|
||
|
|
||
|
<ul>
|
||
|
<li>It is used to set the the CCSID attribute of any bytestream file created in
|
||
|
the Integrate File System by an i5/OS PASE program.<br>
|
||
|
<br>
|
||
|
</li>
|
||
|
|
||
|
<li>It is used by i5/OS PASE runtime functions to convert character arguments
|
||
|
and results between the i5/OS PASE CCSID and whatever encoding is required by
|
||
|
the i5/OS service used to implement the function.<br>
|
||
|
</li>
|
||
|
</ul>
|
||
|
|
||
|
<br>
|
||
|
</li>
|
||
|
|
||
|
<li>The i5/OS PASE CCSID should generally be the CCSID equivalent of the code
|
||
|
set for the current locale. See <a href="pase_locales.htm">i5/OS PASE
|
||
|
Locales</a> to determine what locales are supported by i5/OS PASE.<br>
|
||
|
<br>
|
||
|
</li>
|
||
|
|
||
|
<li>Character arguments and results for i5/OS PASE runtime functions that use
|
||
|
i5/OS services are almost always automatically converted using the i5/OS PASE
|
||
|
CCSID. For example, the name of a bytestream file passed to the i5/OS PASE
|
||
|
open function is converted from the i5/OS PASE CCSID to the internal encoding
|
||
|
required by the i5/OS Integrated File System.<br>
|
||
|
<br>
|
||
|
</li>
|
||
|
|
||
|
<li>Any data an i5/OS PASE program writes to or reads from a file descriptor
|
||
|
for an open bytestream file, socket, FIFO, or pipe is generally <em>not</em>
|
||
|
converted. The only exception is for the initial file descriptors 0, 1, and 2
|
||
|
provided when the Qp2RunPase API is called to start an i5/OS PASE program,
|
||
|
which default to converting file data between the i5/OS PASE CCSID and the job
|
||
|
default CCSID (see <a href="qp2runpase.htm">Run an i5/OS PASE Program</a>
|
||
|
(Qp2RunPase) for more information).<br>
|
||
|
<br>
|
||
|
</li>
|
||
|
|
||
|
<li>Other than special support for file descriptors 0, 1, and 2, i5/OS PASE
|
||
|
runtime does no CCSID conversion of file data. This differs from ILE runtime,
|
||
|
which does CCSID conversion between the file CCSID and job default CCSID for
|
||
|
any file opened in text mode. i5/OS PASE runtime sets the CCSID attribute of
|
||
|
any file it creates to the i5/OS PASE CCSID, so an ILE program that uses text
|
||
|
mode to open an ASCII file created by an i5/OS PASE program can read and write
|
||
|
EBCDIC data.<br>
|
||
|
<br>
|
||
|
</li>
|
||
|
|
||
|
<li>The i5/OS PASE runtime functions cstoccsid and ccsidtocs convert between
|
||
|
AIX Character Set names and CCSID values.</li>
|
||
|
</ol>
|
||
|
|
||
|
<br>
|
||
|
|
||
|
|
||
|
<h3>Related Information</h3>
|
||
|
|
||
|
<ul>
|
||
|
<li><a href="qp2runpase.htm">Qp2RunPase()</a>--Run an i5/OS PASE Program</li>
|
||
|
</ul>
|
||
|
|
||
|
<br>
|
||
|
<hr>
|
||
|
API introduced: V4R5
|
||
|
|
||
|
<hr>
|
||
|
<center>
|
||
|
<table cellpadding="2" cellspacing="2">
|
||
|
<tr align="center">
|
||
|
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
|
||
|
"pase1.htm">i5/OS PASE APIs</a> | <a href="aplist.htm">APIs by category</a>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</center>
|
||
|
</body>
|
||
|
</html>
|
||
|
|