<?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="Compile a non-ILE application program that uses SQL" /> <meta name="abstract" content="The SQL precompiler automatically calls the host language compiler after the successful completion of a precompile, unless *NOGEN is specified." /> <meta name="description" content="The SQL precompiler automatically calls the host language compiler after the successful completion of a precompile, unless *NOGEN is specified." /> <meta name="DC.subject" content="compiling, application program, non-ILE, compiling, non-ILE, program, compiling application, COBOL program, compiler parameters, RPG/400 program, PL/I program, precompiler parameter, OPTION(*NOGEN), parameters passed to compiler, precompiler, ) command, Create SQL Package (CRTSQLPKG" /> <meta name="keywords" content="compiling, application program, non-ILE, compiling, non-ILE, program, compiling application, COBOL program, compiler parameters, RPG/400 program, PL/I program, precompiler parameter, OPTION(*NOGEN), parameters passed to compiler, precompiler, ) command, Create SQL Package (CRTSQLPKG" /> <meta name="DC.Relation" scheme="URI" content="rzajpprcpcmd.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="rzajpcompilenonile" /> <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>Compile a non-ILE application program that uses SQL</title> </head> <body id="rzajpcompilenonile"><a name="rzajpcompilenonile"><!-- --></a> <!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script> <h1 class="topictitle1">Compile a non-ILE application program that uses SQL</h1> <div><p>The SQL precompiler automatically calls the host language compiler after the successful completion of a precompile, unless *NOGEN is specified.</p> <div class="section"><p>The <span class="cmdname">CRTxxxPGM</span> command is run specifying the program name, source file name, precompiler created source member name, text, and USRPRF.</p> <p>Within these languages, the following parameters are passed: </p> <ul><li>For COBOL, the *QUOTE or *APOST is passed on the <span class="cmdname">CRTCBLPGM</span> command.</li> <li>For RPG and COBOL, SAAFLAG (*FLAG) is passed on the <span class="cmdname">CRTxxxPGM</span> command.</li> <li>For RPG and COBOL, the SRTSEQ and LANGID parameter from the CRTSQLxxx command is specified on the <span class="cmdname">CRTxxxPGM</span> command.</li> <li>For RPG and COBOL, the CVTOPT (*DATETIME *VARCHAR) is always specified on the <span class="cmdname">CRTxxxPGM</span> command.</li> <li>For COBOL and RPG, the TGTRLS parameter value from the CRTSQLxxx command is specified on the <span class="cmdname">CRTxxxPGM</span> command. TGTRLS is not specified on the <span class="cmdname">CRTPLIPGM</span> command. The program can be saved or restored to the level specified on the TGTRLS parameter of the <span class="cmdname">CRTSQLPLI</span> command.</li> <li>For PL/I, the MARGINS are set in the temporary source file.</li> <li>For all languages, the REPLACE parameter from the <span class="cmdname">CRTSQLxxx</span> command is specified on the <span class="cmdname">CRTxxxPGM</span> command. <p>If a package is created as part of the precompile process, the REPLACE parameter value from the <span class="cmdname">CRTSQLxxx</span> command is specified on the <span class="cmdname">CRTSQLPKG</span> command.</p> </li> <li>For all languages, if USRPRF(*USER) or system naming (*SYS) with USRPRF(*NAMING) is specified, then USRPRF(*USER) is specified on the <span class="cmdname">CRTxxxPGM</span> command. If USRPRF(*OWNER) or SQL naming (*SQL) with USRPRF(*NAMING) is specified, then USRPRF(*OWNER) is specified on the <span class="cmdname">CRTxxxPGM</span> command.</li> </ul> <p>Defaults are used for all other parameters with <span class="cmdname">CRTxxxPGM</span> commands.</p> </div> <div class="section"><p>You can interrupt the call to the host language compiler by specifying *NOGEN on the OPTION parameter of the precompiler command. *NOGEN specifies that the host language compiler will not be called. Using the object name in the CRTSQLxxx command as the member name, the precompiler created the source member in the output source file (specified as the TOSRCFILE parameter on the CRTSQLxxx command). You now can explicitly call the host language compilers, specify the source member in the output source file, and change the defaults. If the precompile and compile were done as separate steps, the <span class="cmdname">CRTSQLPKG</span> command can be used to create the SQL package for a distributed program. </p> <div class="note"><span class="notetitle">Note:</span> You must not change the source member in QTEMP/QSQLTEMP prior to issuing the CRTxxxPGM command or the compile will fail.</div> </div> </div> <div> <div class="familylinks"> <div class="parentlink"><strong>Parent topic:</strong> <a href="rzajpprcpcmd.htm" title="DB2 UDB Query Manager and SQL Development Kit includes non-ILE precompiler commands for the following host languages: CRTSQLCBL (for COBOL for iSeries), CRTSQLPLI (for iSeries PL/I), and CRTSQLRPG (for RPG III, which is part of RPG/400).">Non-ILE SQL precompiler commands</a></div> </div> </div> </body> </html>