83 lines
5.5 KiB
HTML
83 lines
5.5 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="copyright" content="(C) Copyright IBM Corporation 2005" />
|
|
<meta name="DC.rights.owner" content="(C) Copyright IBM Corporation 2005" />
|
|
<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="DBCS-graphic fields using FMTOPT(*MAP) or FMTOPT(*NOCHK)" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbal3specdata.htm" />
|
|
<meta name="DC.Format" content="XHTML" />
|
|
<meta name="DC.Identifier" content="rbal3ptr2" />
|
|
<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>DBCS-graphic fields using FMTOPT(*MAP) or FMTOPT(*NOCHK)</title>
|
|
</head>
|
|
<body id="rbal3ptr2"><a name="rbal3ptr2"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">DBCS-graphic fields using FMTOPT(*MAP) or FMTOPT(*NOCHK)</h1>
|
|
<div><p>When mapping graphic fields to bracketed DBCS fields, shift-out and shift-in
|
|
characters are added around the DBCS data. When mapping from bracketed-DBCS
|
|
fields to graphic fields, the shift-out and shift-in characters are removed.
|
|
For variable-length fields, the graphic field length is expressed in the number
|
|
of DBCS characters and the bracketed DBCS length is expressed in number of
|
|
bytes (including the shift-out and shift-in characters). This difference is
|
|
accounted for when mapping variable-length graphic fields to or from variable
|
|
bracketed DBCS fields.</p>
|
|
<p>When using the <a href="../cl/cpyf.htm">CPYF</a> command
|
|
with FMTOPT(*MAP) to copy a DBCS-open field to a graphic field, a conversion
|
|
error occurs if the DBCS-open field contains any SBCS data (including blanks).
|
|
When copying to a graphic field, it might be desirable to ignore trailing
|
|
SBCS blanks that follow valid DBCS data (in a DBCS-open field). This allows
|
|
the copy operation to be done without a conversion error. This type of copy
|
|
can be done using a combination of the <a href="../cl/opnqryf.htm">OPNQRYF</a> and <a href="../cl/cpyfrmqryf.htm">CPYFRMQRYF</a> commands. The OPNQRYF command is used to remove
|
|
trailing single-byte blanks and place the data into a variable-length DBCS-open
|
|
field. The CPYFRMQRYF command with FMTOPT(*MAP) specified is used to copy
|
|
the variable-length DBCS-open field to the graphic field.</p>
|
|
<p>For example, assume the DBCS-open fields in the file named FILEO are copied
|
|
into graphic fields in the file named FILEG. An additional file (FILEV) must
|
|
be created.</p>
|
|
<div class="p"><strong>The DDS for the original from-file FILEO:</strong> <pre>******* ************** Beginning of data *****************************
|
|
A R FMT01
|
|
A FLD1 10O CCSID(65535)
|
|
A FLD2 7O CCSID(65535)
|
|
A FLD3 20A
|
|
******* ***************** End of data ********************************</pre>
|
|
</div>
|
|
<div class="p"><strong>DDS for FILEV:</strong> This file's format will be specified on the OPNQRYF
|
|
command FORMAT parameter. The only difference from FILEO is that the DBCS-open
|
|
fields to be converted to graphic fields are defined to be variable length. <pre>******* ************** Beginning of data *****************************
|
|
A R FMT01
|
|
A FLD1 10O VARLEN CCSID(65535)
|
|
A FLD2 7O VARLEN CCSID(65535)
|
|
A FLD3 20A
|
|
******* ***************** End of data ********************************</pre>
|
|
</div>
|
|
<div class="p"><strong>DDS for the new file FILEG:</strong> The graphic fields are defined as fixed
|
|
length; however, they can be made variable length, if that is what you want. <pre>******* ************** Beginning of data ************************
|
|
A R FMT01 A FLD1 4G CCSID(65535) A FLD2 3G CCSID(65535) A FLD3 20A
|
|
******* ***************** End of data ***************************</pre>
|
|
</div>
|
|
<div class="p">The following commands are used to copy the data from the DBCS-open fields
|
|
in FILEO to the graphic fields in FILEG: <pre>CHGJOB CCSID(65535)
|
|
OPNQRYF FILE((MYLIB/FILEO)) FORMAT(MYLIB/FILEV *ONLY) MAPFLD((FLD1 '%STRIP(1/FLD1 *TRAIL)') (FLD2 '%STRIP(1/FLD2 *TRAIL)'))
|
|
CPYFRMQRYF FROMOPNID(FILEO) TOFILE(MYLIB/FILEG) MBROPT(*REPLACE) FMTOPT(*MAP)</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbal3specdata.htm" title="You can use FMTOPT(*MAP) to map data between fixed-length and variable-length fields and between variable-length fields with different maximum lengths.">Specify data for different field types and attributes</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |