154 lines
8.9 KiB
HTML
154 lines
8.9 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="task" />
|
||
|
<meta name="DC.Title" content="Change command defaults" />
|
||
|
<meta name="abstract" content="You can change the default value of a command keyword by using the Change Command Default (CHGCMDDFT) command." />
|
||
|
<meta name="description" content="You can change the default value of a command keyword by using the Change Command Default (CHGCMDDFT) command." />
|
||
|
<meta name="DC.subject" content="command default, changing, default value, changing command" />
|
||
|
<meta name="keywords" content="command default, changing, default value, changing command" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="ccdcp.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="../clfinder/finder.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="../apiref/api.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="chgcmddef" />
|
||
|
<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>Change command defaults</title>
|
||
|
</head>
|
||
|
<body id="chgcmddef"><a name="chgcmddef"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Change command defaults</h1>
|
||
|
<div><p>You can change the default value of a command keyword by using
|
||
|
the <span class="cmdname">Change Command Default (CHGCMDDFT)</span> command. </p>
|
||
|
<div class="section"> <p>The keyword must have an existing default in order to allow a
|
||
|
change to a new default value. You can change either an IBM-supplied command
|
||
|
or a user-written command. You must use caution when changing defaults for
|
||
|
IBM-supplied commands. The following are recommendations for changing defaults:
|
||
|
</p>
|
||
|
<ol><li>Use the <span class="cmdname">Create Duplicate Object (CRTDUPOBJ)</span> command
|
||
|
to create a duplicate of the IBM-supplied command that you want to change
|
||
|
in a user library. This allows other users on the system to use the IBM-supplied
|
||
|
defaults if necessary. <p>Use the <span class="cmdname">Change System Library List (CHGSYSLIBL)</span> command
|
||
|
to move the user library ahead of QSYS or any other system-supplied libraries
|
||
|
in the library list. This will allow the user to use the changed command
|
||
|
without using the library qualifier.</p>
|
||
|
<p>Changes to commands that are needed
|
||
|
on a system-wide basis should be made in a user library. Additionally, you
|
||
|
should add the user library name to the QSYSLIBL system value ahead of QSYS.
|
||
|
The changed command is used system-wide. If you need to run an application
|
||
|
that uses the IBM-supplied default, do so by using the <span class="cmdname">Change System
|
||
|
Library List (CHGSYSLIBL)</span> command. Doing this removes the special
|
||
|
library or library-qualify to the affected commands.</p>
|
||
|
</li>
|
||
|
<li>Installing a new release of a licensed program replaces all IBM-supplied
|
||
|
commands for the licensed program on the machine. You should use a CL program
|
||
|
to make changes to commands when installing a new release. This way you can
|
||
|
run the CL program to duplicate the new commands to pick up any new keywords
|
||
|
and make the command default changes. <p>If an IBM-supplied command has new
|
||
|
keywords, a copy of the command from a previous release may not run properly.</p>
|
||
|
<p>The
|
||
|
following is an example of a CL program that is used to delete the old version
|
||
|
and create the new changed command: </p>
|
||
|
<pre>PGM
|
||
|
DLTCMD USRQSYS/SIGNOFF
|
||
|
CRTDUPOBJ OBJ(SIGNOFF) FROMLIB(QSYS) OBJTYPE(*CMD) +
|
||
|
TOLIB(USRQSYS) NEWOBJ(*SAME)
|
||
|
CHGCMDDFT CMD(USRQSYS/SIGNOFF) NEWDFT('LOG(*LIST)')
|
||
|
.
|
||
|
.
|
||
|
Repeat the DLTCMD, CRTDUPOBJ and CHGCMDDFT for each
|
||
|
command you want changed
|
||
|
.
|
||
|
.
|
||
|
ENDPGM</pre>
|
||
|
</li>
|
||
|
</ol>
|
||
|
<p>You can track changes you make to CL command defaults for use when
|
||
|
you install a new release. To track changes, register an exit program for
|
||
|
exit point QIBM_QCA_RTV_COMMAND. The exit program is called when you run the <span class="cmdname">Change
|
||
|
Command Default (CHGCMDDFT)</span> command. One of the parameters passed
|
||
|
to the exit program is the command string that is being run. You can save
|
||
|
the command string to a source file and then compile the source file into
|
||
|
a CL program. Finally, you use this program to reproduce the changes you have
|
||
|
made to command defaults during the previous release.</p>
|
||
|
<p>The following
|
||
|
steps can be used to build the NEWDFT command string for the <span class="cmdname">Change
|
||
|
Command Default (CHGCMDDFT)</span> command. The USRQSYS/CRTCLPGM
|
||
|
command is used in this example. </p>
|
||
|
<ol><li>Create a duplicate copy of the command to be changed in a user library
|
||
|
with the following command: <pre>CRTDUPOBJ OBJ(CRTCLPGM) FROMLIB(QSYS) OBJTYPE(*CMD) +
|
||
|
TOLIB(USRQSYS) NEWOBJ(*SAME)</pre>
|
||
|
</li>
|
||
|
<li>Enter the command name to be changed in a source file referred to by the
|
||
|
Source Entry Utility (SEU).</li>
|
||
|
<li>Press F4 to call the command prompter.</li>
|
||
|
<li>Enter any new default values for the keywords you want changed. In this
|
||
|
example, <samp class="codeph">AUT(*EXCLUDE)</samp> and <samp class="codeph">TEXT('Isn''t this nice
|
||
|
text')</samp> is entered.</li>
|
||
|
<li>Required keywords cannot have a default value; however, in order to get
|
||
|
the command string in the source file, a valid value must be specified for
|
||
|
each required keyword. Specify PGM1 for the PGM parameter.</li>
|
||
|
<li>Press the Enter key to put the command string into the source file. The
|
||
|
command string returned would look like this: <pre>USRQSYS/CRTCLPGM PGM(PGM1) AUT(*EXCLUDE) +
|
||
|
TEXT('Isn''t this nice text')</pre>
|
||
|
</li>
|
||
|
<li>Remove the required keywords from the command string: <pre>USRQSYS/CRTCLPGM AUT(*EXCLUDE) +
|
||
|
TEXT('Isn''t this nice text')</pre>
|
||
|
<p>Remember that you may change only parameters, elements, or
|
||
|
qualifiers that have existing default values. Specifying a value for a parameter,
|
||
|
element, or qualifier that does not have an existing default value makes no
|
||
|
default changes.</p>
|
||
|
</li>
|
||
|
<li>Insert the <span class="cmdname">Change Command Default (CHGCMDDFT)</span> at the
|
||
|
beginning as shown in the example below: <pre>CHGCMDDFT USRQSYS/CRTCLPGM AUT(*EXCLUDE) +
|
||
|
TEXT('Isn''t this nice text')</pre>
|
||
|
</li>
|
||
|
<li>You must quote the input for the NEWDFT keyword as shown in the example
|
||
|
below: <pre>CHGCMDDFT USRQSYS/CRTCLPGM 'AUT(*EXCLUDE) +
|
||
|
TEXT('Isn''t this nice text')'</pre>
|
||
|
</li>
|
||
|
<li>Since there are embedded apostrophes in the NEWDFT value, you must double
|
||
|
them for the process to run properly: <pre>CHGCMDDFT USRQSYS/CRTCLPGM 'AUT(*EXCLUDE) +
|
||
|
TEXT(''Isn''''t this nice text'')'</pre>
|
||
|
</li>
|
||
|
<li>Now if you press F4 to call the command prompter, then F11 to request
|
||
|
keyword prompting, you will see the following display: <pre>Command . . . . . . . . . . : CMD R CRTCLPGM
|
||
|
Library . . . . . . . . . : USRQSYS
|
||
|
New default parameter string: NEWDFT R 'AUT(*EXCLUDE)
|
||
|
TEXT(''Isn''''t this nice text'')'</pre>
|
||
|
</li>
|
||
|
<li>Now if you press the Enter key, the <span class="cmdname">Change Command Default (CHGCMDDFT)</span> command
|
||
|
string is: <pre>CHGCMDDFT CMD(USRQSYS/CRTCLPGM) NEWDFT('AUT(*EXCLUDE) +
|
||
|
TEXT(''Isn''''t this nice text'')')</pre>
|
||
|
</li>
|
||
|
<li>Press F1 to exit SEU and create and run the CL program or procedure.</li>
|
||
|
<li>The USRQSYS/CRTCLPGM will have default values of <samp class="codeph">*EXCLUDE for
|
||
|
AUT</samp> and <samp class="codeph">'Isn''t this nice text'</samp> for TEXT.</li>
|
||
|
</ol>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="ccdcp.htm" title="Some changes can be made to the command definition of a command with no further action. Other changes may require the program or procedure to be recreated, or may cause the program or procedure to function differently.">Effect of changing the command definition of a command in a procedure or program</a></div>
|
||
|
</div>
|
||
|
<div class="relinfo"><strong>Related information</strong><br />
|
||
|
<div><a href="../clfinder/finder.htm">CL command finder</a></div>
|
||
|
<div><a href="../apiref/api.htm">Application Programming Interfaces (APIs)</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|