<?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="task" /> <meta name="DC.Title" content="Create a data area" /> <meta name="abstract" content="Unlike variables, data areas are objects and must be created before they can be used." /> <meta name="description" content="Unlike variables, data areas are objects and must be created before they can be used." /> <meta name="DC.subject" content="creating, valid type, data area, CRTDTAARA (Create Data Area) command, Create Data Area (CRTDTAARA) command, command, CL, CRTDTAARA (Create Data Area), Create Data Area (CRTDTAARA)" /> <meta name="keywords" content="creating, valid type, data area, CRTDTAARA (Create Data Area) command, Create Data Area (CRTDTAARA) command, command, CL, CRTDTAARA (Create Data Area), Create Data Area (CRTDTAARA)" /> <meta name="DC.Relation" scheme="URI" content="dtaas.htm" /> <meta name="DC.Relation" scheme="URI" content="../cl/crtdtaara.htm" /> <meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" /> <meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" /> <meta name="DC.Format" content="XHTML" /> <meta name="DC.Identifier" content="crtda" /> <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>Create a data area</title> </head> <body id="crtda"><a name="crtda"><!-- --></a> <!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script> <h1 class="topictitle1">Create a data area</h1> <div><p>Unlike variables, data areas are objects and must be created before they can be used. </p> <div class="section"> <p>A data area can be created as: </p> <ul><li>A character string that can be as long as 2000 characters.</li> <li>A decimal value with different attributes, depending on whether it is used only in a CL program or procedure or also with other high-level language programs or procedures. For CL procedures and programs, the data area can have as many as 15 digits to the left of the decimal point and as many as 9 digits to the right, but only 15 digits total. For other languages, the data area can have as many as 15 digits to the left of the decimal point and as many as 9 to the right, for a total of up to 24 digits.</li> <li>A logical value '0' or '1', where '0' can mean off, false, or no; and '1' can mean on, true, or yes.</li> </ul> <p>When you create a data area, you can also specify an initial value for the data area. If you do not specify one, the following is assumed: </p> <ul><li>0 for decimal.</li> <li>Blanks for character.</li> <li>'0' for logical.</li> </ul> <p>To create a data area, use the <span class="cmdname">Create Data Area (CRTDTAARA)</span> command. In the following example, a data area is created to pass a customer number from one program to another: </p> <pre>CRTDTAARA DTAARA(CUST) TYPE(*DEC) + LEN(5 0) TEXT('Next customer number')</pre> </div> </div> <div> <div class="familylinks"> <div class="parentlink"><strong>Parent topic:</strong> <a href="dtaas.htm" title="A data area is an object used to hold data for access by any job running on the system.">Use data areas</a></div> </div> <div class="relinfo"><strong>Related information</strong><br /> <div><a href="../cl/crtdtaara.htm">Create Data Area (CRTDTAARA) command</a></div> </div> </div> </body> </html>