QUERYLOGIC

Special logic rules needed to generate the result rows of the associated QUERY statement.

The QUERYLOGIC contents are used only for QUERYTYPE=REXX. The QUERYLOGIC='...' statement controls how data columns and rows are combined from the earlier input queries. The QUERYLOGIC references earlier query results by specifying the subpanel 'name' of the earlier queries. This means you should supply the NAME=xxx statement in each subpanel in your workspace and then reference those NAME values in your final SQL query. See the examples below.

The QUERYLOGIC section is interpreted by a program named KOBQRYEX, which is named in the QUERY='...AT(KOBQRYEX)...' statement for your output table.

The QUERYLOGIC contains sections marked by left and right braces for every column in your output table. The QUERYLOGIC statements must contain the same number of {...} sections as there are columns in the SELECT clause of your QUERY statement.

Within each {...} section, there is an 'assignment' statement that contains an output column name, an equal sign (=), and then the value to be assigned to the column. For example:
{ROLLAVG=QRMSUCAP.ROLLAVG}
This assignment statement says that the ROLLAVG column in your output table is to get its data from the ROLLAVG column in an earlier <SUBPANEL> query. That earlier query is the one contained in the <SUBPANEL> that contains a NAME=QRMSUCAP statement.
   
{ROLLAVG    = QRMSUCAP.ROLLAVG    }                                   
    +            +        +                                              
    |            |        |                                              
    |            |        +----------- input column name                 
    |            |                                                       
    |            +-------------------- input subpanel name               
    |                                                                    
    +--------------------------------- output column name  
The earlier subpanel would look like this:

<SUBPANEL>
NAME=QRMSUCAP
...
QUERY="SELECT ROLLAVG, ...
FROM KM5.KM5MSUCAP WHERE SYSTEM.PARMA('NODELIST','*MVS_SYSTEM',11)
AND RECTYPE = 1 ORDER BY PCTMSUCP DESC"
...
<SUBPANELEND>
That assignment statement in the QUERYLOGIC is simply copying a column value from one of the input tables into a column of your output table.
Possible Values
See examples below and the online Help information within the Enhanced 3270 User Interface.
Default Value
None

Example:


   QUERYLOGIC="                                                      
   {ROLLAVG    = QRMSUCAP.ROLLAVG    }                               
   {LPARCAPLIM = QRMSUCAP.LPARCAPLIM }                               
   {PCTMSUCP   = QRMSUCAP.PCTMSUCP   }                               
   {SMFID      = QRSYSCFG.SMFID[ORIGINNODE=QRMSUCAP.ORIGINNODE]    } 
   {LPARNAME   = QRSYSCFG.LPARNAME[ORIGINNODE=QRMSUCAP.ORIGINNODE] } 
   {PLXNAME    = QRSYSCFG.PLXNAME[ORIGINNODE=QRMSUCAP.ORIGINNODE]  } 
   "