<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<!--
Copyright (c) 2006 UGS Corp.

All Rights Reserved.

This software and related documentation are proprietary to UGS Corp.
-->
<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>ALTER</title>
      <script language="javaScript">
        abridged="false";
        displayConditions=new Array();
      </script>
      <link type="text/css" href="../css/main_styles.css" rel="stylesheet">
   </head>
   <body class="bodydocs" onload="top.pageLoader()" bgcolor="#FFFFFF">
      <hr noshade="true">
      <div class="title_refTopic" id="xps10_pagetitle">ALTER </div>
      <hr noshade="true">
      <h4 class="refClassification">Insert and/or Delete DMAP Statements </h4>
      <p class="para_refTopic">Inserts and/or deletes DMAP statements in a subDMAP. </p>
      <div class="title_refCategory">Format: </div>
      <div class="refCategoryContent"><pre class="indent">ALTER k1 [,k2]</pre><p class="para_refCategory">or </p><pre class="indent">ALTER &lsquo;string1&rsquo;[(occurrence,offset)] ,[&lsquo;string2&rsquo;[(occurrence,offset)] ]</pre><p class="para_refCategory">or </p><pre class="indent">ALTER k1 , [&lsquo;string2&rsquo;[(occurrence,offset)] ]</pre><p class="para_refCategory">or </p><pre class="indent">ALTER &lsquo;string1&rsquo;[(occurrence,offset)] , [k2]</pre></div>
      <div class="title_refCategory">Describers:</div>
      <div class="refCategoryContent">
         <table cellpadding="10" width="100%" align="center">
            <colgroup span="1">
               <col span="1" width="25.72*">
               <col span="1" width="74.28*">
            </colgroup>
            <thead>
               <tr>
                  <th align="left" colspan="1" rowspan="1">
                     <p class="para_th"><b class="uiTerm">Describer </b></p>
                  </th>
                  <th align="left" colspan="1" rowspan="1">
                     <p class="para_th"><b class="uiTerm">Meaning </b></p>
                  </th>
               </tr>
            </thead>
            <tbody>
               <tr>
                  <td align="left" colspan="1" rowspan="1" valign="top">
                     <p class="para_td">k1 </p>
                  </td>
                  <td align="left" colspan="1" rowspan="1" valign="top">
                     <p class="para_td">If k2 or &lsquo;string2&rsquo; is not specified, the subsequent DMAP statements will be inserted after either the statement number k1 or the &lsquo;string1&rsquo;, [(occurrence,offset)] reference point. </p>
                  </td>
               </tr>
               <tr>
                  <td align="left" colspan="1" rowspan="1" valign="top">
                     <p class="para_td">k1, k2 </p>
                  </td>
                  <td align="left" colspan="1" rowspan="1" valign="top">
                     <p class="para_td">DMAP statements numbered k1 through k2 will be deleted and may be replaced with subsequent DMAP statements. </p>
                  </td>
               </tr>
               <tr>
                  <td align="left" colspan="1" rowspan="1" valign="top">
                     <p class="para_td">&lsquo;string1&rsquo; </p>
                  </td>
                  <td align="left" colspan="1" rowspan="1" valign="top">
                     <p class="para_td">If &lsquo;string2&rsquo; or k2 is not specified, the subsequent DMAP statements will be inserted after the first occurrence of &lsquo;string1&rsquo;. </p>
                  </td>
               </tr>
               <tr>
                  <td align="left" colspan="1" rowspan="1" valign="top">
                     <p class="para_td">&lsquo;string1&rsquo;, &lsquo;string2&rsquo; </p>
                  </td>
                  <td align="left" colspan="1" rowspan="1" valign="top">
                     <p class="para_td">DMAP statements beginning with the first occurrence of &lsquo;string1&rsquo; through DMAP statements containing the first occurrence of &lsquo;string2&rsquo; will be deleted and may be replaced with subsequent DMAP statements. </p>
                  </td>
               </tr>
               <tr>
                  <td align="left" colspan="1" rowspan="1" valign="top">
                     <p class="para_td">occurrence </p>
                  </td>
                  <td align="left" colspan="1" rowspan="1" valign="top">
                     <p class="para_td">This flag indicates which occurrence of the proceeding string is to be used, starting at the beginning of the subDMAP.  (Integer &gt; 0; Default = 1) </p>
                  </td>
               </tr>
               <tr>
                  <td align="left" colspan="1" rowspan="1" valign="top">
                     <p class="para_td">offset </p>
                  </td>
                  <td align="left" colspan="1" rowspan="1" valign="top">
                     <p class="para_td">This flag indicates the offset from the reference DMAP statement.  Depending on the sign, the specific DMAP statement may be above (-offset) or below (+offset) the referenced DMAP statement.  (Integer; Default = 0) </p>
                  </td>
               </tr>
            </tbody>
         </table><br></div>
      <div class="title_refCategory">Remarks: </div>
      <div class="refCategoryContent">
         <ol type="1" start="1">
            <li>
               <p class="para_item">The ALTER statement must be used in conjunction with the COMPILE Executive Control statement.  Note:  ALTER statements cannot be used in conjunction with a MALTER statement, and therefore, should never immediately follow this statement. </p>
            </li>
            <li>
               <p class="para_item">If a MALTER statement is used in conjunction with the ALTER statement, then the MALTER should be placed above the COMPILE statements.  Failure to place the MALTER in this position may cause ALTER statements to be ignored. </p>
            </li>
            <li>
               <p class="para_item">The ALTERs can reference the DMAP statements in any order within a subDMAP.  Two restrictions on ordering are: </p>
               <ul>
                  <li>
                     <p class="para_item">K2 or &lsquo;string2&rsquo;(occurence, offset) references must refer to a DMAP statement number that is greater than or equal to the k1 or &lsquo;string1&rsquo;(occurrence,offset) reference within a single ALTER statement. </p>
                  </li>
                  <li>
                     <p class="para_item">K1 or &lsquo;string1&rsquo; and k2 or &lsquo;string2&rsquo; cannot overlap DMAP line positions with another ALTER that references the same subDMAP. </p>
                  </li>
               </ul>
            </li>
            <li>
               <p class="para_item">The &lsquo;string1&rsquo; or &lsquo;string2&rsquo; used as a search pattern will apply to one complete DMAP statement-i.e., a multiline DMAP statement will be searched for a pattern match as if each 72 character line of the DMAP statement were concatenated together into one string. All blanks and comments (either embedded or immediately preceding the DMAP statement) will be retained. However, comments are ignored for the following type of alter: </p><pre class="indent">alter &lsquo;^ *gp0&rsquo;</pre></li>
            <li>
               <p class="para_item">Within a SUBDMAP, both &lsquo;string1&rsquo; and &lsquo;string2&rsquo; will be used to search for a pattern match starting at the beginning of the subDMAP-not at the current position of the last string match. </p>
            </li>
            <li>
               <p class="para_item">The special characters (meta characters) used for string searching are described in Remark 9.  The characters &lt;,&gt;, and $, which are common DMAP characters, are also special meta characters.  If they are to be used in the search string as regular characters, then they must be preceded by a backward slash (\).  For example, to find the string </p><pre class="indent">IF(DDRMM &gt;=-1)</pre><p class="para_item">the command is </p><pre class="indent">ALTER &lsquo;IF (DDRMM \&gt;=-1)&rsquo; $</pre></li>
            <li>
               <p class="para_item">The ALTER statement must not exceed 72 characters (no continuations are allowed). </p>
            </li>
            <li>
               <p class="para_item">&lsquo;string2&rsquo; (r2,02) can be defaulted to &lsquo;string1&rsquo; (r1,01) by using a null string (&lsquo;&rsquo;).  For example, the alter statement </p><pre class="indent">ALTER &lsquo;string1&rsquo;(r1,01),&lsquo;&rsquo;</pre><p class="para_item">is equivalent to </p><pre class="indent">ALTER &lsquo;string1&rsquo;(r1,01),&lsquo;string1&rsquo;(r1,01)</pre><p class="para_item">The defaults for (r2,02) using the null string can be overridden by specifying (r2,02). </p>
               <p class="para_item">As another example, the alter statement </p><pre class="indent">ALTER &lsquo;string1&rsquo;(r1,01),&lsquo;&rsquo;(r2,02)</pre><p class="para_item">is equivalent to </p><pre class="indent">ALTER &lsquo;string1&rsquo;(r1,01),&lsquo;string1&rsquo;(r2,02)</pre></li>
            <li>
               <p class="para_item">Meta characters: </p>
               <table cellpadding="7" width="100%" align="center">
                  <colgroup span="1">
                     <col span="1" width="14.43*">
                     <col span="1" width="85.57*">
                  </colgroup>
                  <tbody>
                     <tr>
                        <td align="left" colspan="1" rowspan="1" valign="top">
                           <p class="para_td">. </p>
                        </td>
                        <td align="left" colspan="1" rowspan="1" valign="top">
                           <p class="para_td">Matches any <em>single</em> character except <em>newline</em>. 
                           </p>
                        </td>
                     </tr>
                     <tr>
                        <td align="left" colspan="1" rowspan="1" valign="top">
                           <p class="para_td">* </p>
                        </td>
                        <td align="left" colspan="1" rowspan="1" valign="top">
                           <p class="para_td">Matches any number (including zero) of the single character (including a character specified by a regular expression) that immediately precedes it.  For example, since &ldquo;.&rdquo; (dot) means any character, &ldquo;.*&rdquo; means &ldquo;match any number of characters&rdquo;. </p>
                        </td>
                     </tr>
                     <tr>
                        <td align="left" colspan="1" rowspan="1" valign="top">
                           <p class="para_td">[...] <br>or &lt; &gt; 
                           </p>
                        </td>
                        <td align="left" colspan="1" rowspan="1" valign="top">
                           <p class="para_td">Matches any <em>one</em> of the characters enclosed between the brackets.  For example, &ldquo;[AB]&rdquo; matches either &ldquo;A&rdquo; or &ldquo;B&rdquo;.  A range of consecutive characters can be specified by separating the first and last characters in the range with a hyphen.  For example &ldquo;[A-Z]&rdquo; will match any uppercase letter from A to Z and &ldquo;[0-9]&rdquo; will match any digit from 0 to 9.  Some meta characters lose special meaning inside brackets.  A circumflex (^) as the first character in the bracket tries to match any one character <em>not</em> in the list. 
                           </p>
                        </td>
                     </tr>
                     <tr>
                        <td align="left" colspan="1" rowspan="1" valign="top">
                           <p class="para_td">^ or ! <br>or -<sub class="subscript">|</sub></p>
                        </td>
                        <td align="left" colspan="1" rowspan="1" valign="top">
                           <p class="para_td">Requires that the following regular expression be found at the beginning of the line. Note, that these meta characters may lead to UFM 802 if the preceding line is a comment. </p>
                        </td>
                     </tr>
                     <tr>
                        <td align="left" colspan="1" rowspan="1" valign="top">
                           <p class="para_td">$ </p>
                        </td>
                        <td align="left" colspan="1" rowspan="1" valign="top">
                           <p class="para_td">Requires that the preceding regular expression be found at the end of the line. </p>
                        </td>
                     </tr>
                     <tr>
                        <td align="left" colspan="1" rowspan="1" valign="top">
                           <p class="para_td">\ </p>
                        </td>
                        <td align="left" colspan="1" rowspan="1" valign="top">
                           <p class="para_td">Treats the following special character as an ordinary character.  For example &ldquo; \ .&rdquo; stands for a period and &ldquo; \*&rdquo; for an asterisk.  Also, to search for a tic (&rsquo;), the search string must be single quotes. </p>
                        </td>
                     </tr>
                     <tr>
                        <td align="left" colspan="1" rowspan="1" valign="top">
                           <p class="para_td">&rsquo; </p>
                        </td>
                        <td align="left" colspan="1" rowspan="1" valign="top">
                           <p class="para_td">Marks the beginning and end of a pattern to be matched. </p>
                        </td>
                     </tr>
                     <tr>
                        <td align="left" colspan="1" rowspan="1" valign="top">
                           <p class="para_td">&nbsp; </p>
                        </td>
                        <td align="left" colspan="1" rowspan="1" valign="top">
                           <p class="para_td">Note: Nonportable characters such as ^ and [ ] should be replaced (e.g., ^ &rarr; ! and [] &rarr; &lt;&gt;) if portability is required.  However, all the above characters are recognized by NX Nastran. </p>
                        </td>
                     </tr>
                  </tbody>
               </table><br></li>
            <li>
               <p class="para_item">If a string-based alter uses the &ldquo;!&rdquo; in the expression (find occurrence at the beginning of line), it is possible NX Nastran will fail with USER FATAL MESSAGE 802. </p>
            </li>
         </ol>
      </div>
      <div class="title_refCategory">Examples: </div>
      <div class="refCategoryContent">
         <ol type="1" start="1">
            <li>
               <p class="para_item">The following alter will insert a MATPRN DMAP statement after the first occurrence of the string &rsquo;SDR2&rsquo; in subDMAP DSASTAT. </p><pre class="indent">SOL 101
COMPILE DSASTAT $
ALTER &rsquo;SDR2&rsquo; $
MATPRN OESDS1//$
CEND</pre></li>
            <li>
               <p class="para_item">The following alter will delete the second occurrence of the OUTPUT4 DMAP statement in subDMAP DSASTAT and replace it with a MATPRN DMAP statement. </p><pre class="indent">SOL 101
COMPILE DSASTAT $
ALTER &lsquo;OUTPUT4&rsquo;(2),&lsquo;OUTPUT4&rsquo;(2) $
$ OR
$ ALTER &lsquo;OUTPUT4&rsquo;(2),&lsquo;&rsquo; $
MATPRN OESDS1//$
CEND</pre></li>
         </ol>
      </div>
   </body>
</html>