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

163 lines
5.3 KiB
HTML
Raw 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>_OPEN_CCSID()--Open With CCSID for i5/OS PASE</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>_OPEN_CCSID()--Open With CCSID for i5/OS PASE</h2>
<div class="box" style="width: 60%;">
<br>
&nbsp;&nbsp;Syntax
<pre>
#include &lt;as400_protos.h&gt;
int _OPEN_CCSID(const char <em>*path</em>,
int <em>oflags</em>,
mode_t <em>mode</em>,
int <em>ccsid</em>);
</pre>
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Library: Standard C Library (libc.a)<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;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 <strong>_OPEN_CCSID</strong> function establishes a connection between the file named by the <em>path</em> parameter and a file descriptor. <strong>_OPEN_CCSID</strong> works the same as the i5/OS PASE <strong>open</strong> function, except that any file it creates is tagged with a specified Coded Character Set Identifier (CCSID).</p>
<br>
<h3>Parameters</h3>
<dl>
<dt><strong>path</strong></dt>
<dd>(Input) Specifies the address of a null-terminated character string (in the current i5/OS PASE CCSID) that contains the path name of the file to open.</dd>
</dl>
<dl>
<dt><strong>oflags</strong></dt>
<dd>(Input) Specifies the the type of access, special open processing, type of update, and initial state of the open file.
See AIX documentation for the <strong>open</strong> function for more information about <strong>oflags</strong>.</dd>
</dl>
<dl>
<dt><strong>mode</strong></dt>
<dd>(Input) the read, write, and execute permissions of the file to be created (requested by the O_CREAT flag).
If the file already exists, this parameter is ignored.
See AIX documentation for the <strong>open</strong> function for more information about <strong>mode</strong>.</dd>
</dl>
<dl>
<dt><strong>ccsid</strong></dt>
<dd>(Input) Specifies the i5/OS PASE CCSID value that describes the data that will be stored in a file created by <strong>_OPEN_CCSID</strong>.
If zero is specified, the current i5/OS PASE CCSID is used.
If the file already exists, this parameter is ignored.</dd>
</dl>
<br>
<h3>Authorities</h3>
<p>See documenation for the ILE <a href="open.htm">Open File (open)</a> function for information about required authorities.</p>
<br>
<h3>Return Value</h3>
<p><strong>_OPEN_CCSID</strong> returns either the file descriptor for the open file, or -1 if an error occurred.
The <strong>errno</strong> variable is set to indentify the specific error.</p>
<br>
<h3>Error Conditions</h3>
<p>See AIX documentation for the <strong>open</strong> function and ILE
<a href="open.htm">Open File (open)</a> function for more information about error conditions.</p>
<br>
<h3>Usage Notes</h3>
<ol>
<li>ILE runtime uses the CCSID tag for a file to control automatic conversion for data read or written through a file opened in text mode.
Any data an i5/OS PASE program writes to or reads from a file descriptor 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.
<br><br>
</li>
<li>The i5/OS PASE runtime functions cstoccsid and ccsidtocs convert between AIX Character Set names and CCSID values.
<br><br>
</li>
</ol>
<br>
<h3>Related Information</h3>
<ul>
<li><a href="pase__setccsid.htm">_SETCCSID()</a>--Set i5/OS PASE CCSID</li>
</ul>
<br>
<hr>
API introduced: V5R4
<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>