72 lines
3.6 KiB
HTML
72 lines
3.6 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="reference" />
|
|
<meta name="DC.Title" content="Example: Using data transformation APIs" />
|
|
<meta name="abstract" content="This example illustrates using data transformation APIs." />
|
|
<meta name="description" content="This example illustrates using data transformation APIs." />
|
|
<meta name="DC.Relation" scheme="URI" content="rzaikdt.htm" />
|
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1999, 2006" />
|
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1999, 2006" />
|
|
<meta name="DC.Format" content="XHTML" />
|
|
<meta name="DC.Identifier" content="datatransprogex" />
|
|
<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>Example: Using data transformation APIs</title>
|
|
</head>
|
|
<body id="datatransprogex"><a name="datatransprogex"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Example: Using data transformation APIs</h1>
|
|
<div><p>This example illustrates using data transformation APIs.</p>
|
|
<div class="example"> <pre>/*******************************************************************/
|
|
/* Sample Data Transform Program using cwbDT_Bin4ToBin4 to reverse */
|
|
/* the order of bytes in a 4-byte integer. */
|
|
/*******************************************************************/
|
|
|
|
#include <iostream.h>
|
|
#include "cwbdt.h"
|
|
|
|
|
|
void main()
|
|
{
|
|
unsigned int returnCode;
|
|
long source,
|
|
target;
|
|
|
|
cout << "Enter source number:\n";
|
|
|
|
while (cin >> source) {
|
|
cout << "Source in Dec = " << dec << source;
|
|
cout << "\nSource in Hex = " << hex << source << '\n';
|
|
if (((returnCode = cwbDT_Bin4ToBin4((char *)&target,(char *)&source)) == CWB_OK)) {
|
|
cout << "Target in Dec = " << dec << target;
|
|
cout << "\nTarget in Hex = " << hex << target << '\n';
|
|
} else {
|
|
cout << "Conversion failed, Return code = " << returnCode << '\n' ;
|
|
}; /* endif */
|
|
cout << "\nEnter source number:\n";
|
|
|
|
|
|
}; /* endwhile */
|
|
|
|
}</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzaikdt.htm" title="iSeries Access for Windowsdata transformation application programming interfaces (APIs) enable your client/server applications to transform numeric data between iSeries server and PC formats. Transformation may be required when you send and receive numeric data to and from the iSeries server. Data transformation APIs support transformation of many numeric formats.">iSeries Access for Windows data transformation APIs</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |