<!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>WHERE and CONVERT Clauses</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">WHERE and CONVERT Clauses </div>
      <hr noshade="true">
      <p class="para_refTopic">The WHERE clause is used in the selection of items (data blocks and parameters) on the DBDICT, DBLOCATE, DBLOAD, and DBUNLOAD statements.  The CONVERT clause modifies qualifier values of items selected by the WHERE clause on the DBLOCATE and DBLOAD statements. </p>
      <p class="para_refTopic">The WHERE and CONVERT clauses specify values for PROJECT, VERSION, qualifiers, and DBSET.  PROJECT specifies the project-ID that is originally defined on the PROJECT FMS statement at the time the project is created.  VERSION specifies the desired version-ID under the project-ID.  Qualifiers are used to uniquely identify items on the database with the same name.  For example, data block KAA has SEID as one of its qualifiers, which is the superelement ID.  An item may have more than one qualifier and the collection of all qualifiers assigned to an item is called a path. </p>
      <p class="para_refTopic">All data blocks and parameters with qualifiers are defined in the NDDL (NASTRAN Data Definition Language) sequence. See the <a class="links" href="javascript:void(0)" onclick="top.popUpPage('QRG/linkInter_target_not_resolved.html#dmap:ref86112:-aux,-home','linkInter','menubar=yes,status=yes,resizable=yes,toolbar=yes,scrollbars=yes,location=no,directories=no');return(false);"><em>NX Nastran DMAP Programmer&rsquo;s Guide</em></a>.  Data blocks and parameters are defined on the DATABLK and PARAM NDDL statements.  The DATABLK and PARAM statements specify the name of the data block, parameter, and also its pathname.  The pathnames are defined on the PATH NDDL statement, which lists the qualifiers assigned to the path.  Qualifiers are defined on the QUAL NDDL statement.  DBSET specifies the desired DBset.  The DBset of an item is specified after the LOCATION keyword on the DATABLK and PARAM NDDL statement. 
      </p>
      <p class="para_refTopic">The format of the WHERE clause is: </p>
      <p class="para_refTopic">WHERE (where-expr)</p>
      <p class="para_refTopic">where-expr is a logical expression that specifies the desired values of qualifiers, PROJECT, VERSION, and DBSET.  If the result of the logical expression is TRUE for an item on the database then the item is selected.  For example, WHERE(VERSlON=4 AND SEID &lt; &gt; 2 AND SEID &gt; 0) selects all items under version 4 for all values of SEID greater than 0 except 2. </p>
      <p class="para_refTopic">A simple where-expr is a comparison using the following relational operators = , &gt; , &lt; , &lt; = , &gt; =, &gt;&lt; or &lt;&gt;.  For example, SEID &gt; 0 means if SEID is greater than zero, then the logical expression is true.  Several simple where expressions may be joined into a single where-expression using the following logical operators: AND, OR, XOR, and EQV.  The NOT operator may be used to negate a where expression.  For example, NOT(SEID &gt; 0) is the same as SEID &lt; = 0.  Arithmetic operations and DMAP functions may also be specified in the where-expression. (See the <a class="links" href="javascript:void(0)" onclick="top.popUpPage('QRG/linkInter_target_not_resolved.html#dmap:ref86112:-aux,-home','linkInter','menubar=yes,status=yes,resizable=yes,toolbar=yes,scrollbars=yes,location=no,directories=no');return(false);"><em>NX Nastran DMAP Programmer&rsquo;s Guide .</em></a>) 
      </p>
      <p class="para_refTopic">If a qualifier in a where-expr is not a qualifier in the path of a specified item, then the where-expr is set to FALSE.  If the where-expr does not contain a specification for all qualifiers in the path of an item, then the unspecified qualifiers will be wildcarded, (i.e., quali= * , all values will be selected). The default values of qualifiers, PROJECT, VERSION, and DBSET are described under the statement in which the WHERE clause is specified. </p>
      <p class="para_refTopic">Examples of the WHERE clause are: </p>
      <ol type="1" start="1">
         <li>
            <p class="para_item">Select all items in the database for all superelements except 10 and 30 from Version 1. </p><pre class="indent">WHERE (VERSION=1 AND SEID&gt;=0 AND NOT(SEID=10 OR SEID=30))</pre></li>
         <li>
            <p class="para_item">Select all entries in the database on DBSET=DBALL from all projects and versions. </p><pre class="indent">WHERE(PROJECT=PROJECT AND VERSlON&gt;0 AND DBSET=&rsquo;DBALL&rsquo;)</pre></li>
      </ol>
      <p class="para_refTopic">The CONVERT clause modifies project- and version-ID, DBset-name (see INIT statement), and qualifier values of items selected by the WHERE clause on the DBLOCATE and DBLOAD statements.  It contains one or more assignment statements separated by semicolons.  The format of the CONVERT clause is: </p>
      <p class="para_refTopic">CONVERT(PROJECT=project-expr; VERSION=version-expr; ,  </p>
      <p class="para_refTopic">The PROJECT and VERSION statements modify the project-ID (see PROJECT FMS statement) and version-ID.  The DBSET statement modifies the DBset-name.  The value of quali will be replaced by qual-expri for selected items that have quali in their path.  qual-expri is any valid expression (see <a class="links" href="javascript:void(0)" onclick="top.popUpPage('QRG/linkInter_target_not_resolved.html#dmap:ref80742:-aux,-home','linkInter','menubar=yes,status=yes,resizable=yes,toolbar=yes,scrollbars=yes,location=no,directories=no');return(false);">&ldquo;Expressions and Operators&rdquo;</a> in the <em>NX Nastran DMAP Programmer&rsquo;s Guide</em>) containing constants or any qualifier name defined in the path of the item.  If qual-expri contains names of qualifiers not in the path of the selected item, then a fatal message is issued.  If project-expr and/or version-expr produces a project- or version-ID which does not exist, then one will be created.  Also, all version-IDs less than version-expr that do not exist will be created; but they will be &ldquo;empty.&rdquo; 
      </p>
      <p class="para_refTopic">Examples of the CONVERT clause are: </p>
      <ol type="1" start="1">
         <li>
            <p class="para_item">Set qualifiers SEID, PEID, and SPC to constants 10, 20, 102 respectively. </p><pre class="indent">CONVERT(SEID=10;PEID=20;SPC=102)</pre><p class="para_item">If more than one value of a qualifier is found for an item by the WHERE clause, then each value is processed in qual-expri to define the new qualifier value for each of the selected items.  In the example below, if the original values of PEID were 1, 2, and 3; then the new values for the SEID qualifier will be 2, 4, and 6. </p>
         </li>
         <li>
            <p class="para_item">Set all values of qualifier SEID to be twice that of the values of qualifier PEID. </p><pre class="indent">CONVERT(SEID=2*PEID)</pre></li>
      </ol>
   </body>
</html>