SSM10 Application Server Help
SSM10 Application Server Help
0
Target Audience
Technical Consultants System Administrators
SAP AG Neurottstrae 16 69190 Walldorf Germany T +49/18 05/34 34 24 F +49/18 05/34 34 20 www.sap.com
Copyright 2011 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, System z9, z10, z9, iSeries, pSeries, xSeries, zSeries, eServer, z/VM, z/OS, i5/OS, S/390, OS/390, OS/400, AS/400, S/390 Parallel Enterprise Server, PowerVM, Power Architecture, POWER6+, POWER6, POWER5+, POWER5, POWER, OpenPower, PowerPC, BatchPipes, BladeCenter, System Storage, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, Parallel Sysplex, MVS/ESA, AIX, Intelligent Miner, WebSphere, Netfinity, Tivoli and Informix are trademarks or registered trademarks of IBM Corporation. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP BusinessObjects Explorer, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries. Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and
other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects Software Ltd. in the United States and in other countries. Sybase and Adaptive Server, iAnywhere, Sybase 365, SQL Anywhere, and other Sybase products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Sybase, Inc. Sybase is an SAP company. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies (SAP Group) for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. Disclaimer Some components of this product are based on Java. Any code change in these components may cause unpredictable and severe malfunctions and is therefore expressly prohibited, as is any decompilation of these components. Any Java Source Code delivered with this product is only to be used by SAPs Support Services and may not be modified or altered in any way.
Legal Software Terms Terms for Included Open Source Software This SAP software contains also the third party open source software products listed below. Please note that for these third party products the following special terms and conditions shall apply. Documentation in the SAP Service Marketplace You can find this document at the following address: http://service.sap.com/instguides
Typographic Conventions
Type Style Example Text Represents Words or characters that appear on the screen. These include field names, screen titles, pushbuttons as well as menu names, paths and options. Cross-references to other documentation Example text Emphasized words or phrases in body text, titles of graphics and tables Names of elements in the system. These include report names, program names, transaction codes, table names, and individual key words of a programming language, when surrounded by body text, for example, SELECT and INCLUDE. Screen output. This includes file and directory names and their paths, messages, names of variables and parameters, source code as well as names of installation, upgrade and database tools. Exact user entry. These are words or characters that you enter in the system exactly as they appear in the documentation. Variable user entry. Pointed brackets indicate that you replace these words and characters with appropriate entries. Keys on the keyboard, for example, function keys (such as F2) or the ENTER key.
Icons
Icon Meaning Caution Example Note Recommendation Syntax
EXAMPLE TEXT
Example text
Example text
<Example text>
EXAMPLE TEXT
Document History
The following table provides an overview of the most important document changes.
Version 1.0
Changed default value of MAXSETS in lsserver.ini from 1,000 to 5,000 Made corrections to KILL, WRITE. Added CLEAN WORK DATABASES (Supervisor) command. Added EXHIBIT MEASURE NONVIRTUAL, CREATE variable [MIN | MAX], SET VARIABLE [MIN | MAX] Corrected the MAXLOGIN default on CHANGEUSER and CREATE USER.
2.3
November 7, 2011
Contents
1 Introduction ............................................................................ 15 2 Getting Started ....................................................................... 16
2.1 Starting Application Server Before Creating Users or Databases ........................................................................................16 2.2 Starting Application Server with a User and a Database ..16 2.3 Exiting from Application Server from the Task Bar ...........16 2.4 Exiting from Application Server from the IDQL Tab ..........17 2.5 Creating a Remote Server Connection ...............................17 2.6 Running in Batch from the Command Line ........................18 2.7 Running Application Server Jobs in Batch from a UNIX Server ...............................................................................................19
November 2011
4.15 4.16 5.1 5.2 5.3 5.4 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 6.10 6.11 6.12 6.13 6.14 6.15 6.16 6.17 6.18 6.19 6.20 6.21 6.22 6.23 6.24 6.25 6.26 6.27 6.28 6.29 6.30
Importing data ...................................................................138 Frequently Asked Questions ...........................................139 Debugging ...........................................................................143 Maximums and Limits .........................................................146 Creating a Dump File with Multiple Partitions ..................150 Configuring Application Server for International Use .....151 ABS( ) ...................................................................................152 ACCESS DBASE ..................................................................152 ACCESS EXTERNAL ...........................................................153 ACCESS LSLINK .................................................................155 ACCUM( ) .............................................................................156 ACROSS/DOWN ..................................................................157 ACRSLIH( ) ...........................................................................159 ACRSPP( ) ............................................................................160 ACRSRP( ) ............................................................................160 ADD ACCESS (Supervisor) ..............................................160 ADD DATABASE (Supervisor) .........................................161 ADD USER (Supervisor) ................................................... 162 ALL-ENDALL .....................................................................162 ALLOCATE (Dimension or CONSTRUCT).......................163 ANALYZE ...........................................................................163 ANALYZE: Analytics Options ..........................................164 ANALYZE: Forecasting Options ......................................166 ANALYZE: Regression Option .........................................167 ANALYZE: Smoothing Options ........................................170 ANALYZE: Statistical Options .........................................171 ASK .....................................................................................172 ATTACH .............................................................................177 ATTRIBUTE ........................................................................177 BEGIN-END ........................................................................180 BYPERIOD-ENDBYPERIOD ..............................................180 CALCULATE ......................................................................180 CHANGE DATABASE (Supervisor) .................................183 CHANGE USER (Supervisor) ...........................................184 CHECKPOINT ....................................................................186 CLASS (Dimension or CONSTRUCT) ..............................187
November 2011
6.31 6.32 6.33 6.34 6.35 6.36 6.37 6.38 6.39 6.40 6.41 6.42 6.43 6.44 6.45 6.46 6.47 6.48 6.49 6.50 6.51 6.52 6.53 6.54 6.55 6.56 6.57 6.58 6.59 6.60 6.61 6.62 6.63 6.64 6.65 6.66 6.67 6.68 6.69
CHG( ) .................................................................................188 CLEAN WORK DATABASES (Supervisor) ......................188 CLEAR ................................................................................189 CLEAR STATUS ................................................................190 COLHEADING-ENDCOLHEADING (Report) ....................190 COMPILE ............................................................................191 COMPILE ATTRIBUTE ......................................................192 CONSOLIDATE ..................................................................193 CONSTRUCT (Access) ......................................................195 CONSTRUCT ATTRIBUTE ................................................198 COPY ..................................................................................203 CREATE Variable ..............................................................204 CREATE (Access) or LSS CREATE .................................209 CREATE DATABASE (Supervisor) ..................................210 CREATE Dimension User_Defined_Hierarchy ...............213 CREATE GROUP (Supervisor) .........................................215 CREATE USER (Supervisor) ............................................215 CREATE VERSION ............................................................216 CSWITCH ...........................................................................216 DECONSTRUCT.................................................................218 DEFINE SYNONYM (Access) ............................................218 DESCRIPTION (Access External) ....................................219 Description ........................................................................219 DETACH .............................................................................220 DIFF( ) .................................................................................222 Using DIFF and ACCUM ...................................................222 DIMENSION ........................................................................223 DIRECTORY .......................................................................225 DISABLE (Supervisor) ......................................................226 DISPLAY .............................................................................227 DISPLAY (Logic) ................................................................227 DOCUMENT .......................................................................228 DO-ENDDO .........................................................................229 DUMP ..................................................................................229 DUMP (Supervisor) ...........................................................232 ECHO ..................................................................................233 ENABLE (Supervisor) .......................................................233 END .....................................................................................234 EXECUTE ...........................................................................234
November 2011
6.70 6.71 6.72 6.73 6.74 6.75 6.76 6.77 6.78 6.79 6.80 6.81 6.82 6.83 6.84 6.85 6.86 6.87 6.88 6.89 6.90 6.91 6.92 6.93 6.94 6.95 6.96 6.97 6.98 6.99 6.100 6.101 6.102 6.103 6.104 6.105 6.106 6.107 6.108
EXHIBIT ..............................................................................235 EXIT ....................................................................................289 EXP( ) ..................................................................................290 EXTEND ..............................................................................290 EXTEND (Supervisor) .......................................................292 FOOTNOTE-ENDFOOTNOTE (Report) ............................292 FOR .....................................................................................292 FORCE (Supervisor) .........................................................293 FREE (Supervisor) ............................................................294 GET ENVIRONMENT .........................................................295 HEADING-ENDHEADING (Report) ...................................296 HIERARCHY (Dimension) .................................................297 IF-OTHERWISE ..................................................................299 IN (OF) FROM VERSION ...................................................299 INDEX-CASE-ENDINDEX ..................................................300 INDEX USER-CASE-ENDINDEX .......................................301 INPUT (Dimension) ............................................................303 INT( ) ...................................................................................304 IRR( ) ...................................................................................305 IS .........................................................................................305 JOB .....................................................................................306 KEY (Dimension) ...............................................................307 KILL (Supervisor) ..............................................................307 LAG( ) .................................................................................308 LAST( ) ...............................................................................309 LATEST ..............................................................................309 LEAD( ) ...............................................................................309 LEVEL (Dimension) ...........................................................310 LIST.....................................................................................311 LN( ) .................................................................................... 312 LOAD ................................................................................312 LOAD (Supervisor) ..........................................................313 LOG( ) ............................................................................... 313 LOGIC ...............................................................................314 LOOP-ENDLOOP .............................................................314 MASK-ENDMASK ............................................................315 MAX( ) ...............................................................................315 MEAN( ) ............................................................................316 MEAN2() ...........................................................................316
November 2011
6.109 6.110 6.111 6.112 6.113 6.114 6.115 6.116 6.117 6.118 6.119 6.120 6.121 6.122 6.123 6.124 6.125 6.126 6.127 6.128 6.129 6.130 6.131 6.132 6.133 6.134 6.135 6.136 6.137 6.138 6.139 6.140 6.141 6.142 6.143 6.144 6.145 6.146 6.147
MIN( ) ................................................................................317 MORTGAGE( ) ..................................................................317 MOVING( ) ........................................................................318 MOVING2() .......................................................................318 NCASES( ) ........................................................................319 NDAYS( ) ..........................................................................320 NEWPAGE ........................................................................320 NOCALC-ENDNOCALC ...................................................320 NPV( )................................................................................321 NROWS( ) .........................................................................321 OBS( ) ............................................................................... 321 ON .....................................................................................322 ORDER .............................................................................322 ORDER (Report) ..............................................................326 OUTPUT ...........................................................................327 OUTPUT (Dimension) ......................................................328 PARHEADING-ENDPARHEADING (Report) ..................329 PEEK (Access) ................................................................329 PERCHG( ) .......................................................................330 PERIODSAVAILABLE() ...................................................331 PREFACE (Report) ..........................................................331 PRINT................................................................................332 PROCEDURE ...................................................................333 PURGE .............................................................................333 QUIT ..................................................................................334 RANDOM( ) .......................................................................335 RANK( ) ............................................................................335 READ (Access) ................................................................336 RECONSTRUCT (Access) ...............................................339 RECOVER ........................................................................339 REMOVE ...........................................................................340 REMOVE ACCESS (Supervisor) ....................................343 REMOVE DATABASE (Supervisor) ...............................344 REMOVE GROUP (Supervisor) ......................................344 REMOVE PROTECTION (Supervisor) ............................344 REMOVE USER (Supervisor) .........................................345 RENAME ...........................................................................345 REPEAT-UNTIL ................................................................346 REPORT ...........................................................................346
November 2011
6.148 6.149 6.150 6.151 6.152 6.153 6.154 6.155 6.156 6.157 6.158 6.159 6.160 6.161 6.162 6.163 6.164 6.165 6.166 6.167 6.168 6.169 6.170 6.171 6.172 6.173 6.174 6.175 6.176 6.177 6.178 6.179 6.180 6.181 6.182 6.183 6.184 6.185 6.186
RESTORE CUSTOM ........................................................350 RESULT (Dimension) ......................................................350 RETURN ...........................................................................351 ROLLUP ...........................................................................352 ROUND( ) ..........................................................................358 ROWS(Report) .................................................................358 SAVE (Access External) .................................................360 SAVE CONTROL ..............................................................360 SAVE CUSTOM ................................................................360 SAVE DATA .....................................................................362 SAVE STATUS .................................................................363 SD( ) ..................................................................................364 SELECT <dimension> .....................................................364 SELECT <attribute> ........................................................367 SELECT measures ..........................................................370 SELECT <variables> .......................................................371 SELECT VERSION ...........................................................375 SET ...................................................................................375 SET BUFFERS .................................................................376 SET CELLS ......................................................................377 SET CHARSET .................................................................377 SET CONTROL ................................................................378 SET DATE ........................................................................379 SET DEFAULT .................................................................379 SET DEFAULT Periodicity ..............................................381 SET DENSE ......................................................................383 SET DETAIL .....................................................................383 SET-ENDSET (Report) ....................................................385 SET ENVIRONMENT ........................................................391 SET FISCAL .....................................................................392 SET IGNOREMISSING MEMBERS .................................395 SET INDENTATION ..........................................................395 SET LABEL ......................................................................396 SET LATEST|EARLIEST .................................................396 SET MEMORY ..................................................................397 SET MESSAGE ................................................................398 SET PERIOD ....................................................................398 SET ONERROR ................................................................399 SET periodicity ................................................................400
10
November 2011
6.187 6.188 6.189 6.190 6.191 6.192 6.193 6.194 6.195 6.196 6.197 6.198 6.199 6.200 6.201 6.202 6.203 6.204 6.205 6.206 6.207 6.208 6.209 6.210 6.211 6.212 6.213 6.214 6.215 6.216 6.217 6.218 6.219 6.220 6.221 6.222 6.223 6.224 6.225
SET PRINTER ..................................................................400 SET PROGRESS ..............................................................400 SET REASSURANCE ......................................................401 SET REREAD ...................................................................401 SET QUERY VARIABLE ..................................................401 SET SELECT ....................................................................402 SET SHARE INTERVAL ...................................................402 SET SHORT|LONG ..........................................................402 SET SPARSE ...................................................................403 SET VARIABLES .............................................................404 SHOW ...............................................................................408 SHOW (Access External) ................................................413 SHOW (Supervisor) .........................................................413 SKIP (Report) ...................................................................417 SNAPSHOT ......................................................................417 SOLVE-ENDSOLVE .........................................................421 SQRT( ) .............................................................................421 STATUS ............................................................................421 SUBTOTAL-ENDSUBTOTAL (Report) ...........................422 SUBTOTAL INCLUDE (Report) .......................................423 SUBTRACT DATABASE (Supervisor) ...........................423 SUM (Dimension) ............................................................424 SUMMARY-ENDSUMMARY (Report) .............................424 SUPERVISOR ...................................................................425 SWITCH ............................................................................425 SYNC ................................................................................426 SYNONYM ........................................................................427 TABLE( ) ...........................................................................428 TABS (Report) .................................................................428 TABS SINGLE (Report) ...................................................429 TEXT (Report) ..................................................................429 TIME ..................................................................................430 TITLE (Report) .................................................................431 TOTAL( ) ...........................................................................432 TRACE ..............................................................................432 TYPE .................................................................................434 UDASH (Report) ..............................................................434 UDATA (Report) ...............................................................435 UNAME (Report) ..............................................................435
November 2011
11
6.226 6.227 6.228 6.229 6.230 6.231 6.232 6.233 6.234 6.235 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 7.10 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 8.10 8.11 8.12 8.13 8.14 8.15 8.16
USE ...................................................................................435 USE (Access) ...................................................................436 UTEXT (Report) ...............................................................437 VALUE( ) ...........................................................................437 VERSION ..........................................................................438 WHEN-ENDWHEN ...........................................................438 WHILE-ENDWHILE ..........................................................439 WRITE (Access) ...............................................................440 XRAY (Supervisor) ..........................................................440 YIELD( ) ............................................................................441 What Is a Schema? .............................................................442 How a Schema is Structured ..............................................442 Creating a Schema ..............................................................443 Creating a Hybrid OLAP Model ..........................................443 Using Fact Tables in External Applications .....................457 Working with SCHEMA Subsystem ...................................457 Importing ..............................................................................458 Deleting a Schema .............................................................. 459 Viewing Definitions .............................................................459 Working with Dimensions, Variables and Data ..............459 CACHE (Schema) ................................................................461 CONSOLIDATE {PENDING | INCREMENTAL} (Schema) .462 DELTA (Schema) .................................................................464 DROP BASE (Schema) ........................................................464 DROP DIMENSION (Schema) .............................................465 DROP REFERENCES (Schema) .........................................465 DROP SCHEMA (Schema) ..................................................466 DROP VARIABLE (Schema) ............................................... 466 EXPORT BASE (Schema) ................................................... 466 EXPORT DATA (Schema) ................................................. 469 EXPORT DIMENSION (Schema) .......................................471 EXPORT MASTER (Schema) ............................................473 EXPORT SCHEMA (Schema) ............................................474 EXPORT SKELETON (Schema) ........................................477 EXPORT VARIABLE (Schema) .........................................478 IMPORT DATA (Schema) ..................................................479
12
November 2011
8.17 IMPORT DIMENSION (Schema) ........................................480 8.18 IMPORT DIMENSION (SAP NetWeaver BI Connector) ...480 8.19 IMPORT SCHEMA (Schema) ............................................482 8.20 IMPORT SCHEMA (SAP NetWeaver BI Connector) .......482 8.21 IMPORT TIME (SAP NetWeaver BI Connector)...............484 8.22 IMPORT VARIABLES (Schema) ....................................... 485 8.23 IMPORT VARIABLES (SAP NetWeaver BI Connector) ..485 8.24 IMPORT QUERY VARIABLES (SAP NetWeaver BI Connector) .....................................................................................486 8.25 PREFIX (Schema) ..............................................................486 8.26 SCHEMA (Schema) ...........................................................487 8.27 SET LABEL (Schema) .......................................................487 8.28 SET VARIABLE (Schema) .................................................488 8.29 SPY (Schema) ....................................................................488 8.30 TRACKER INSERT (Schema) ........................................... 489 8.31 TRIGGER (Schema) ...........................................................489 8.32 VIEW CACHE (Schema) ....................................................490 8.33 VIEW CONNECTION (Schema) .........................................490 8.34 VIEW DIMENSION (Schema) ............................................490 8.35 VIEW PREFIX (Schema) ....................................................491 8.36 VIEW <rowsettype> ROWSET ..........................................491 8.37 VIEW SPANS TYPE ...........................................................492 8.38 VIEW TIME RANGE ...........................................................492 8.39 VIEW SCHEMA (Schema) ................................................. 492 8.40 VIEW SPY (Schema) ..........................................................493 8.41 VIEW VARIABLE (Schema) ..............................................493 8.42 DROP DATA (Schema) ......................................................493 8.43 CONNECT (Schema) .........................................................493 8.44 IMPORT FISCAL (Schema) ...............................................494 8.45 SQL (Schema) ....................................................................494 8.46 ORDER DRILLTHRU (Schema) ........................................494
November 2011
13
Introduction
9.7 Dimension Tables ...............................................................500 9.8 Dimension Delta Tables ......................................................501 9.9 By Dimensions Table ..........................................................501 9.10 Periodicities Table ............................................................502 9.11 Master Table ......................................................................502 9.12 Month Names Table ..........................................................503 9.13 Day Names Table ..............................................................503 9.14 Format Table ......................................................................503 9.15 Period Format Table .........................................................504 9.16 Variables Table ..................................................................504 9.17 Dimension Levels Table ...................................................506 9.18 Tracker Table .....................................................................506 9.19 Reference Tables ..............................................................507 9.20 Attribute Tables .................................................................508 9.21 Table Parameters Table Reference .................................508
14
November 2011
Introduction
Introduction
Target Groups
Technical Consultants System Administrators Solution Consultants Business Process Owner Support Specialist
November 2011
15
2
2.1
Getting Started
Starting Application Server Before Creating Users or Databases
Procedure
1. On the Windows taskbar, choose Start -> All Programs -> SAP BusinessObjects -> Strategy Management. 2. When the Application Server login dialog box appears, enter the user names that already exist in MASTERDB. Check your release notes for more information about these special function logins: admin super supervisor 3. Click OK.
2.2
Procedure
1. On the Windows taskbar, choose Start -> All Programs -> SAP BusinessObjects -> Strategy Management. If you have not previously specified login parameters in the Options dialog box, the Application Server login dialog box is displayed by default when the Application Server program starts. 2. When the Application Server login dialog box appears, do the following: a. In the User text box, type the user name. b. In the Password text box, type the user's password. c. In the Server text box, enter the name of the default database for the specified user.
3. Click OK. Note: Once you are logged in to Application Server, the current model name and access mode are shown on the status bar. Learn how to change the dimensional model and access mode. Application Server is installed with language files based on the language set for your system. For information about overriding regional settings for currency and dates and other things, see Configuring Application Server for international use.
2.3
Procedure
1. From the File menu, choose Exit Application Server. Or, double-click the icon at the top-left corner of the application window.
16
November 2011
Getting Started
2. (Optional) If you have made changes that you have not yet saved, Application Server prompts you to save the changes. Do one of the following: Click Yes to save the changes and exit. Click No to exit without saving the changes. Click Cancel to cancel the exit request. 3. (Optional) If "Confirm before exiting Application Server" is selected in the Options dialog box, Application Server prompts you to save your Work database. Do one of the following: Click Yes to save your Work database and exit. Click No to exit without saving the Work database.
2.4
Procedure
Enter the EXIT or EXIT CLEAR command in the Input window. Note: By default when you close Application Server by choosing Exit from the File menu, an EXIT command is executed. However, by adding the line EXITCLEAR=Yes to the Windows section of LSSERVER.INI, Application Server is closed by executing an EXIT CLEAR command.
2.5
Procedure
1. From the File menu, choose New and then choose Remote Server to display the Create Remote Server dialog box. 2. In the Server Name text box, type the name of the server. 3. In the Service text box, type the service. 4. In the Port text box, specify the port that is used for TCP/IP communication with the server. 5. In the User name text box, type your username to log onto the server. 6. In the Password text box, type the password to log onto the server. 7. (Optional) To list all commands issued on the client, select Trace Application Server commands. In the Trace file name text box, specify the file name (and path) to contain the trace details. Then, select Detailed or Basic to specify the level of trace information to write for each command. 8. Click OK.
Notes:
This remote server information gets written to your lsserver.ini file. The password is written to the lsserver.ini file in encrypted format. If you want to be prompted to type your password every time you try to connect to a remote server rather than store the password encrypted in lsserver.ini, make sure the EncryptedPassword= value in the [remote server] section in the lsserver.ini file is either blank or has a question mark (?).
November 2011
17
2.6
Procedure
-u username
Tip: The pasadmin.exe command line will return immediately if the user could not log in or the job is terminated immediately.
Examples
Example 1: This command line logs in the user as user ADMIN and the password BLUEBIRD, and then runs the procedure named TESTPROC using the JOB command: PASADMIN.EXE -j TESTPROC -u ADMIN -p BLUEBIRD Note: If you log in as ADMIN, it will use your default database. You can verify the default database by issuing a SUPERVISOR SHOW USER ADMIN command to see the default database (usually JUICE in READ mode). You may want to create a user that is used by the Batch scripts, and has admin rights, and uses a default database of proclib where proclib is the name of your procedures library database. Example 2: This example runs procedures that are stored in an Application Server model. In this example, there is a database called PROCLIB that is attached to JUICE, and there is a procedure called "Test" that will be run in PROCLIB: PASAdmin.exe -u admin -j test;PROCLIB The procedure test just copies the procedure from TEST to TEST2... a very simple test. copy proc test;proclib test2;proclib Example 3: This example runs external Application Server procedures. The Application Server procedures are not stored in PROCLIB, but rather in c:\temp as flat files:
18
November 2011
Getting Started
2.7
Sample UNIX shell scripts are provided to run Application Server jobs in a batch process. You can modify files named batch1, batchtlss.ksh, and batchlss.csh to reflect your installation configuration. Almost all UNIX batch jobs are scheduled using the cron utility, which is available on all UNIX systems.
Procedure to display systems manual information about using the cron utility
Type the following at the UNIX prompt: "man cron"
November 2011
19
3
3.1
Application Server Administrator has an Explorer window and a Trace window. Within the Explorer window, there are tabs and panes for working with your dimensional model and the IDQL commands.
Features
Trace window The Trace window lists all the Application Server commands executed on the client system. The Trace window is hidden by default when you start Application Server. Explorer window The Explorer window is displayed when you first start Application Server. It has these features: Hierarchical pane The hierarchical list pane contains the following hierarchical lists: Dimensional Models - The Dimensional Models list contains information about all the dimensional models that exist in your MASTERDB. The following details are listed for each dimensional model: binary sets, dimensions, documents, logics, measures, procedures, reports, synonyms, time sets, and users. To display details of dimensions, documents, logics, measures, procedures, reports, synonyms, time sets, and users, make sure the List tab is selected, and then click the appropriate icon in the Dimensional Models hierarchical list. Security - The Security hierarchical list is displayed only to users with administrator authority, and contains details of users and User-Defined Hierarchies. It also contains security information for each of your dimensional models. Link IDs - Click the Link IDs icon to display information about Link IDs in the List tab. A Link ID is a way to specify SQL connectivity between the client applications and a wide variety of database services. Link IDs simplify the connection process to the different servers, network protocols, and operating systems in your work environment. Link IDs support access to a number of databases. Your operating system determines which databases you can access with a Link ID. Remote Servers - The Remote Servers icon is displayed only if you have performed a client/server installation. Click the icon to display information about remove servers in the List tab. Schemas - The Schemas hierarchical list contains information about your Hybrid OLAP schemas, if implemented. The following information is listed for each schema: The Partitions hierarchical list contains information about the schema usage; input, output and result dimensions; selected members; and User-Defined Hierarchies. The Structure hierarchical list contains details of the dimensions, measures, and Fact tables for the schema. The Subschemas hierarchical list contains details of the dimension views and schema views in the schema, and any dimensional models that you have created from the schema.
20
November 2011
Data View The Data View tab is displayed by default when you start Application Server, unless you are logged in as Supervisor. When you start Application Server, the initial Data View is based on your Use database. Your current selections are maintained, with one exception for non-across/down dimensions with more than one member selected, Application Server selects only the top member. When you redisplay the Data View after entering commands in the IDQL tab, the Data View is updated to reflect the current model and selections. If you have the Data View tab displayed when you switch to a different dimensional model in the hierarchical list pane, the view is refreshed immediately; otherwise, the view is updated when you next display the Data View tab. Therefore, if you want to perform small administrative tasks on several different dimensional models, operations will be faster if you display a different tab, or temporarily turn off the display of the Data View tab. You can customize the appearance of the Data View tab by specifying gridlines, font properties, text and background colors. You can also specify colors to highlight high and low data values, and turn off the display of rows that contain only missing values. List tab The List tab displays different information according to your current selection in the hierarchical list. For example, if you select Measures in the hierarchical list, the List tab shows details of the measures in the currently selected dimensional model. If you select Link IDs in the hierarchical list, the List tab shows details of your default and user-created Link IDs. You can right-click most items in the List tab to display a shortcut menu. The commands available depend on the type of item that is currently selected in the List tab. You can sort a column by clicking the column heading. IDQL tab You can use the IDQL tab to execute Application Server commands directly in the Command window. You use the Command window of the IDQL tab to execute commands in Application Server. You can customize the appearance of the IDQL tab, by specifying the font to use. You can also clear the Output window after each command is executed. You can specify the maximum amount of memory to use for the IDQL output. If the output in the window exceeds the specified memory, Application Server removes text from the start of the output until the remaining output fits into the buffer. You can display the command history, and select a command to place in the Command window. You can also search the command history, and display the previous and next commands.
3.2
Procedure
1. Click the IDQL tab. 2. In the Command window, type the IDQL command. 3. To execute the command, press Enter, or click the Execute button on the toolbar. The Output window displays any output resulting from the IDQL command.
Notes:
You can use the command history to redisplay previously entered commands.
November 2011
21
Application Server User Interface Syntax Conventions If you are running Application Server either in standalone mode or as client/server to a Windows server computer, you can click the Stop button on the toolbar to stop an executing IDQL command.
3.3
CLEAR STATUS
Syntax Conventions
Commands are shown in uppercase characters. For example: Names that you must substitute with a value are shown in lowercase italic characters. In this example, you enter SAVE and then substitute an actual procedure name for procedure:
SAVE <procedure>
Brackets [ ] signify that the words inside them are optional. In the following example, you can enter RECOVER setname or RECOVER settype setname:
RECOVER [<settype>] <setname>
When a command shows a list of bracketed options, you can specify any number of options. In this example, you can enter SET PRINTER WIDTH 80 LENGTH 60 UPPER.
SET PRINTER [WIDTH <width>] [LENGTH <length>] [UPPER]
When options are enclosed in brackets and separated by a vertical line, it means that you can specify one option but you do not have to specify any options. In this example, you can enter READ, READ ADD, or READ SUBTRACT. (This is not the complete READ command.)
READ [ADD | SUBTRACT]
When options are enclosed in braces {} and separated by a vertical line |, it means that you must choose one option from between the brackets. In this example, you must enter CHECKPOINT with one option, either BACKUP, FREEZE, or UPDATE [n]. You cannot enter just CHECKPOINT, and you cannot enter CHECKPOINT with two options, such as CHECKPOINT FREEZE UPDATE.
CHECKPOINT {BACKUP | FREEZE | UPDATE [<n>]}
When a command contains a dotted list, you enter the command once and follow it with a list of statements. In the following example, you would enter WHILE condition, enter one or more statements, and then enter ENDWHILE.
WHILE condition . . statements . ENDWHILE
When a command has a list of options in braces {}, you enter the command with one option from the list of options. In this example, you can enter EXHIBIT ACROSS, or EXHIBIT DOWN, or EXHIBIT LOGIN, and so on. It is similar to the CHECKPOINT example, but is used for extensive lists that do not fit on a single line. (This is not the complete EXHIBIT command.)
EXHIBIT { ACROSS } { ADIMENSION [<attribute>] [BASIS | FULL} { [ALL] [SELECTED] MEMBERS <dimension> [HIERARCHY <hierarchy>][<keyword1>][BOTH][POSITION] } { ATTRIBUTES [<dimension>] } { BASIS <attribute> [BOTH] }
When a command has a list of options in brackets[], you enter the command and any number of options. In this example, you can enter SET COLUMNS 5 INDENT 10 ENDSET. It is similar to the
22
November 2011
SET PRINTER example, but it is used for extensive lists that do not fit on a single line. (This is not the complete SET-ENDSET command.)
SET [ACROSS <across>] [COLUMNS <n>] [DECIMALS <list>] [DOWN <down>] [INDENT <spaces>] ENDSET
When a word is bracketed with ellipses, you can specify one or more values separated by commas. In this example, you would type LEVEL and then one or more field names separated by commas.
LEVEL <field> [,...<field>]
When a word is plural and in lowercase letters, you can specify one or more values separated by commas. In the following example, you can enter PRINT with a list of set names to be printed, separated by commas:
PRINT [<settype>] <setnames>
Command separators
By default, Application Server uses a bar symbol (|) as a command separator. To change this, edit the following line in the LSSERVER.INI file:
CMDSEP = |
Take care when changing the command separator, as some characters can cause Application Server to function incorrectly. However, the bar (|) symbol, the exclamation point (!), and the tilde (~) do not clash with normally used characters in file names and the Application Server command language.
Reserved words
The Application Server commands and command options should not be used for user defined names because they are reserved words.
Reserved characters
There are five characters which Application Server uses as member encapsulation characters or "quote characters". The five characters are: ' " < > ` single quotation mark double quotation mark less than sign greater than sign apostrophe
November 2011
23
Application Server User Interface Controlling Your View These characters are all used in pairs with special characters, with the exception of the greater than (>) and less than (<) signs, which are used in opposition to each other. For example:
<Margin %> "Margin %"
It is recommended that you avoid using reserved characters in member or variable names. Also, serious problems can occur when trying to issue a complex select command if two or more reserved characters are used a single dimension member. For example:
"Bob's Six O'Clock Coffee Store's Margin"
Special characters
A special character is any character that is not alphanumeric or an underscore. When one or more of these characters is used in variable and dimension member names, the name must be enclosed in single quotation marks (' '). For example, the following statement is valid:
CREATE VARIABLE 'Margin %'
Set names cannot contain special characters and cannot begin with a number. Variables cannot begin with an exclamation point (!).
3.4
24
November 2011
November 2011
25
d. In the Server text box, enter the name of the server to connect to. If a remote server is specified, 4. Do one of the following: Click OK to confirm your changes and close the Options dialog box. Click Apply to apply your changes and keep the Options dialog box open. Click Cancel to cancel your changes and close the Options dialog box. Note: If you define a default login, the details are written to the Application Server initialization file, (the default initialization file name is LSSERVER.INI).
26
November 2011
3.4.7
Procedure
1. From the View menu, choose Options to display the Options dialog box. 2. Click the Confirmation tab. 3. Do one of the following: To prompt the user for confirmation before deleting an item, select "Confirm before deleting an object". To delete items without user confirmation, deselect "Confirm before deleting an object". 4. Do one of the following: Click OK to confirm your changes and close the dialog box. Click Apply to apply your changes and keep the dialog box open. Click Cancel to cancel your changes and close the dialog box.
November 2011
27
Application Server User Interface Controlling Your View 4. Do one of the following: Click OK to confirm your changes and close the dialog box. Click Apply to apply your changes and keep the dialog box open. Click Cancel to cancel your changes and close the dialog box.
28
November 2011
3.4.12
From the View menu, choose Toolbar. Note: The Toolbar command is a toggle, that is, you choose the command to turn it on, and choose it again to turn it off. A check mark next to the menu command indicates that it is selected.
3.4.13
November 2011
29
3.4.15 Specifying the Maximum Memory for the IDQL Output and SQL Command Windows
Procedure
1. From the View menu, choose Options to display the Options dialog box. 2. Click the Command Window tab. 3. In the "Maximum memory to use for command output " text box, enter a value in Kb. 4. Do one of the following: Click OK to confirm your changes and close the dialog box. Click Apply to apply your changes and keep the dialog box open. Click Cancel to cancel your changes and close the dialog box.
Notes:
The specified value applies to each window separately. The default value for each window is 256 Kb. If the output in the window exceeds the specified memory, Application Server removes text from the start of the output until the remaining output fits into the buffer. The application title bar, menu bar, and toolbar are hidden in full screen mode, in order to maximize the size of the available working area in the Explorer window.
3.4.16
From the View menu, choose Full Screen. Note: The Full Screen command is a toggle; that is, you choose the command to turn it on, and choose it again to turn it off. A check mark next to the menu command indicates that it is selected.
3.5
Dimensions are components of a dimensional model. When building a dimensional model, create structural dimensions to describe an area of interest within your business, or attribute dimensions to describe a characteristic of a structural dimension. Dimensions consist of members organized into a hierarchical structure. A dimensions hierarchical structure is the road map for drilling up and down on information.
Procedure
1. Make sure that you have selected a dimensional model in the hierarchical list pane. 2. From the File menu, choose New, and then choose Dimension. 3. In the Create Dimension dialog box, specify a unique name for the new dimension. 4. Click OK to display the Dimension editor, where you can create a new dimension. 5. (Optional) To update the dimension details in the List tab, click the List tab, and then click the Refresh button on the toolbar.
Notes:
30
November 2011
You may need to change your access mode, as you cannot create a dimension if you are using the selected dimensional model in Read-only mode.
3.5.2
Procedure
Creating a Document
1. Make sure that you have selected a dimensional model in the hierarchical list pane. 2. From the File menu, choose New, and then choose Document to display a dialog box, where you can specify a unique name for the new document. 3. Click OK to display the Document editor, where you can create a new document. 4. Close the Document editor, and save the document. 5. (Optional) To update the document details in the List tab, click the List tab, and then click the Refresh button on the toolbar.
Notes:
You may need to change your access mode, as you cannot create a document if you are using the selected dimensional model in Read-only mode.
3.5.3
Procedure
Creating a Logic
1. Make sure that you have selected a dimensional model in the hierarchical list pane. 2. From the File menu, choose New, and then choose Logic to display a dialog box, where you can specify a unique name for the new logic. 3. Click OK to display the Logic editor, where you can create a new logic. 4. Close the Logic editor, and save the logic. 5. (Optional) To update the logic details in the List tab, click the List tab, and then click the Refresh button on the toolbar.
Notes:
You may need to change your access mode, as you cannot create a logic if you are using the selected dimensional model in Read-only mode.
3.5.4
Procedure
Creating a Procedure
1. Make sure that you have selected a dimensional model in the hierarchical list pane. 2. From the File menu, choose New, and then choose Procedure to display a dialog box, where you can specify a unique name for the new procedure. 3. Click OK to display the Procedure editor, where you can create a new procedure. 4. Close the Procedure editor, and save the procedure. 5. (Optional) To update the procedure details in the List tab, click the List tab, and then click the Refresh button on the toolbar.
Notes:
You may need to change your access mode, as you cannot create a procedure if you are using the selected dimensional model in Read-only mode.
November 2011
31
3.5.5
Procedure
Creating a Report
1. Make sure that you have selected a dimensional model in the hierarchical list pane. 2. From the File menu, choose New, and then choose Report to display a dialog box, where you can specify a unique name for the new report. 3. Click OK to display the Report editor, where you can create a new report. 4. Close the Report editor, and save the report. 5. (Optional) To update the report details in the List tab, click the List tab, and then click the Refresh button on the toolbar.
Notes:
You may need to change your access mode, as you cannot create a report if you are using the selected dimensional model in Read-only mode.
3.5.6
Procedure
Creating a Synonym
1. Make sure that you have selected a dimensional model in the hierarchical list pane. 2. From the File menu, choose New, and then choose Synonym to display a dialog box, where you can specify a unique name for the new synonym. 3. Click OK to display the Synonym editor, where you can create a new synonym. 4. Close the Synonym editor, and save the synonym. 5. (Optional) To update the synonym details in the List tab, click the List tab, and then click the Refresh button on the toolbar.
Notes:
You may need to change your access mode, as you cannot create a synonym if you are using the selected dimensional model in Read-only mode.
3.5.7
Procedure
1. Make sure that you have selected a dimensional model in the hierarchical list pane. 2. From the File menu, choose New, and then choose Time Set to display a dialog box, where you can specify a unique name for the new time set. 3. Click OK to display the Time Set editor, where you can create a new time set. 4. Close the Time Set editor, and save the time set. 5. (Optional) To update the time set details in the List tab, click the List tab, and then click the Refresh button on the toolbar.
Notes:
You may need to change your access mode, as you cannot create a time set if you are using the selected dimensional model in Read-only mode.
32
November 2011
3.5.8
Procedure
Creating a User
1. From the File menu, choose New, and then choose User to display the Create User dialog box. 2. Enter the user details as follows: a. In the "User name" text box, enter a unique user name of up to 24 characters. The first character must be alphabetic the remaining 23 characters can be alphanumeric. b. (Optional) In the Password text box, enter a password of up to 12 alphanumeric characters. 3. Enter the default model details for the user as follows: a. In the "Default model name" drop-down list, select the default model for the user. b. In the "Default access mode" drop-down list, specify how the user will access the model. The default value is Exclusive. 4. Specify the Work model details as follows: a. In the "Work model name" text box, specify a name of up to eight characters for the user's Work database. b. In the "Number of buffers" text box, specify the number of buffers (between 20 and 64,000) to allocate to the Work database The default value is 2000. c. In the "Number of blocks" text box, specify the number of blocks (the maximum number you can specify is disk and partition dependent) to allocate to the Work database. The default value is 2000.
d. In the "Block size" drop-down list, specify the Work database block size. The default value is 8K. Note: For more information about database size, see Determining buffers setting. 5. Specify the user login details as follows: a. In the "Security level" drop-down list, select the authority level for the user. Note: Supervisor level has access to all Application Server commands. b. In the "Account status" drop-down list, specify whether the user account is Enabled (default value), or Disabled. c. In the "Number of logins" text box, enter a value between 1 and 15 to specify the number of times the user can log in concurrently to Application Server. Note: Values greater than 1 allow multiple users to access Application Server with the same user name. d. In the "Expiration date" text box, specify the date when the user account expires. The default value is Never. 6. Click OK to close the dialog box.
Notes:
The user is added to MASTERDB, and appears in the Users list in the hierarchical list pane. You can right-click a user in the List tab to display a shortcut menu where you can log the user out, or enable a user whose record is displayed.
November 2011
33
3.5.9
Procedure
1. From the File menu, choose New, and then choose User Group to display a dialog box, where you can specify a unique name for the new user group. 2. Click OK Creating the user group. The user group is added to the User Groups list in the hierarchical list pane you can now add users to the group.
3.5.10
Procedure
1. Select the item you want to copy to the Clipboard. 2. Do one of the following: From the Edit menu, choose Copy. Display the shortcut menu for the item, and then choose Copy. Click the Copy button on the toolbar. Note: Copy makes a copy of the selection and saves it on the Clipboard, overwriting whatever is currently on the Clipboard. The selection remains on the screen.
3.5.12
Procedure
1. Select the text you want to cut to the Clipboard. 2. Do one of the following: From the Edit menu, choose Cut. Display the shortcut menu, and then choose Cut. Click the Cut button on the toolbar. Note: Cut removes the selected text from the screen, but saves it on the Clipboard, overwriting whatever is currently on the Clipboard. You can use Paste to place the selection back on the screen.
34
November 2011
3.5.13
Procedure
Deleting an Item
1. In the hierarchical list pane, select the class of item you want to delete, and then click the List tab. 2. In the List tab, select the item you want to delete. 3. Do one of the following: From the File menu, choose Delete. Right-click the item in the List tab to display a shortcut menu, and then choose delete. Press the Delete key. 4. If you have "Confirm before deleting an object" selected in the Options dialog box, you will be prompted to confirm the deletion. Do one of the following: Click Yes to delete the selected item. Click Cancel to cancel the deletion. Note: To delete items from a dimensional model, you must be using the model in Shared or Exclusive mode. To delete a dimension, measure, or attribute, you must be in Exclusive mode.
3.5.14
Right-click in the Explorer, Data View, List, or IDQL tabs. The commands displayed depend on the item that is selected when you right-click.
3.5.16
Editing an Item
Display the shortcut menu for the item, and then choose Edit to display the appropriate editor for the selected item. Note: If the Use database is attached in Read-only mode, the set is open for viewing only. You can edit dimensions only when the database is open in Exclusive mode. For more information, see Changing your access mode.
3.5.17
Notes:
From the Edit menu, choose Paste. Or, click the Paste button on the toolbar. You use Paste to place the contents of the Clipboard on the sheet. You can only paste back the item(s) that was last cut or copied to the Clipboard.
November 2011
35
3.5.18
Saving an Item
3.5.19
Selecting an Item
3.5.20
Printing an Item
You can print in the SQL Command window, the Trace window, the Application Server editors, the Explorer window when the IDQL tab is selected in the right pane, and the command window of the IDQL tab.
Procedure
1. From the File menu, choose Print to display the Print dialog box. 2. Select a printer from the list of installed printers. 3. (Optional) Click Properties to open a dialog box for the selected printer, in which you can specify a paper tray, resolution, and so on. 4. (Optional) Select "Print to file", and then click OK to display the Print to File dialog box. Type the file name and then click OK. You can send the file to the printer using the DOS COPY command.
36
November 2011
5. (Optional) To print more than one copy, enter the number of copies in the "Number of copies" text box. Or, use the spin buttons. 6. Click OK. You can print in the SQL Command window, the Trace window, the Application Server editors, and the Explorer window when the IDQL tab is selected in the right pane.
3.5.22
You can display items before printing in the SQL Command window, the Trace window, the Explorer window when the IDQL tab is selected in the right pane, and the command window of the IDQL tab. From the File menu, choose Print Preview. Note: To cancel Print Preview, press Esc.
3.6
Procedure
1. Make sure the Data View tab is displayed for the dimensional model currently selected in the hierarchical list pane. 2. In the hierarchical list pane, expand the Dimensions list for the currently selected model. 3. Select a dimension in the list in the hierarchical list pane, and then drag it to the Across, Down, or Page lists of the Data View tab. If you have "Confirm drag and drop operations" selected in the Options dialog box, you will be prompted to confirm the operation.
Notes:
You can add a total of up to 14 dimensions to the Across, Down, and Page lists, including the mandatory Time and Measures dimensions.
November 2011
37
Application Server User Interface Working with Data in the Data View Tab You can also change the Across, Down and Page lists by dragging a dimension from another list. The Across and Down lists must contain at least one dimension.
The Across and Down lists must contain at least one dimension. You can also add a dimension from the list in the hierarchical list pane. You can add a total of up to 14 dimensions to the Across, Down, and Page lists, including the mandatory Time and Measures dimensions.
3.6.4
38
November 2011
3.6.6
Procedure
1. Make sure the Data View tab is displayed for the dimensional model currently selected in the hierarchical list pane. 2. Click the Drill Direction button on the toolbar to reverse the current drill direction.
3.6.7
Procedure
1. Make sure the Data View tab is displayed for the dimensional model currently selected in the hierarchical list pane. 2. Do one of the following: Click the Calendar button on the toolbar. Right-click in the view to display a shortcut menu, and then choose Calendar to display the Calendar dialog box. 3. Make sure the Periodicity tab is selected. 4. In the Periodicity list box, select a different option, and then click OK to close the Calendar dialog box. The view of the dimensional model data is updated to reflect the changed periodicity.
3.6.8
Procedure
1. Make sure the Data View tab is displayed for the dimensional model currently selected in the hierarchical list pane. 2. Do one of the following: Click the Calendar button on the toolbar. Right-click in the view to display a shortcut menu, and then choose Calendar to display the Calendar dialog box. 3. Click the Templates tab. 4. (Optional) In the "Template type" drop-down list, select a different template type. The Templates list box is updated to show time templates based on the selected type. 5. In the Templates list box, select a time template to apply to the dimensional model data.
November 2011
39
Application Server User Interface Working with Data in the Data View Tab 6. Click OK to close the Calendar dialog box. The view of the dimensional model data is updated to reflect the changed time template.
40
November 2011
By default, or if you have used the SET LONG command in Application Server to display long dimension member names (labels), you can search using a wildcard character (*), a long or short name, or part of a long or short name followed by a wildcard character (for example Court*). If you have used the SET SHORT command in Application Server to display short dimension member names, you can search using a wildcard character (*), a short name, or part of a short name followed by a wildcard character (for example UPC1*). 5. Do one of the following: To replace the current contents of the "Search result" list box with the results of the new search, click Find.
November 2011
41
Application Server User Interface Working with Data in the Data View Tab To add the results of the new search to the current contents of the "Search results" list box, click Find Also. 6. You can add the found members to, or remove them from, the "Selected members" list box: To add the found members to the "Selected members" list, click Add to Selection. To remove the found members from the "Selected members" list, click Add to Selection. 7. Click OK to close the Dimensional Selector dialog box.
6. To define how data falling below the specified low value appears: a. Click the button next to the "Low value" text box to display the Color dialog box. b. Select a background color to apply to data that falls below the low value. c. Click OK.
7. Click OK to close the High and Low Values dialog box. Exceptions data in the Data View is shown in the specified colors.
42
November 2011
3.6.17
Procedure
1. Make sure the Data View tab is displayed for the dimensional model currently selected in the hierarchical list pane. 2. Do one of the following: Click the Calendar button on the toolbar. Display the shortcut menu, and then choose Calendar. Display the Viewer, and then double-click Time.
3.6.18
Procedure
1. Make sure the Data View tab is displayed for the dimensional model currently selected in the hierarchical list pane. 2. Display the shortcut menu, and then choose Viewer.
3.6.19
Procedure
Saving a View
1. Make sure the Data View tab is displayed for the dimensional model currently selected in the hierarchical list pane. 2. From the File menu, choose Save As to display the File Save As dialog box. 3. In the "Save in" drop-down list, specify a database to save the view to. Note: If the database is not currently attached, it is attached as shared. You cannot save the view to your Use database unless the database is already attached in Shared or Exclusive mode. 4. Type a name for the view in the "View name" text box, or double-click an existing name in the file window to overwrite it. 5. Click Save. 6. Once you have saved a view, you can choose Save or click the Save button on the toolbar to save a new view to the same View name.
November 2011
43
3.6.20
Procedure
1. Make sure the Data View tab is displayed for the dimensional model that contains the saved view. 2. From the File menu, choose Open and then choose View to display the Open dialog box. Or, click the Open View button on the toolbar. 3. In the "Look in" drop-down list, select the database that contains the saved view, and then select the required view. 4. Click Open to display the saved view in the Data View tab.
3.7
A Link ID template is a unique way for you to specify SQL connectivity between the client applications and a wide variety of database services. Link IDs simplify the connection process to the different servers, network protocols, and operating systems in your work environment. You can construct a dictionary of connection parameters to database services by defining connections and saving them under unique names. You create and edit existing connection names using the Application Server. Link IDs support access to a number of databases. Your operating system determines which databases you can access with a Link ID. On Windows, a Link ID can be used to access an OLE DB or OLE DB for OLAP (ODBO) provider as a data source. OLE DB is a means to support a wider variety of data sources that are nonrelational databases, such as object databases and spreadsheets that do not necessarily implement SQL. ODBO is an extension to OLE DB that provides access to OLAP data sources that implement the MDX command language (Multi Dimensional eXpressions). Your should be able to access any OLE DB or ODBO provider that you have installed on your system. If a data source is relational and supports SQL and you have a native driver such as OCI for Oracle, or an ODBC driver, these would be a better choice than going through OLE DB.
3.7.2
Procedure
1. From the File menu, choose New, and then choose Link ID to display the Create Link ID dialog box. 2. Select the database type you want to use from the list box, and then click OK to display the Link ID Properties dialog box. 3. In the Link ID Properties dialog box, define the connection information. The information required depends upon the database you are using. 4. Click Test to test the connection information you defined in the Editing Link ID dialog box. If all parameters are correct a confirmation message appears. 5. Click OK to acknowledge the message, and then click OK again to close the Link ID Properties dialog box.
44
November 2011
3.7.4
Procedure
Deleting a Link ID
1. Make sure the List tab is displayed. 2. On the Explorer tab, expand the Link IDs folder to display a list of existing Link IDs in the List tab. 3. In the List tab, right-click the Link ID you want to delete. 4. When the shortcut menu appears, choose Delete to display a confirmation dialog box. 5. Do one of the following: To delete the selected Link ID, click Yes. To cancel the deletion, click No.
November 2011
45
Application Server User Interface Working with Link IDs 7. Click OK to acknowledge the message, and then click OK again to close the Link ID Properties dialog box.
3.7.7
3.7.7.1.1
Link ID Templates
Oracle (OCI)
3.7.7.1 Windows
This configuration provides access to Oracle through the Oracle call interface (OCI). Link executes the SQL statements by sending them to the Oracle database system. Any SQL statement supported by the database system can be executed. See your Oracle documentation for more information.
Parameter User name Password Server Description You must supply an Oracle user name to connect. You must supply an Oracle password to connect. The SQL*Net connect string designating the server computer and database to be accessed for remote Oracle databases. The information required varies depending on the SQL*Net driver you are using. See your Oracle SQL*Net documentation for more information. You must enter a server name, even when Application Server and Oracle are on the same system. The Oracle library associated with your version of Oracles SQL*Net. The required value varies depending on the version of the Oracle client software installed. If the default value of OCIW32.DLL fails, try OCI.DLL. The library parameter is not used for UNIX; you do not need to change this value.
Library
System requirements
Link requires that you use the Oracle SQL*Net product to provide access to remote Oracle databases. The Oracle SQL*Net component must have been previously installed.
3.7.7.1.2
This configuration provides access to the Microsoft SQL Server through the Microsoft DB-Library interface. Link executes the SQL statements by sending them to the SQL Server database system.
46
November 2011
Any SQL statements supported by the database system can be executed from Link. See your SQL Server documentation for more information.
Parameter User name Password Server Database Description You must supply a SQL Server user name to connect. You must supply a SQL Server password to connect. Server containing the SQL Server database tables that you want to access. (optional) Name of the database to connect to.
System requirements
You must have the appropriate Net-Library and DB-Library installed to gain access to Microsoft SQL Server databases. For Windows NT, NTWDBLIB.DLL is the DB-Library. The Net-Library you need depends on the network protocol used to connect to the SQL Server. For example, Named Pipes requires DBNMPNTW.DLL, while TCP/IP requires DBMSSOCN.DLL. Contact your Microsoft SQL Server vendor for the appropriate DB-Library and Net-Library. Select this option if you have Microsoft DBLib/NetLib client software installed.
3.7.7.2 UNIX
3.7.7.2.1 Oracle (OCI)
This configuration provides access to Oracle through the Oracle call interface (OCI). Link executes the SQL statements by sending them to the Oracle database system. Any SQL statement supported by the database system can be executed. See your Oracle documentation for more information.
Parameter User name Password Server Description You must supply an Oracle user name to connect. You must supply an Oracle password to connect. The SQL*Net connect string designating the server computer and database to be accessed for remote Oracle databases. The information required varies depending on the SQL*Net driver you are using. See your SQL*Net documentation for more information. You must enter a server name, even when Application Server and Oracle are on the same system. The Oracle library associated with your version of Oracles SQL*Net. The required value varies depending on the version of the Oracle client software installed. If the default value of OCIW32.DLL fails, try OCI.DLL. The library parameter is not used for UNIX; you do not need to change this value.
Library
System requirements
Link requires that you use the Oracle SQL*Net product to provide access to remote Oracle databases. The Oracle SQL*Net component must have been previously installed.
3.7.7.2.2
The DB2 configuration provides access to IBM DB2 through the DB2 native interface called the DB2 Call Level Interface (CLI). The CLI is based on Microsoft ODBC and the ISO CLI. Use your Link ID to allow Application Server to connect to a DB2 database, execute SQL commands and call CLI and DB2 APIs to perform actions on that database. You cannot issue CLP (Command Link Processor) commands or DB2 commands from within the Access LSLink subsystem."
November 2011
47
Password
System requirements
DB2 is accessible either through ODBC or through DB2s own native interface the DB2 Call Level Interface (CLI) The CLI is based on Microsoft ODBC and the ISO CLI. DB2 also supplies extra DB2-specific APIs for administrative and system functions which are not part of the CLI. It is recommended that you always use the CLI interface rather than ODBC, since the CLI interface also uses the extra DB2-specific APIs not supported in ODBC, and the system will run more efficiently when it can use those extra APIs (for example the RUNSTATS API). On the system designated to host the warehouse, the DB2 Database Administrator must do the following before creating a link ID: 1. Install DB2. 2. Create and start a DB2 instance. 3. Create the DB2 database. 4. Create DB2 tablespaces for the dimensional models. 5. Create a USER TEMPORARY TABLESPACE for db2 temporary tables created with DECLARE GLOBAL TEMPORARY TABLE. 6. Grant the USE privilege for the tablespaces. 7. If Application Server is on a separate system from the database, install DB2 client on the system where Application Server will reside. You must also catalog your remote DB2 databases on your client machine using the DB2 CLP command CATALOG DATABASE command.
48
November 2011
3.8
Application Server uses the MASTERDB file to store information about users and dimensional models. This database s the repository of all the meta data regarding Application Server databases and who can use them. To use a dimensional model, it must be added to MASTERDB. Only users with access to the Supervisor subsystem can update MASTERDB. There are three default user names that already exist in MASTERDB: admin super supervisor If you want to add multiple users to a group, use the User Group Properties dialog box.
3.8.2
3.8.3
Procedure
Creating a User
1. From the File menu, choose New, and then choose User to display the Create User dialog box.
November 2011
49
Application Server User Interface Users, Security and Database Access 2. Enter the user details as follows: a. In the "User name" text box, enter a unique user name of up to 24 characters. The first character must be alphabetic the remaining 23 characters can be alphanumeric. b. (Optional) In the Password text box, enter a password of up to 12 alphanumeric characters. 3. Enter the default model details for the user as follows: a. In the "Default model name" drop-down list, select the default model for the user. b. In the "Default access mode" drop-down list, specify how the user will access the model. The default value is Exclusive. 4. Specify the Work model details as follows: a. In the "Work model name" text box, specify a name of up to eight characters for the user's Work database. b. In the "Number of buffers" text box, specify the number of buffers (between 20 and 64,000) to allocate to the Work database The default value is 2000. c. In the "Number of blocks" text box, specify the number of blocks (the maximum number you can specify is disk and partition dependent) to allocate to the Work database. The default value is 2000.
d. In the "Block size" drop-down list, specify the Work database block size. The default value is 8K. Note: For more information about database size, see Determining buffers setting. 5. Specify the user login details as follows: a. In the "Security level" drop-down list, select the authority level for the user. Note: Supervisor level has access to all Application Server commands. b. In the "Account status" drop-down list, specify whether the user account is Enabled (default value), or Disabled. c. In the "Number of logins" text box, enter a value between 1 and 15 to specify the number of times the user can log in concurrently to Application Server. Note: Values greater than 1 allow multiple users to access Application Server with the same user name. d. In the "Expiration date" text box, specify the date when the user account expires. The default value is Never. 6. Click OK to close the dialog box.
Notes:
The user is added to MASTERDB, and appears in the Users list in the hierarchical list pane. You can right-click a user in the List tab to display a shortcut menu where you can log the user out, or enable a user whose record is displayed.
3.8.4
Procedure
1. From the File menu, choose New, and then choose User Group to display a dialog box, where you can specify a unique name for the new user group. 2. Click OK Creating the user group.
50
November 2011
The user group is added to the User Groups list in the hierarchical list pane you can now add users to the group.
3.8.5
Procedure
Deleting a User
1. In the hierarchical list pane, expand the Security list. 2. In the Users list, select the user that you want to delete. Or, click the List tab, and select a user. 3. Do one of the following: From the File menu, choose Delete. Display the shortcut menu for the selected user, and then choose Delete. Press the Delete key. 4. (Optional) To update the user details in the List tab, click the List tab, and then click the Refresh button on the toolbar.
November 2011
51
3.8.7
Procedure
1. In the hierarchical list pane, expand the Security list. 2. In the User Groups list, select the user group that you want to delete. 3. Do one of the following: From the File menu, choose Delete. Display the shortcut menu for the user group, and then choose Delete. Press the Delete key. 4. (Optional) To update the user group details in the List tab, click the List tab, and then click the Refresh button on the toolbar. Each dimensional model has a default access mode. The current model name and access mode are shown on the status bar. The following access modes are available: Read Multiple users can read from the database, but cannot update it. Shared Multiple users can read from the database, and they can update report sets, time sets, documents, and procedures. However, users cannot update data or change the structure of the database by editing dimension sets. Exclusive One user can read from database, and update sets and data within it. Once a database is opened for a particular level of access, all users must access the database at the same level. For example, if the first user accesses the database in exclusive mode, no other users can access the database. If the first user accesses the database in shared mode, other users can access the database in shared mode but they cannot be restricted to read access.
3.8.8
Procedure
1. In the Explorer window, expand the list of dimensional models. 2. Select the dimensional model you want to use. 3. Display the shortcut menu for the dimensional model, and then choose one of the following: Use Read-Only. This is the default value. Use Shared. Use Exclusive.
Notes:
You can change the current access mode by issuing a USE command in the IDQL tab. If you are logged in as Supervisor, you can change the default access mode for a dimensional model. For more information, see Specifying the level of access for a database.
3.8.9
Procedure
1. Right-click the hierarchical list pane to display a shortcut menu, and then choose Add Model to display the Add Model dialog box.
52
November 2011
2.
On the Model tab, specify the name of an existing model in the "Model name" text box to have Server search the DBPATH to find the model
3. On the Partitions tab, you can specify the model location this is useful if the model has multiple partitions.
November 2011
53
There are two ways to execute Application Server commands: you can type a command directly in the IDQL tab or you can create a procedure using the Procedure editor.
You can use the command history to redisplay previously entered commands. If you are running Application Server either in standalone mode or as client/server to a Windows NT computer, you can click the Stop button on the Application Server toolbar to stop an executing IDQL command.
4.2
Procedure
1. Create and run procedures using the procedure editor. 2. Pass parameters into procedures to set the values of control variables. 3. Run Application Server in batch mode. Note: Follow these steps to automate any Application Server process.
4.3
The analysis and design stage is an iterative process you must involve end users to identify critical application reporting requirements.
Procedure
1. Identify the dimensions and variables in the database based on existing and planned reporting requirements. a. Identify potential dimensions that reflect business reporting structures.
54
November 2011
Use existing reports columns and headings. Determine whether you need to see X by Y. Include a maximum of eight user-defined dimensions per variable. b. For each dimension, define the rollup hierarchies and other relationships. Draw the hierarchies and identify levels by name. Identify all the idiosyncrasies such as uneven hierarchies and classes. Include a maximum of 20 levels in each dimension hierarchy. c. Estimate the number of input and output members in each dimension.
d. Identify the data variables, which are the business measurements. Determine how they relate to dimensions. For example, are you dealing with actual versus budget or shipped versus booked measurements? Identify input and calculated variables. Determine whether calculated variables need to be stored in the database. Determine the calculation rules .Are there hidden variables needed for calculations? Identify variable attributes - time conversion: first, last, and sum. Determine if there is a hierarchical relationship between variables. Include a maximum of 1,000 variables in a database. 2. Estimate the size of the database to see whether your data will fit in one database. Estimate consolidation speed to determine whether updating requirements can be met. Note: The goal of this first round of design is to discover any limits which would prevent you from using one Application Server database. 3. Examine any exceptions or idiosyncrasies that may affect the design. Handle issues such as having multiple databases for security, updating, or detail reporting requirements. 4. Create the database.
5. Create users who can access the database. 6. Set the fiscal year. 7. Create a dimension. 8. Create variables. 9. Load the data.
4.4
Before you can load data, you must identify the information that you have, and then identify the way you want it displayed in Application Server. You should have all the dimensions and the data in one file so that you can read the file in just once. If you have information in various .DBF files, you must join them together from a common field using an appropriate program, such as Microsoft Excel. For example, the DRINKS.DBF file contains all the information necessary to build dimensions and variables.
November 2011
55
Application Server at the Command Level Databases and Users By analyzing the data, you would determine that the business items of interest are PRODUCT, CHANNEL, and REGION; these are the dimensions. The DATE field will be used for the TIME dimension. The data in the ACTUNITS, ACTSALES, BUDUNITS, and BUDSALES columns are the business measurements; these are the variables. Based on the DRINKS.DBF file, you might determine the following reporting structure: the Product and Channel dimensions have simple reporting levels, the lowest level of data is consolidated into a total number, and the REGION dimension has several hierarchical levels. Note: The field names that appear in the .DBF file must be the same as the dimension names you are constructing. For example, the .DBF file has a field called DATE, and Application Server has a dimension called TIME. You can either change the name of the DATE field in the .DBF file to TIME or you can use a CREATE command while you are accessing external data.
4.4.2
Creating a Database
Enter the CREATE DATABASE command. The CREATE DATABASE command has many options that allow you to create an optimal database. The following command shows the options that make up a default database. In most cases, these settings should be increased to create a sufficient working database:
CREATE DATABASE database BLOCKS 200 BLKSIZE 8k MEMBERS 10000 MULTIPLE 6 OBSERVATIONS 100 SIZE 32 USAGE Exclusive SORTKEYS Alphabetic VARIABLES 1000
SORTKEYS Alphabetic
VARIABLES 1000
56
November 2011
Substitute <database>## with the name of the partition you moved, and substitute pathname with the directory into which you moved the partition. In UNIX client/server, you must define environment variables in lsstcp.sh.
Notes:
A database can have a total of 32 partitions. You can display partition information with the SUPERVISOR SHOW DATABASE command.
4.4.4
The amount of memory used by Application Server is determined by the number of buffers it creates in memory, and the size of the buffers. Application Server creates the maximum number of buffers possible in the memory available to it, up to the value set for buffers. To optimize data load and consolidate performance, you should set buffers as high as possible, but at a level that ensures they are created in real memory rather than cache or swap memory.
November 2011
57
58
November 2011
4.4.5
Creating a User
Enter the CREATE USER command. When you create a user in Application Server, a record is created and stored in the MASTERDB. This record contains information about the Login and the Use database. Since this record references a Use database, it must be created after creating the database. To create a new user, you need the following information: The name of the Use database The User ID to be assigned The password for that user The number of blocks to be allocated for the work database The name for the work database
4.5
Dimensions
4.5.1 About Dimensions
Dimensions are components of a dimensional model. When building a dimensional model, create structural dimensions to describe an area of interest within your business, or attribute dimensions to describe a characteristic of a structural dimension. Dimensions consist of members organized into a hierarchical structure. A dimensions hierarchical structure is the road map for drilling up and down on information.
4.5.2
Procedure
1. Enter the DIMENSION command followed by the dimension set name. The name should indicate the contents of the set and be a familiar term within your organization. A set name can have up to 96 bytes. 2. Enter the ALLOCATE command to define the maximum number of input, output, and result members in a dimension so that if you later add members to the dimension, the database is not reorganized. This statement must be the first line in the dimension and state the number of estimated input, output, and result members. 3. Enter the INPUT keyword followed by the member names separated by commas. 4. Assign alternative labels to the members of a dimension. These labels must be in single quotation marks (' '), and must follow the corresponding member name. When displaying data, you can use the SET SHORT or SET LONG commands to print either the member name or the label. 5. Enter the OUTPUT keyword before the output members and names. As with input members, output members must be separated by commas, and can have labels associated with them. 6. Define the RESULT <member>. 7. Define any LEVELS in a dimension. Level names should be descriptive and refer to the reporting structure. Names must also be unique within the dimension. The first name in the list corresponds to level 1, the second name to level 2, and so on. The result member or top level is not named in the statement.
November 2011
59
This procedure is discussed in detail in the topic Constructing a dimension from a .DBF file, and an alternate procedure is provided in the topic Constructing a dimension with Link.
4.5.4
Procedure
1. Enter the ACCESS EXTERNAL command. 2. Enter the USE command to identify the external file. 3. Enter the DESCRIPTION command to identify the layout. 4. Enter the CONSTRUCT command to identify the dimension name, levels, and labels. 5. Enter the END command to leave the Access window. 6. Enter the COMPILE DIMENSION <dimension name> command to permanently store the dimension.
Note: The file must exist in a path specified by an environment variable that exists in the Application Server initialization file. For example, DRINKS.DBF might exist in the \Program Files\Pilot Software\Common directory. 3. Construct the first dimension in the file:
CONSTRUCT name LEVEL input, output, output....
60
November 2011
The LABEL statement performs a one-to-one correlation with the LEVEL statement.
Notes:
If no labels exist for the dimension, do not specify a LABEL statement. If labels exist for some but not all the levels in the dimension, use question marks to show that there is no label information for that level. The preceding example shows that labels exist only for the state level. That is, the short name or member name is the stcode column. This column contains state abbreviations such as MA and FL. The labels are the fully spelled out words such as Massachusetts and Florida. By default, a result member is created that sums the members of the last output level. 4. Close the ACCESS subsystem:
END
November 2011
61
4.5.7
Procedure
1. Enter DIMENSION Product. The dimension appears in the editor. 2. Verify that the consolidations sum up the input members into output members:
INPUT COLA ,UNCOLA ,SPRITZ ,DIET_DRINKS ,VALLEY_DEW RESULT TOTAL_PRODUCT 'TOTAL PRODUCT' LEVEL PRODUCT TOTAL_PRODUCT = INPUTS
4.5.8
Removing a Dimension
To remove a dimension's symbolic reference, but not the actual compiled version, enter:
REMOVE dimension dimension name
4.5.9
Procedure
1. Choose Save from the Dimension menu. Another way to save the dimension structure is to choose Exit from the Dimension menu. Application Server confirms any changes. Note: In addition to Save and Exit, the Dimension menu has options that allow you to validate the dimension syntax, quit without saving changes, and enhance the readability of the set. 2. Choose EXIT from the dimension set to compile the set. A message stating the number of members selected appears. If you do not see that message, it means the set has not been compiled. To force the compilation, use the COMPILE dimension <set name> command.
4.5.10
In dimensions and hierarchical attributes, it is possible to have members that roll up into multiple parents. If any of those parents (or their ancestors) roll up into a common member then the hierarchy has multiple counting issues. For example, suppose you have a dimension PRODUCT that has a hierarchy like this:
62
November 2011
Input members A and B roll up into Output X and Input members B and C roll up into Output Y. X and Y roll up into a Result T. Suppose that a measure SALES is dimensioned by PRODUCT and that monthly sales of A, B and C are all 1 unit for November 2009. If simple additive aggregation is performed then X is 2 and Y is 2, and then T is 4. However there were only 3 sales ( A, B and C). Since Input member B aggregates into Output X and Y, and Output X and Y aggregate into Result T, then sales of B contribute to T twice once from X and once from Y. This hierarchy has double counting of B. You have a choice over how you want dimensions counted when members roll up into multiple parents. By default, when a dimension is compiled and consolidated, the system reviews all multiple counting issues and counts just once. In terms of the example above, the Result is 3 by default. If you want the system to include multiple counting even when there are multiple parents, you can use the NOCORRECTIONS keyword on the COMPILE DIMENSION command and CONSOLIDATE any measures that have dimensions with multiple counting issues in them. In terms of the example above, a COMPILE DIMENSION NOCORRECTIONS produces a Result of 4. If you want to turn off automatic multiple counting in User-Defined Hierarchies then use the NOCORRECTIONS keyword on the CREATE command.
November 2011
63
4.6
Attributes
4.6.1 About Attributes
Attributes provide a sophisticated and optimized database design for the following reasons: They save disk space. Dimensions and variables require Application Server to store multiple combinations; this increases the size of the database and reduces disk space. Attributes have the same characteristics as dimensions and variables, but they do not store combinations; therefore, attributes reduce the size of the database. Attributes require significantly less storage than dimensions, multiple hierarchies in a dimension, dimension classes, and text variables. You can solve business problems you could not otherwise solve. For example, when you look at your data, you might identify 20 items as dimensions. Generally, 20 dimensions are not possible or practical. Of the 20 items, the most significant in terms of characterizing the data can be defined as dimensions. The other items can be defined as attributes if they have a finite number of values which occur multiple times as data values. For example, PRODUCT would be defined as a dimension, but SIZE would be defined as an attribute, with many products sharing the same value for SIZE. Attributes provide an easy conceptualization of certain business information. Attributes logically categorize information that describes features of a business entity.
64
November 2011
3. Read data into the attribute variables. 4. List the attribute sets. 5. Set up a view containing the attributes. 6. Select the attributes. 7. Exhibit the attributes.
4.6.2
If all the information about the attributes associated with a dimension exists in one source file, you can construct a single attribute set. If your attribute data is not in one file, you might want to join files together to benefit from this format. If it is not practical to combine all information into one file, you must construct one attribute set for each file. Having all the attributes in one set poses a drawback when you update an attribute. To add or remove an attribute or an attribute member from the set, you must reconstruct the entire attribute set. If you expect your attributes to change, even if they are in one file, you might prefer to construct the attributes individually so that they exist in separate attribute sets. This way, if an attribute changes, you only have to reconstruct the individual attribute set.
4.6.3
This topic assumes that:
Creating attributes
Procedure
1. Create a procedure. Enter the following:
PROCEDURE <setname>
where <setname> is the name of the procedure. 2. In the Procedure editor, specify the appropriate ACCESS subsystem and the source file containing attribute information:
ACCESS External USE <filename> BEGIN DESCRIPTION statements ... END ACCESS LSLink CONNECT name SELECT <field>, <field>, ... FROM <filename>
where <setname> is the name of the attribute set. It can be the same name as the dimension it is associated with, or it can be any valid name you choose. For example, you might want to name the attribute set Prod_color to identify that the color attribute is associated with the Product dimension. If the set contains multiple attributes, you might name the set Prod_attr. where <dimension> is the name of the dimension that this attribute will be associated with.
November 2011
65
Application Server at the Command Level Attributes VARIABLES <fields> are the column names from the source that contain the attribute information. You can specify multiple fields, separated by commas, to construct multiple attributes for the dimension. For example, VARIABLES color, size. LABEL <fields> are optional. They are the source column names that contain attribute descriptions. You can specify multiple fields, separated by commas. This statement has a oneto-one relationship with the VARIABLES statement. That is, the first label field represents the label for the first attribute field. If some but not all attributes have descriptive columns, use a question mark (?) for the column that does not have a label. 4. Add a line to exit from the Access subsystem and compile the attribute set. Type:
END COMPILE ATTRIBUTE <setname>
where <setname> is the name of the attribute you are constructing. 5. Save the changes to the procedure and exit from the Procedure editor by choosing File Exit. 6. Run the procedure. Type:
JOB setname
Application Server creates an attribute set and one or more attribute variables. The attribute set identifies the members of one or more attribute dimensions and the name of the entity dimension the attributes are associated with. When you issue a single construct on a single source file, Application Server only creates one attribute set, which can contain information about any number of attribute dimensions. For example, you may create a single attribute set called PROD_ATTR that contains information about the attribute dimensions Color and Size. The attribute variables are created when you compile the attribute set. An attribute variable is a constant, 8-byte variable dimensioned by the entity dimension it characterizes. When you read data into it, it will contain the relationship between the members of the attribute dimension and the entity dimension. For example, the attribute variable Color stores the fact that Product P001 is red and P002 is blue. Attributes apply only to the input members of an entity dimension. The attribute dimensions and attribute variables share the same name, based on the field names you specified after the VARIABLE keyword in the CONSTRUCT command. If you specify multiple fields in the CONSTRUCT command, Application Server will create multiple attribute dimensions.
66
November 2011
Procedure to create attributes when the sources files have different file types
Create a procedure that follows this format:
ACCESS subsystem ...statement(s) to select\describe the source CONSTRUCT ATTRIBUTE <setname1> BY <dimension> VARIABLES <field> ...statement(s) to select\describe the next source END COMPILE ATTRIBUTE <setname1> ACCESS <subsystem> ...statement(s) to select\describe the next source CONSTRUCT ATTRIBUTE <setname2> BY <dimension> VARIABLES <field> END COMPILE ATTRIBUTE <setname2>
Procedure to create individual attribute sets when all the attribute information exists in one source file
Create a procedure that follows this format:
ACCESS subsystem ...statement(s) to select\describe the source CONSTRUCT ATTRIBUTE <setname1> BY <dimension> VARIABLES <field> ...repeat select statement if source is Access LsLink CONSTRUCT ATTRIBUTE <setname2> BY <dimension> VARIABLES <field> END COMPILE ATTRIBUTE <setname1> COMPILE ATTRIBUTE <setname2>
November 2011
67
where <hierarchy_name> is the name you want to call the hierarchical attribute. This name will be the name of the dimension set containing the attribute hierarchy members and level information. If you are constructing more than one hierarchical attribute for a dimension, specify each hierarchical attribute in a separate CONSTRUCT command. where <fields> are the column names from the source that contains the hierarchy levels. You can specify multiple fields, separated by commas, to construct multiple levels for the attribute hierarchy. The first field is the lowest level of the hierarchy, the next field is the next level of the hierarchy, and so on. PREFACE "BY <dimension>" is the name of the entity dimension that you are associating this hierarchical attribute with. The result is a compiled dimension called <hierarchy_name> and an attribute variable with the same name. Note: When you run the COMPILE DIMENSION command, the system checks for multiple counting issues in the hierarchical attribute dimension just like it does for standard dimensions. At run time, any dynamic aggregations performed will automatically adjust the aggregations to correct any multiple counting issues in an regular dimensions or hierarchical attribute dimensions in the view. For information, see Multiple Counting in Dimensions. The hierarchy dimension set looks like this:
BY <dimension> INPUT '<member>' ,'<member> ...' OUTPUT '<member>' ,'<member>'... RESULT <TOTAL_hierarchy_name> '<TOTAL hierarchy_name>' LEVEL <field> ,<field>... <consolidation statements>
2. Create a procedure that constructs the attribute set using the following format:
ACCESS <subsystem> 'statement(s) to select/describe the source BEGIN CONSTRUCT ATTRIBUTE <attributeset> BY <dimension> VARIABLE <field>, ..., <field> LABEL <field>,..., <field> HIERARCHY <hierarchy_name>, ..., <hierarchy_name> END END COMPILE ATTRIBUTE <attributeset>
where <attributeset> is the name of the attribute set you are constructing.
68
November 2011
where <dimension> is the name of the entity dimension with which this attribute is associated. VARIABLE <field> is the column name from the source that contains the attributes that do not have hierarchies. You can specify multiple fields, separated by commas, to construct multiple attributes for the dimension. For example:
VARIABLES color, size
HIERARCHY <hierarchy_name> is the hierarchical attribute name defined in the CONSTRUCT <hierarchy_name> command. If you constructed more than one hierarchical attribute, specify each name here, separated by a comma. If you constructed a simple attribute and two hierarchical attributes, the attribute set looks like this:
BY <dimension> VARIABLE <field> <member> ,<member> ... VARIABLE <hierarchy_name> HIERARCHY VARIABLE <hierarchy_name> HIERARCHY
Procedure
1. Enter the following command:
ATTRIBUTE <setname>
where <setname> is the name of the set you are creating or editing. The Attribute editor appears. 2. Type or edit the following:
BY <dimension> VARIABLE <field> <member> ['label '] ,<member> ['label' ] ...
where <dimension> is the name of the entity dimension that the attribute is associated with. where <field> is the name of the attribute. where <member> is an attribute member. Specify one or more members separated by a comma. where label is an optional label for the member. If your label contains single (' ') or double (" ") quotation marks, you need to encapsulate the member label in a different quoting character. For example: "Don't try this at home". 3. Save the changes and choose Exit from the File menu. Application Server automatically compiles the attribute when you exit from the set editor.
November 2011
69
Application Server displays the attribute sets. Optionally, you can enter SHOW ATTRIBUTE. 2. Go to the attribute set:
ATTRIBUTE <setname>
3. Check the structure. Multiple VARIABLE statements mean that this attribute set has multiple attribute dimensions and was constructed from one source file. If the attribute information was in separate source files, you will have separate attribute sets.
BY <dimension> VARIABLE <field> <member> '<label>' , ... ,<member> '<label>' VARIABLE <field> ,<member>, ... CLASS <name> <member>, <member>, ...
where <dimension> is the name of the entity dimension this attribute is associated with. where <field> is the name of the attribute. Application Server derives them from the source column name. where <members> are the attribute members. Application Server derives them from the values in the source column. where <labels> are the attribute member labels. They are optional. Application Server derives these labels from the values in the source column. If your label contains single (' ') or double ("
70
November 2011
") quotation marks, you need to encapsulate the member label in a different quoting character. For example: "Don't try this at home".
Procedure
1. Create a procedure that reads data into the attribute:
PROCEDURE <setname> SELECT VARIABLE <attributevar>, <attributevar>, SELECT <dimension> INPUT ACROSS VARIABLE DOWN Time, <dimension> ACCESS <subsystem> <statements that select/describe the source> PEEK ONLY 5 ...Reselect the source, if necessary (Access LsLink) <statements that select/describe the source> READ END
where <attributevar> is the name of the attribute variable(s) whose data you are reading. where <dimension> is the entity dimension this attribute is associated with. Note: Because Time is a constant in this situation, it is the first dimension to appear in the Down list. 2. Save the changes and exit from the procedure editor by choosing Exit from the File menu. 3. Run the procedure:
JOB setname
November 2011
71
Application Server at the Command Level Attributes 2. Create and execute a procedure to read data into the attribute variable.
4.6.4
Using Attributes
These commands show all the input members of product aggregated according to color. The sales of each color of products appear in separate rows in the output.
SELECT sales SELECT Product input SELECT Product input ACROSS time DOWN var, Color LIST
Note: You cannot display an attribute and a dimension with the same name in a view.
72
November 2011
Procedure
Type either of the following commands:
SELECT <dimension> WHERE <attribute> <expression> < member>, <member> SELECT <attribute> <member>
where <dimension> is the name of the dimension you want to select. where attribute1 is the attribute you are using as criteria for selection. where attribute2 is the attribute you are selecting. where member is the member of the attribute you are using as criteria for selection.
November 2011
73
4.6.5
-> Straight Cut -> Classics -> Loose Fit -> Pleated -> Contemporary -> Classics
Create the Attribute Dimensions for the Hierarchical attributes Create the Attribute Set, which includes the Hierarchical and non-Hierarchical attributes Read data into the attributes ................................................................... ... AUTHOR: ... DATE: ... PROC: ... DESC: ... ... ... xxx
Color, and Style for the dimension PRODUCT, then loads data into the attributes. All attributes are hierarchical except Brand.
74
November 2011
TRACE BOTH &TraceFile;ext overwrite ... Set up a TIMER in elapsed seconds SET CONTROL TMR_AC_PRODUCT Clock SHOW CONTROL TMR_AC_PRODUCT ................................................................... ... STEP 1 ... CONSTRUCT THE HIERARCHY FOR THE ATTRIBUTES ... This step creates the Attribute Dimensions required by ... Hierarchical Attributes. ... Only the Brand attribute is not hierarchical, so do not include ... Brand in this first step. ...................................................................... ... Starts the ACCESS Subsystem and Links to the correct Database ACCESS LSLINK CONNECT DataLink ... Issue the SQL select statement which selects fields ... from the Database table Products BEGIN SELECT * FROM Product END ...Build the Hierarchy for the Attribute Material BEGIN CONSTRUCT Material LEVEL Material, Material_Type LABEL Material_Name, Material_Type_Name PREFACE "BY PRODUCT" END ...Build the Hierarchy for the Attribute Color BEGIN CONSTRUCT Color LEVEL Color, Color_Group LABEL Color_Name, Color_Group_Name PREFACE "BY PRODUCT" END ...Build the Hierarchy for the Attribute Style BEGIN CONSTRUCT Style
November 2011
75
Application Server at the Command Level Attributes LEVEL Style, Style_Group LABEL Style_Name, Style_Group_Name PREFACE "BY PRODUCT" END ... Ends out of the ACCESS Subsystem END ...Compile the hierarchical attributes (not Brand) COMPILE DIMENSION Material COMPILE DIMENSION Color COMPILE DIMENSION Style ................................................................... ... STEP 2 ... CONSTRUCT THE ATTRIBUTE SET ... This includes the Hierarchical and Non-hierarchical attributes. ................................................................... ... Starts the ACCESS Subsystem and Links to the correct Database ACCESS LSLINK CONNECT DataLink ... Issue the SQL select statement which selects fields ... from the Product Database table BEGIN SELECT * FROM Product END ...Build the Attribute dimension set called PRODUCT BEGIN CONSTRUCT ATTRIBUTE PRODUCT BY PRODUCT VARIABLE Brand LABEL Brand_Name HIERARCHY Material, Color, Style PREFACE 'RESULT LEVEL' END ... Ends out of the ACCESS Subsystem END ...Compile the attribute COMPILE ATTRIBUTE PRODUCT ................................................................... ... STEP 3
76
November 2011
... READ DATA INTO THE ATTRIBUTES ................................................................... ... Clear all prior selects CLEAR STATUS ... Select dimension and variable for which data is to be loaded SELECT PRODUCT INPUT SELECT VARIABLES Brand, Material, Color, Style ... Attributes have no relation to time - they are constant over time ... Set the period to DEFAULT rather than selecting a date range SET PERIOD DEFAULT ... Sets up external file matrix layout ACROSS VARIABLES DOWN TIME, PRODUCT ... Starts the ACCESS Subsystem and Links to the ... correct Database ACCESS LSLINK CONNECT DataLink ... Issue the SQL select statements which selects fields ... from the Products Database table BEGIN SELECT * FROM Product ORDER BY Product END ... Reads the data into the Application Server database READ SAVE 10000 ... Ends out of the Access LSLINK subsystem END ... Displays the TIMER in elapsed seconds SET CONTROL TMR_AC_PRODUCT ELAPSED SHOW CONTROL TMR_AC_PRODUCT ... Attribute PRODUCTS Complete ... Turns off trace to external file TRACE BOTH OFF
November 2011
77
Application Server at the Command Level Attributes Consider a file that contains data for a Drinks and Region dimension. The file also contains data for an attribute called Pkg_Type and a hierarchical attribute that has a Size level that consolidates into a Package level. For example: Drinks Cola Spritz Column Drinks City State Date Size Package Pkg_type Sales City Phoenix Boston State AZ MA Date 9801 9802 Size 32 oz. 8 oz. Package Giant Junior Pkg_Type bottle can Sales 1,000 1,500
Item to construct First level of the drinks dimension (Next level is total) First level of the region dimension Second level of the region dimension Time dimensions, automatically read into Application Server. First level in a hierarchical attribute Second level in a hierarchical attribute Another attribute of the drinks dimension Sales variable
4.6.5.2.1
Note: Use these procedures as syntax examples - they will not work with the demonstration databases in your installation. This procedure constructs and compiles the Drinks and Region dimensions:
...Construct the Region dimension ACCESS LSLINK CONNECT dbase SELECT city, state FROM Drinks CONSTRUCT region LEVEL city, state ...Construct the Drinks dimension SELECT drinks FROM Drinks CONSTRUCT Drinks LEVEL Drinks END COMPILE DIMENSION Region COMPILE DIMENSION Drinks
The following is an example of the dimension set for the Region dimension. Application Server consolidates two input members into a Result member.
INPUT COLA ,SPRITZ RESULT TOTAL_DRINKS 'TOTAL DRINKS' LEVEL DRINKS TOTAL_DRINKS = INPUTS
The following is an example of the dimension set for the Region dimension. Application Server consolidates two input members into an output level. Application Server consolidates the output level into a result.
78
November 2011
INPUT PHOENIX ,BOSTON OUTPUT AZ ,MA RESULT TOTAL_REGION 'TOTAL REGION' LEVEL CITY ,STATE AZ = PHOENIX MA = BOSTON TOTAL_REGION = SUM AZ, MA
4.6.5.2.2
Note: Use this procedure as syntax example - it will not work with the demonstration databases in your installation. This procedure constructs a dimension set containing the attribute member and level information for a hierarchical attribute. It also creates an attribute variable that bears the same name as the dimension set.
...Construct the attribute hierarchy associated with the Drinks dimension ACCESS LSLINK CONNECT dbase SELECT drinks, size, package FROM Drinks CONSTRUCT Size LEVEL size, package PREFACE "BY drinks" END COMPILE DIMENSION Size
The dimension set for the hierarchical attribute looks like this. It shows that sizes are the lowest level of the attribute's hierarchy, packaging is the next higher level, and a Result member is the highest level, which is the sum of all the members of the attribute.
DIMENSION Size BY Drinks INPUT '48_OZ.' ,'32_OZ.' ,'12_OZ.' ,'8_OZ.' OUTPUT 'Junior' ,'Giant' RESULT
November 2011
79
4.6.5.2.3
Note: Use these procedures as syntax examples - they will not work with the demonstration databases in your installation. This procedure constructs the attribute set, which contains a simple attribute and a hierarchical attribute. When the attribute set is compiled, the attribute variables pkg_type and size are also created.
ACCESS LSLINK CONNECT dbase SELECT Drinks, size, package, pkg_type FROM drinks CONSTRUCT ATTRIBUTE attset BY drinks VARIABLE pkg_type HIERARCHY size END COMPILE ATTRIBUTE attset
The following is an example of the attribute set, attset. It shows that Application Server has constructed two attributes: the simple attribute Pkg_type and the hierarchical attribute Size.
ATTRIBUTE attset BY DRINKS VARIABLE PKG_TYPE BOTTLE ,CAN VARIABLE SIZE HIERARCHY
80
November 2011
4.6.5.2.4
Note: Use this procedure as a syntax example - it will not work with the demonstration databases in your installation.
...Select the attribute variables and then read in the data SELECT var pkg_type, size SELECT drinks input ACROSS var DOWN Time, Drinks ACCESS LSLINK CONNECT dbase SELECT * FROM Drinks PEEK ONLY 5 LSS CREATE size = size SELECT * FROM Drinks ...Read data into the variable READ END ...This shows the data that was loaded into the attribute variables: PKG TYPE HIER ATT COLA BOTTLE32_OZ. 8_OZ.
SPRITZ CAN
4.6.5.3.1
Consider a file, PRODUCT.DBF, which contains information about the products that the company XYZ sells and attribute information about the products. Column Code Flavor Desc Brand Bdesc Pack_Cnt Form Item to construct First level of the product dimension Attribute of the product dimension Label for the Code column Second level of the product dimension Label for the Brand column Attribute of the product dimension Third level of the product dimension
November 2011
81
Application Server at the Command Level Attributes CODE FLAVOR 950 953 074 075 076 077 078 079 080 081 ORANGE ORANGE PEACH RASPBERRY STRAWBERRY LIME LEMON LEMON BLACKBERRY DESC ORANGE MINIS ORANGE MINIS SHER REG PK SHER REG PK SHER REG PK SHER REG PK SHER REG PK SHER REG PK SHER REG PK BRAND BDESC 22 22 44 44 44 44 44 44 44 44 PACK_CNT FORM BARS BARS Sandwich Sandwich Sandwich Sandwich Sandwich Sandwich Cups Cups
CITRUS FRESH 6 count CITRUS FRESH 5 pack Sherbetco Sherbetco Sherbetco Sherbetco Sherbetco Sherbetco Sherbetco Sherbetco 12 pack 12 pack 12 pack 12 pack 12 pack 12 pack 12 pack 12 pack
Consider a file, ACCOUNT.DBF, which contains information about the customers that the company XYZ sells to. Column Account_co Name Market District Region Zone Item to construct First level of the customer dimension Label for account_co column Second level of the customer dimension Third level of the customer dimension Fourth level of the customer dimension Fifth level of the customer dimension MARKET DISTRICT 32608 32608 12104 12104 32608 32608 32804 32801 32801 32801 32801 BAY AREA BAY AREA BOSTON BOSTON BAY AREA BAY AREA S. CAL PHOENIX PHOENIX PHOENIX PHOENIX REGION NORTHWEST NORTHWEST NORTHEAST NORTHEAST NORTHWEST NORTHWEST WEST WEST WEST WEST WEST ZONE Western Western Eastern Eastern Western Western Western Western Western Western Western
ACCOUNT_CO NAME 4000 8000 6000 6001 3000 3001 3002 3003 3004 3005 3006 SHERBET SELECT FD N.E. DIST N.E. DIST FROSTY BITS SEALED FDS SEALED FDS SEALED FDS SEALED FDS SEALED FDS SEALED FDS
Consider a file, TRANSACT.DBF, which contains the sales data and broker commission data to read in. Column Code Account_co Date Item to construct Links the Code column in PRODUCT.DBF Links the Account_co column in Account.Dbf Time dimension automatically read in.
82
November 2011
Sales variable Broker commission variable Cases variable SALES BROKER_COM CASES 770.12 27.52 540.24 35.04 363.36 40.08 333.76 80.94 887.52 62.82 908.00 204.00 804.00 42.00 908.00 94.00 908.00 94.00 976.00 77.80 99.00 198.00 182.00 91.00 273.00 200.00 100.00 200.00 200.00 160.00 FORM CUPS CUPS CUPS BARS BARS DADE DADE DADE DADE SINGLES
CODE ACCOUNT_CO DATE 079 081 080 076 077 075 078 950 074 953 4000 8000 6000 6001 3001 3000 3002 3004 3005 3006 9401 9401 9401 9401 9401 9401 9401 9401 9401 9401
4.6.5.3.2
Note: Use this procedure as a syntax example - it will not work with the demonstration databases in your installation. This procedure constructs the Product and Customer dimensions:
...Build the Product dimension ACCESS LSLINK CONNECT dbase SELECT * FROM product PEEK ONLY 10 SELECT * FROM product CONSTRUCT product LEVEL code,brand, bdesc, NOALIAS END COMPILE DIMENSION product ...Build the customer dimension ACCESS LSLINK CONNECT dbase SELECT * FROM account PEEK ONLY 1 SELECT * FROM account LSS CREATE cust = account_co BEGIN CONSTRUCT customer LEVEL cust, market, district, region, zone LABELS name,?,?,?,? END END
November 2011
83
The dimension set for the Product dimension would look like this:
INPUT '950' 'ORANGE MI' ,'953' 'ORANGE MI' ,'74' 'SHER REG' ,'75' 'SHER REG' ,'76' 'SHER REG' ,'77' 'SHER REG' ,'78' 'SHER REG' ,'79' 'SHER REG' ,'80' 'SHER REG' ,'81' 'SHER REG' OUTPUT '22' 'CITRUS FR' ,'44' 'Sherbetco' RESULT TOTAL_PRODUCT 'TOTAL PRODUCT' LEVEL CODE ,BRAND '22' = SUM '950', '953' '44' = SUM '74', '75', '76', '77', '78', '79', '80', '81' TOTAL_PRODUCT = SUM '22', '44'
The dimension set for the Customer dimension would look like this:
INPUT '4000' 'SHERBET' ,'8000' 'SELECT FD' ,'6000' 'N.E. DIST' ,'6001' 'N.E. DIST' ,'3000' 'FROSTY BI' ,'3001' 'SEALED FD' ,'3002' 'SEALED FD' ,'3003' 'SEALED FD' ,'3004' 'SEALED FD' ,'3005' 'SEALED FD' ,'3006' 'SEALED FD' OUTPUT '32608' ,'12104'
84
November 2011
,'32804' ,'32801' OUTPUT BAY_AREA ,BOSTON ,'S._CAL' ,PHOENIX OUTPUT NORTHWEST ,NORTHEAST ,WEST OUTPUT WESTERN ,EASTERN RESULT TOTAL_CUSTOMER 'TOTAL CUSTOMER' LEVEL CUST ,MARKET ,DISTRICT ,REGION ,ZONE '12104' = SUM '6000', '6001' '32608' = SUM '4000', '8000', '3000', '3001' '32801' = SUM '3003', '3004', '3005', '3006' '32804' = '3002' 'S._CAL' = '32804' BAY_AREA = '32608' BOSTON = '12104' PHOENIX = '32801' NORTHEAST = BOSTON NORTHWEST = BAY_AREA WEST = SUM 'S._CAL', PHOENIX EASTERN = NORTHEAST WESTERN = SUM NORTHWEST, WEST TOTAL_CUSTOMER = SUM WESTERN, EASTERN
4.6.5.3.3
Note: Use this procedure as a syntax example - it will not work with the demonstration databases in your installation.
November 2011
85
Application Server at the Command Level Attributes This procedure constructs two attributes, flavor and pack, stored in a single attribute set, prodatt, for the Product dimension:
...Construct the flavor and pack_cnt attributes ACCESS LSLINK CONNECT dbase SELECT * FROM product PEEK ONLY 10 SELECT * FROM product CONSTRUCT ATTRIBUTE prodatt BY Product VARIABLE flavor, pack_cnt END COMPILE ATTRIBUTE prodatt
4.6.5.3.4 Creating the Variables, Reading Data into Them, and Consolidating
Note: Use this procedure as a syntax example - it will not work with the demonstration databases in your installation. This procedure creates the sales, broker_com, and cases variables and reads data into the variables:
...Create the variables CREATE sales, broker_com,cases BY product, customer ...Select the items and set up the view
86
November 2011
ACROSS var DOWN product, customer, time SELECT var BY product, customer SELECT product input SELECT customer input SET PERIOD 1998 ...Read data into the variable ACCESS LSLINK CONNECT dbase SELECT * FROM transact STATUS PEEK ONLY 10 LSS CREATE product = code LSS CREATE customer = account_co LSS CREATE time = SUBSTR(date,1,2) + "/" + SUBSTR(date,3,2) SELECT * FROM transact READ ADD END ...Consolidate SELECT Product SELECT Customer SELECT var BY product, customer ROLLUP sales ADD EVERYBODY END CONSOLIDATE
4.6.5.3.5
Note: Use this procedure as a syntax example - it will not work with the demonstration databases in your installation. This procedure reads information into the flavor and pack_cnt attribute variables:
...Read data into the flavor and pack_cnt attribute variables
November 2011
87
4.6.5.3.6
Using Attributes
Assuming that the Product and Customer dimensions and the Pack_cnt and Flavor attributes are constructed in this fictional example, this section displays some possible sample report code: Note: Use these procedures as syntax examples - they will not work with the demonstration databases in your installation. What is the best selling flavor of sherbet this year?
SELECT sales SELECT flavor orange SELECT Customer region ACROSS var, time DOWN flavor, customer ORDER customer ON sales LIST
Note: You cannot display data for an attribute on a rate variable. For example, the following will not list the rate variable MGNPCT2:
USE JUICE SELECT MON SELECT PER JAN96 SELECT CHANNEL SELECT CUSTOMER SELECT PRODUCT SELECT COT CREATE MON MGNPCT2 BY CHANNEL, CUSTOMER, PRODUCT RATE CALCULATE MGNPCT2=100*(sales-quota)/quota FULL
88
November 2011
9140 Member Combination(s) Calculated; 370 Consolidated SELECT CHANNEL #1 SELECT PRODUCT #1 SELECT CUSTOMER #1 ACROSS TIME,CHANNEL,CUSTOMER,PRODUCT,VAR DOWN COT SELECT SALES, QUOTA, MGNPCT2 1 Variable Currently Selected LIST Jan 99 Direct 7 Eleven - Nashua NH Courtyard 12oz Conc. Sales CONVENIENCE TOTAL COT Quota 11,524.20 11,524.20 MGNPCT2 617,904.00 617,904.00 -
4.7
Application Server uses three types of variables: Normal variables These are often referred to as derived variables because their data values are derived from relational tables. Data values are stored within time series in the database. Calculated variables These are calculated by Application Server by applying user specified formulas or logics to other variables in the database. For example, you might create a calculated variable named Margin, which is calculated using the formula Sales - Costs. Like normal variables, data values for calculated variables are stored within time series in the database. These data values are generated when you execute a calculate command. Virtual variables Like calculated variables, virtual variables are created by applying formulas and logics to existing variables. They differ from calculated variables because their data values are generated dynamically when you request them, and they are not stored permanently. For example, you might create a virtual variable named Margin% which is calculated using the formula ((Sales Costs)/Sales) * 100. Data values are automatically generated when you create a view that contains Margin%. Distributed variables From version 6.2 onwards, you have the ability to create distributed variables. These variables are contained within different databases. Data is distributed across multiple Application Server models. The master model, together with the slave (also called variable) models, make up a virtual model or cube.
4.7.2
Procedure
Creating a Variable
1. Open a dimensional model for exclusive access. 2. Enter the following command:
CREATE periodicity [TEXT] name BY dimensions
where:
November 2011
89
Application Server at the Command Level Variables and Reading in Data periodicity is the frequency of data observations, such as monthly TEXT is an optional keyword indicating the variable contains text name is the name of the variable you want to create dimensions is a list of dimensions, separated by commas
For example: CREATE VARIABLE SALES WEEKLY BY MERCHANDISE, TYPE
Note: Application Server creates a default monthly numeric variable if you do not assign a frequency.
4.7.3
Procedure
1. Open the database for exclusive access. 2. Enter either of the following commands:
CREATE variable BY dimensions as expression CREATE variable BY dimensions LOGIC logic
where variable is the name of the virtual variable you want to create dimensions is a list of dimensions the virtual variable is dimensioned by; separate dimension names with a comma expression is the expression you want to use to calculate the variable logic is the logic you want to use to calculate the variable
Notes:
You cannot specify expressions that are associated with time, or specify a long name for the virtual variable in quotes. Use a logic if you need to create a long name for the virtual variable. Virtual measures do not support periodicity-based conditions, for example, WHEN YEAR IS XXX.
4.7.4
You create virtual variables by applying formulas and logics to existing variables. For example, you might create a virtual variable named Margin% which is calculated using the formula ((Sales Costs)/Sales) * 100. Virtual variables differ from calculated variables because their data values are generated dynamically when you request them. Because no data values are stored in the database, the database size is substantially reduced and its structure is simplified. With normal variables, Application Server only provides support for summing attributes or UserDefined Hierarchies. Using virtual variables, you can create percentage and ratio variables (which do not use summation) and use them with attributes or User-Defined Hierarchies.
Notes:
Virtual variables calculated with time based functions like LAG, LEAD, MOVING, MOVING2, and PERCHG should be used with caution. These measures can be displayed with Application Server's standard and to-date time periodicities but errors will result when a time set is used in place of time. Virtual measures do not support periodicity-based conditions, for example, WHEN YEAR IS XXX.
90
November 2011
4.7.5
You can build an Application Server master model whose variables are contained within different databases these are known as distributed variables. Variable data is distributed across multiple Application Server models. The master model, together with the slave (also called variable) models, make up a virtual model or cube. Using distributed variables enables you to carry out parallel maintenance of the databases that make up the Application Server model. If you run multiple jobs in parallel on a multiprocessor machine, the time taken to load and consolidate data can be greatly reduced. This facility is not possible when the variables all exist in the same database. Another benefit of using distributed variables is that the time series for each variable will be "clustered" together in their own databases, providing faster data retrieval by minimizing the number of database reads required to provide the typical types of views. When building virtual models with distributed variables, you must always have both the master model and the appropriate slave, or variable, models attached appropriately. The master model is the model in which you construct and store dimensions, both structural and attribute, and virtual measures. A slave, or variable, model is the model in which you store variables. Because each users requirements will be different, a high level overview of the processes required to build a virtual model is provided as a reference for the Database Administrator (DBA).
November 2011
91
4.7.6
Procedure
Reading in Data
1. Select the dimensions by which the variable data will be read in. For example:
SELECT Product SELECT Region SELECT Channel
2. (Optional) Enter the SHOW VARIABLE command to see a list of all variables in the database. 3. Select the variables into which data will be read. For example:
SELECT VARIABLES or SELECT Actsales SELECT Budsales SELECT Actunits SELECT Budunits
4. Specify the across/down structure from the source file. Variables are the across dimensions and time is the down. For example:
ACROSS var DOWN product, region, channel, time
8. (Optional) Make sure the first few records are being read in properly:
PEEK only 10
4.7.7
Procedure
1. Match the layout of the Application Server selections to the layout of the source file using the SELECT and ACROSS/DOWN commands. 2. Set the associated data range with the SET PERIOD command. 3. Enter the ACCESS EXTERNAL command. 4. Enter the USE command to identify the external file. 5. Enter the DESCRIPTION commands to identify the source file field names, types, widths, and positions.
92
November 2011
6. Enter the PEEK command to verify that the layout is correct. 7. Enter the READ command. 8. Enter END to return to the COMMAND window.
4.7.8
Procedure
1. Match the layout of your Application Server selections to the layout of the record/field format of the external file. 2. Enter the ACCESS command for the appropriate data source. 3. Enter the USE command to identify the external file that you want to read in or write out to. 4. Describe the field layout with either the DESCRIPTION command or the CONNECT and SELECT commands. 5. Enter the PEEK command to look at the external file with the description applied to the file. 6. Enter the READ command to load the data into the database. 7. Enter the END command to return to the command window.
Notes
You can increase the speed of loading data significantly by: Pre-sorting the data file Defining the best possible Across/Down layout Matching the Down command to the sort order Extending the work database size temporarily in the load procedure Increasing the buffer size
4.7.9
Create a procedure to help you track load processing statistics. Use the CLOCK and ELAPSED functions with control variables to track time statistics. Use the TRACE command to track commands and reassurance messages to an external file that you can review when the job is complete.
November 2011
93
Application Server at the Command Level Variables and Reading in Data BYTES 4 stores data as floating point with 7 decimal digit precision. BYTES 8 stores data as floating point with 15 decimal digit precision. This uses twice as much storage space as BYTES 4.
Costs Margin 2. From the File menu, choose Save, and then choose Close. 3. Issue an EXHIBIT MEASURES, EXHIBIT VARIABLES, or EXHIBIT VVARIABLES command. For example: EXHIBIT MEASURES EXCLUDE lists all virtual variables in the database, and all variables not included in the Excludevar document. EXHIBIT MEASURES DATABASE myremotedb EXCLUDE lists all virtual variables contained within distributed remote databases while excluding any variables listed in the Excludevar document. EXHIBIT VARIABLES EXCLUDE - lists all variables and attributes in the database, and excludes any variables listed in the Excludevar document. EXHIBIT VARIABLES LIKE SALES EXCLUDE - lists all variables and attributes in the database, and excludes any variables listed in the Excludevar document, if one exists EXHIBIT VVARIABLES EXCLUDE - displays a list of all virtual variable properties, and excludes any virtual variables listed in the Excludevar document.
94
November 2011
Note: You might want to exclude variables from the results of an EXHIBIT command if certain variables are used only in the calculation of other variables.
4.8
The CALCULATE command calculates and consolidates all the variables in the equation. When you enter the CALCULATE command, two things occur: The specific equation is calculated for every input dimension member selected. Each variable defined in the equation is then automatically consolidated, if output, or result members, or both are selected.
Consolidation
Application Server will only consolidate based on which variables and members have been selected for the specified time period. For example:
>SELECT SALES >SELECT TYPE >SELECT MERCHANDISE >CONSOLIDATE (SALES) PERIOD August 1995
If the dimension(s) of a variable has output or result members, the variable can have time series that store the consolidated values for the time-series created by output members. The values for these consolidated time series are generated by the CONSOLIDATE command. Consolidation uses the data from the input member time series, and calculates the consolidated member time series according to the rules defined in the dimension set. Application Server consolidates selected variables. You can specify the variables to consolidate by including their name(s) with the CONSOLIDATE command. In addition, all time periods are consolidated unless you limit processing with the PERIOD keyword or SET PERIOD date range command.
4.8.2
You use the ADD statement in the Rollup editor to specify which member combinations (quadrants) to use in a fast (smart) consolidation. A smart or fast consolidation gets each series from the database for a particular variable and adds it to its parent. Fast consolidation uses a strictly additive approach, where only simple additions and subtractions are used to roll up child series into their parents. For example, a fast consolidation can execute statements such as:
November 2011
95
Application Server at the Command Level Data Calculation, Consolidation and Rollup
CA = SUM LOS_ANGELES,SAN_FRANCISCO,SACRAMENTO,SAN_DIEGO
During the CONSOLIDATE, Application Server gets each time series available and adds it to the parent, in this case, CA. If data is not present for a particular combination, no work is required. For example, if data exists only for SAN_DIEGO, only one I/O operation has to be carried out to get the series. (A normal consolidation would require four I/O operations.) The fraction of work saved is directly proportional to the sparsity of the data. For example, if only 1/10th of the possible series is available, Application Server spends only 1/10th of the effort.
If all data needs to be consolidated, you would want to specify ADD EVERYBODY to include all member combinations. You would add only certain combinations if you know that you never need to look at consolidated data for a particular combination. If all combinations are currently added and consolidated, and want to remove an unpopular or unnecessary combination to optimize the database, you can remove the combination from consolidation using the REMOVE statement. Or you can designate that the unpopular combination will be available for consolidation on the fly using the CHANGE DYNAMIC statement. Note: You cannot use the Rollup editor to define rollups on variables where dimensions contain non-additive logic constructs (for example, WHEN...ENDWHEN, multiplication, and so on). Dimensions with different rules, such as multiplication, division, WHEN/ENDWHEN logic, complicated calculations, or logic constructs, are rejected.
Procedure to perform a normal consolidation on data that has been consolidated by the fast consolidation method
1. Remove the dimension/quadrant table using:
ROLLUP <variable> REMOVE EVERYBODY END
Procedure to perform a normal consolidation on data that has not been consolidated yet
Issue the CONSOLIDATE command. For example, a normal consolidation can execute the following statement in a Dimension set:
CA = SUM LOS_ANGELES,SAN_FRANCISCO,SACRAMENTO,SAN_DIEGO
96
November 2011
During the CONSOLIDATE, Application Server by getting the time series for LOS_ANGELES, and then for SAN_FRANCISCO, and then for SACRAMENTO, and then for SAN_DIEGO. Then it adds the series and stores them in CA. A normal consolidation would require four I/O operations. It is more time consuming than a fast consolidation when data is not present for a particular combination because an I/O operation occurs for this combination anyway.
November 2011
97
Application Server at the Command Level Data Calculation, Consolidation and Rollup When you issue a SHOW statement, the quadrants marked as on the fly have an exclamation point (!) next to them.
Note: After changing a combination back to static, you should perform a fast consolidate to preconsolidate that combination. Otherwise, subsequent LISTs or DISPLAYs or a DataView will not display any data for the combination.
4.8.5
When you enter ROLLUP <variable>, Application Server creates a table based on the dimensions associated with that variable and all other variables with the same dimensions. Use the SHOW statement to view the table. When you issue a ROLLUP statement in the Rollup editor, and then issue a SHOW, the table is updated with symbols to identify how the quadrants will be consolidated when a CONSOLIDATE command is issued.
Displaying quadrants, rollup instructions, and their percentage that they are already consolidated
In the Rollup editor, use the SHOW statement or SHOW COUNT.
Rollups> show count
# 1 2 3 4 5 6 7 8
CHANNEL CUSTOMER PRODUCT Input Output Input Input Output Output Input Output Input Input Output Input Output Input Output Output Input Input Input Output Input Output Output Output
The SHOW keyword displays the following symbols to denote the various types: * + & ! $ means that there is data entered for these input combinations. identifies the dimension to be consolidated. means that there's data input at output levels, but existing series will not be overwritten during consolidation. This identifies that a NOOVERWRITE keyword was issue. means that the quadrant is marked with the DYNAMIC keyword and will be consolidated on the fly. means that the quadrant is marked as PRECONSOLIDATED so it will not be consolidated during a fast consolidation.
98
November 2011
Specifying that a quadrant has data loaded at the output level for the purposes of consolidation
In the Rollup editor, issue the CHANGE UPDATE CONSOLIDATE statement to specify the level at which data is loaded for the consolidation. For example:
ROLLUP <variable> CHANGE 3 UPDATE CONSOLIDATE Region Output END
4.8.8
Procedure
Consolidating Data
1. Specify a CHECKPOINT command that freezes the current status of the database:
CHECKPOINT FREEZE CONTINUE
2. Select the dimensions and variables you want to consolidate. For example:
SELECT Goods SELECT Zone SELECT Actsales
3. Specify the consolidation command for the period of time to be consolidated. For example:
CONSOLIDATE Actsales PERIOD 1/1/99 - 12/1/00
November 2011
99
Application Server at the Command Level Date Ranges and Fiscal Year Settings 4. Specify a CHECKPOINT command that updates the database:
CHECKPOINT UPDATE
Note: The SET VARIABLE [CONSOLIDATE | NOCONSOLIDATE] and CHECKPOINT commands control the efficiency of a consolidation.
4.9
Enter the SET FISCAL command that describes your company's fiscal year setup. If no fiscal year is set, the default is a standard January calendar year, and all time conversion calculations are based on this standard.
4.9.2
If a fiscal year other than the default (a calendar year starting in January) has been established, you can verify the fiscal year by entering the STATUS command. This command displays information about the fiscal year as well as about which databases are attached.
4.9.5
Do one of the following:
Enter the SET PERIOD DEFAULT command. The date range returns to the default setting. Enter the CLEAR STATUS command. The date range is reset to your original login state.
100
November 2011
4.9.6
Do one of the following:
Enter the LIST command with the PERIOD keyword. Enter the SET PERIOD command to limit the displayed time frame. Date formats include: LIST PERIOD 00/1-00/6 SET PERIOD Jan 00 - Jun 00 SET PERIOD DEFAULT LIST MONTHLY PERIOD 2000 Note: Application Server interprets most date conventions, but if the interpretation is not obvious, Application Server interprets dates in a MDY convention. Thus, if a date is entered as 1/2/00, it is interpreted as January 2 rather than February 1. You can enter the SET DATE command, followed by MDY or DMY, to change this default.
4.9.7
Enter the STATUS command to review the view settings and verify that a SET PERIOD is in effect. The SET PERIOD command maintains the specified dates until you enter the SET PERIOD DEFAULT command.
4.10 Periodicities
4.10.1 About Periodicities
By default, data is displayed in a dimensional model at the periodicity specified when the variables were created in the dimensional model. A number of default periodicity definitions are provided. In addition, you can create your own periodicity definitions, which then appear in the "User defined" section of the Calendar dialog box. If you do not create any periodicity definitions, or if the document that contains your definitions is not found, the Calendar dialog box displays only the default periodicities. You can use the Calendar dialog box to change the periodicity at which your data is displayed. For example, if your data is stored weekly, you can select a different periodicity in the Calendar dialog box to display the data biweekly, monthly, yearly, and so on. Note: You can select either a periodicity or time template in the Calendar dialog box, but not both together.
4.10.2
Periodicity description
Default Periodicities
4.10.2.1 Bimonthly
Displays data for each two-month period.
Example
This example shows several gross Sales values for a model with a start date of January 2, 1999: Jan - Feb 99 12,875,050.00
November 2011
101
Application Server at the Command Level Periodicities Mar - Apr 99 May - Jun 99 11,616,017.50 11,491437.00
4.10.2.2 Biweekly
Periodicity description
Displays data for each two-week period.
Example
This example shows several gross Sales values for a model with a start date of January 2, 1999: 01 Jan - 14 Jan 99 15 Jan - 28 Jan 99 29 Jan - 11 Feb 99 12 Feb - 25 Feb 99 2,552,923.48 2,736,415.00 3,286,490.48 3,486,554.21
4.10.2.3 Daily
Periodicity description
Displays data for each day.
Example
This example shows several gross Sales values for a model with a start date of January 2, 1999: 02 Jan 99 03 Jan 99 04 Jan 99 05 Jan 99 06 Jan 99 983,980.00 883,860.00 543,970.00 750,789.00 870,456.00
4.10.2.4 Hourly
Periodicity description
Displays data for each hour.
Example
This example shows several gross Sales values for a model with a start date of January 2, 1999: 1 am 02 Jan 2 am 02 Jan 3 am 02 Jan 4 am 02 Jan 5 am 02 Jan 6 am 02 Jan 7 am 02 Jan 8 am 02 Jan 980.00 980.00 980.00 980.00 980.00 980.00 980.00 980.00
102
November 2011
Note: If a message is displayed, advising you that the data exceeds the maximum number of observations, request that your database administrator changes the model within Application Server.
Example
This example shows several gross Sales values for a model with a start date of January 2, 1999 and an end date of May 31, 1999: 28 Jan 99 25 Feb 99 24 Mar 99 21 Apr 99 19 May 99 11,586,957.29 14,419,289.88 13,327,199.41 12,365,095.92 12,331,234.89
4.10.2.6 Monthly
Periodicity description
Displays data for each month between the specified start and end dates.
Example
This example shows gross Sales values for a model with a start date of January 2, 1999 and an end date of May 31, 1999: Jan 99 12,828,417.00 Feb 99 15,286,283.00 Mar 99 14,490,881.00 Apr 99 12,989,945.00 May 99 13,761,147.00
November 2011
103
Example
This example shows gross Sales values for a model with a start date of January 2, 1999 and an end date of May 31, 1999: 29 Jan 99 26 Feb 99 25 Mar 99 22 Apr 99 20 May 99 11,586,957.00 14,532,583.19 13,267,533.98 12,330,646.31 12,342,144.69
Example
This example shows gross Sales values for a model with a start date of January 2, 1999: 12.00 J 2 12.15 J 2 12.30 J 2 12.45 J 2 1.00 J 2 579.60 579.60 579.60 579.60 579.60
Note: If a message is displayed, advising you that the data exceeds the maximum number of observations, request that your database administrator change the model within Application Server.
Example
This example shows gross Sales values for a model with a start date of January 2, 1998 and an end date of May 31, 1999: Jan-Mar Qtd Apr-Jun Qtd Jul-Sep Qtd Oct-Dec Qtd Jan-Mar Qtd Apr-Jun Qtd 28,114,700.00 26,751,092.00 27,158,206.00 26,645,774.00 37,642,856.00 37,371,054.00
4.10.2.10 Quarterly
Periodicity description
Displays data for each quarter, or three month period, within the specified start and end dates.
104
November 2011
Example
This example shows gross Sales values for a model with a start date of January 2, 1999 and an end date of May 31, 1999: Jan-Mar 99 Apr-Jun 99 42,605,581.00 40,752,619.00
Periodicity description
Displays data in four-week blocks.
Example
This example shows gross Sales values for a model with a start date of January 2, 1999: 15/01/99 12/02/99 11/03/99 08/04/99 06/05/99 03/06/99 834,629.33 1,764,098.46 1,914,337.46 1,714,422.98 1,626,057.88 1,395,092.52
Periodicity description
Displays data in three-month blocks.
Example
This example shows gross Sales values for a model with a start date of January 2, 1999: Jan-Mar 99 Apr-Jun 99 5,742,911.87 5,056,326.75
Periodicity description
Displays data in 12-month blocks.
Example
This example shows gross Sales values for a model with a start date of January 2, 1998: 1998 1999 10,799,238.63 26,361,835.88
November 2011
105
Example
This example shows gross Sales values for a model with a start date of January 2, 1998 and an end date of May 31, 1999: Jan-Jun 98 Jul-Dec 98 Jan-Jun 99 82,605,581.00 80,752,619.00 86,989,486.00
4.10.2.15 Weekly
Periodicity description
Displays data for each week.
Example
This example shows gross Sales values for January for a model with a start date of January 2, 1999: 08 Jan 99 15 Jan 99 22 Jan 99 29 Jan 99 4,833,055.00 4,083,860.00 3,543,970.00 3,780,789.00
Example
This example shows gross Sales values for January for a model with a start date of January 2, 1999: 08 Jan 99 15 Jan 99 22 Jan 99 29 Jan 99 05 Feb 99 12 Feb 99 2,058,972.77 2,058,972.77 2,058,972.77 2,058,972.77 2,474,175.35 2,640,256.38
106
November 2011
Example
This example shows the gross Sales value for a model with a start date of January 2, 1999: 1999 Ytd 30,601,597.00
4.10.2.18 Yearly
Periodicity description
Displays data for each year within the specified start and end dates.
Example
This example shows the gross Sales value for a model with a start date of January 2, 1998 and an end date of December 31, 1998: 1998 542,286,210.00
4.10.3
General Periodicities
When you create a variable, you assign a general periodicity that specifies the unit of time in which you want to store the data. For example, if you create a variable with a monthly periodicity, each data point for that variable represents data for one month. You can display a variable in a different periodicity than its assigned periodicity. For example, if a variable has a monthly periodicity, you can display it quarterly or weekly (Application Server divides the value into 4 or 5 weeks).
Periodicity Yearly Semiannual Quarterly Bimonthly Monthly Lunar Weekly Biweekly Daily Hourly Displays data for every: 12 months 6 months quarter 2 months month 28 days. Use this with a 13-month fiscal year only. week 2 weeks day hour
4.10.4
Period-to-Date Periodicities
When you display a variable, you can specify the period-to-date at which to display data. For example, if you set the latest date to be the end of April of the current year, and you display your data for the past three years using the YTD periodicity, you see data for those past three years only through April of each year. You can compare the current year's year-to-date data with the previous year's data. You can display a variable in a longer periodicity than its assigned periodicity. For example, if a variable has a monthly periodicity, you can display data for quarter-to-date but you cannot display it week-to-date.
Periodicity MTD MYTD Displays data for the: month-to-date year-to-date, by month Note: You cannot use MYTD for quarterly or yearly variables.
November 2011
107
4.10.5
Rolling Periodicities
When you display a variable, you can use a rolling periodicity to operate independently of the nominal year, quarter, or month, and to look at some period of time as if it were a year, a quarter, or a month. For example, if you set the latest month to be May, a Rquarterly periodicity returns data for the months of March, April, and May. You can display a variable in a longer periodicity than its assigned periodicity. For example, if a variable has a quarterly periodicity, you can display it Rquarterly but you cannot display it Rmonthly.
Periodicity Ryearly Rquarterly Rmonthly Displays data for: the most recent 12 months. the most recent 3 months. the most recent 4 weeks.
108
November 2011
Change lists are provided in the APLIB database. To add or delete time sets from the default lists, or to create your own lists, modify the appropriate document for your locale setting.
longname]*
The PERIOD section of the definitions document is used to customize the list of built-in Application Server periodicities that are displayed in the Periodicity list on the Periodicity tab of the Calendar. Within the document, you can specify up to 20 CATEGORY sections, each containing a separate list of templates that can be selected from the Templates list on the Template tab of the Calendar. You can also include time templates that reside in other attached databases (see Example 3). The category name is separated from the CATEGORY keyword by one or more spaces. You must specify the time template short name and long name for each entry, separated by a TAB character. In addition to templates defined in the document, user-defined time templates that reside in your Work and Use databases appear in the Calendar Templates list as "Work database" and "Use database".
4.11.3
You now have more flexibility using time templates in the Calendar. You can define the behavior of the Calendar from each time template. By using the following keyword as the first line of a user-defined time template in your Application Server Use or Work database, you can control several aspects of how the Calendar functions. You precede this line with ellipses (...):
...TemplateDates={Latest|Both}
The following Calendar options and Application Server commands issued by the Calendar, are controlled by the content of TemplateDates in all time templates used by the Calendar: Start Date field in the Calendar (active or inactive) SET PERIOD command sent to Application Server SET EARLIEST command sent to Application Server SET LATEST command sent to Application Server
November 2011
109
Application Server at the Command Level Time Templates The following table describes the actions and options performed by the Calendar depending on the value of TemplateDates: TemplateDates value Latest Both Start Date field inactive active Set Period value Default start-end Set Earliest value start date start date Set Latest value end date end date
4.11.4
Note: The default time templates are contained in the APLIB database.
110
November 2011
Example
This example shows gross Sales for a model with a latest date of May 28, 1999: Jan 99 Ytd Feb 99 Ytd Mar 99 Ytd Apr 99 Ytd May 99 Ytd 68,339,832.00 139,596,952.00 215,210,480.00 290,921,808.00 371,669,888.00
Note: The default time templates are contained in the APLIB database.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: 5/28 Ytd 2,883,860.00 371,669,888.00
Note: The default time templates are contained in the APLIB database.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: May 99 Mtd Apr 99 Mtd 80,748,080.00 75,711,328.00
Note: The default time templates are contained in the APLIB database.
November 2011
111
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: May 99 Mtd May 98 Mtd 80,748,080.00 45,888,920.00
Note: The default time templates are contained in the APLIB database.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: Apr-Jun Qtd Jan-Mar Qtd 156,459,408.00 139,596,952.00
Note: The default time templates are contained in the APLIB database.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: Apr-Jun Qtd Apr-Jun Qtd 156,459,408.00 91,526,720.00
Note: The default time templates are contained in the APLIB database.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999:
112
November 2011
28 May 99 21 May 99
20,187,020.00 20,187,020.00
Note: The default time templates are contained in the APLIB database.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: 28 May 99 29 May 98 20,187,020.00 11,472,230.00
Note: The default time templates are contained in the APLIB database.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: 1999 Ytd 1998 Ytd 371,669,888.00 217,624,872.00
Note: The default time templates are contained in the APLIB database.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: May 1999 May 1998 1999 Ytd 80,748,080.00 45,888,920.00 371,669,888.00
November 2011
113
Application Server at the Command Level Time Templates 1998 Ytd 217,624,872.00
Note: The default time templates are contained in the APLIB database.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: May 1999 1999 Ytd May 1998 1998 Ytd 80,748,080.00 371,669,888.00 45,888,920.00 217,624,872.00
Note: The default time templates are contained in the APLIB database.
4.11.4.1.13 Month/Ytd
Template description
Displays the latest month and year to date values for the current year.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: May 1999 1999 Ytd 80,748,080.00 371,669,888.00
Note: The default time templates are contained in the APLIB database.
4.11.4.1.14 Q1-Q4/Ytd
Template description
Displays quarterly and year to date values for the previous year.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: Jan-Mar 98 Apr-Jun 98 Jul-Sep 98 126,098,152.00 139,149,292.00 158,062,580.00
114
November 2011
Oct-Dec 98 1998
178,320,816.00
601,630,840.00
Note: The default time templates are contained in the APLIB database.
4.11.4.1.15 Quarter/Ytd
Template description
Displays the latest quarter and year to date values for the current year.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: Apr-Jun 1999 1999 Ytd 238,981,616.00 371,669,888.00
Note: The default time templates are contained in the APLIB database.
4.11.4.1.16 Week/Ytd
Template description
Displays the latest week and year to date values for the current year.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: 28 May 99 1999 Ytd 20,187,020.00 371,669,888.00
Note: The default time templates are contained in the APLIB database.
4.11.4.1.17 Ytd
Template description
Displays the latest year to date value for the current year.
Example
This example shows the gross Sales value for a model with a latest date of May 28, 1999: 1999 Ytd 371,669,888.00
Note: The default time templates are contained in the APLIB database.
November 2011
115
Note: The default time templates are contained in the APLIB database.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: Jul-Sep 98 Oct-Dec 98 Jan-Mar 99 Apr-Jun 99 158,062,580.00 178,320,816.00 215,210,480.00 238,981,616.00
Note: The default time templates are contained in the APLIB database.
116
November 2011
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: Jun 98 47,622,572.00 Jul 98 49,327,344.00 Aug 98 51,919,672.00 Sep 98 56,815,564.00 Oct 98 57,681,632.00 Nov 98 59,990,968.00 Dec 98 60,648,216.00 Jan 99 68,339,832.00 Feb 99 71,257,120.00 Mar 99 75,613,528.00 Apr 99 75,711,328.00 May 99 80,748,080.00 Note: The default time templates are contained in the APLIB database.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: 05 Mar 99 12 Mar 99 19 Mar 99 26 Mar 99 02 Apr 99 09 Apr 99 16 Apr 99 23 Apr 99 15,122,705.60 15,122,705.60 15,122,705.60 15,122,705.60 15,122,705.60 18,927,832.00 18,927,832.00 18,927,832.00
November 2011
117
Application Server at the Command Level Time Templates 30 Apr 99 07 May 99 14 May 99 21 May 99 28 May 99 18,927,832.00 20,187,020.00 20,187,020.00 20,187,020.00 20,187,020.00
Note: The default time templates are contained in the APLIB database.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: 15 May 99 16 May 99 17 May 99 18 May 99 19 May 99 20 May 99 21 May 99 22 May 99 23 May 99 24 May 99 25 May 99 26 May 99 27 May 99 28 May 99 2,883,860.00 2,883,860.00 2,883,860.00 2,883,860.00 2,883,860.00 2,883,860.00 2,883,860.00 2,883,860.00 2,883,860.00 2,883,860.00 2,883,860.00 2,883,860.00 2,883,860.00 2,883,860.00
Note: The default time templates are contained in the APLIB database.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999:
118
November 2011
Note: The default time templates are contained in the APLIB database.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: May 99 80,748,080.00 Apr 99 75,711,328.00 Note: The default time templates are contained in the APLIB database.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: May 99 80,748,080.00 May 98 45,888,920.00 Note: The default time templates are contained in the APLIB database.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: Apr-Jun 99 Jan-Mar 99 238,981,616.00 215,210,480.00
Note: The default time templates are contained in the APLIB database.
November 2011
119
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: Apr-Jun 99 Apr-Jun 98 238,981,616.00 139,149,292.00
Note: The default time templates are contained in the APLIB database.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: Half1 99 Half1 98 % Change 454,192,096.00 265,247,444.00 71.23
Note: The default time templates are contained in the APLIB database.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: 28 May 99 21 May 99 20,187,020.00 20,187,020.00
Note: The default time templates are contained in the APLIB database.
120
November 2011
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: 28 May 99 29 May 98 20,187,020.00 11,472,230.00
Note: The default time templates are contained in the APLIB database.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: 1999 1998 985,564,392.00 601,630,840.00
Note: The default time templates are contained in the APLIB database.
Example
This example shows Sales values for a model with a latest date of December 3, 1998: 03 Dec 98 05 Nov 98 537,975.00 589,069.00
Note: The default time templates are contained in the APLIB database.
November 2011
121
Example
This example shows Sales values for a model with a latest date of December 3, 1998: 03 Dec 98 03 Dec 97 537,975.00 518,654.00
Note: The default time templates are contained in the APLIB database.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: May 99 80,748,080.00 May 98 45,888,920.00 % Change 76.00
Note: The default time templates are contained in the APLIB database.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: May 97 45,888,920.00 Variance 34,859,160.00
Note: The default time templates are contained in the APLIB database.
122
November 2011
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: Qtr 2 99 Qtr 2 98 % Change 238,981,616.00 139,149,292.00 72.00
Note: The default time templates are contained in the APLIB database.
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: 28 May 99 29 May 98 % Change 20,187,020.00 11,472,230.00 76.00
Note: The default time templates are contained in the APLIB database.
Example
This example shows gross Sales values for a model with a latest date of December 28 1998: 1998 1997 985,564,392.00 601,630,840.00 64.00
% Change
Note: The default time templates are contained in the APLIB database.
November 2011
123
Example
This example shows gross Sales values for a model with a latest date of May 28, 1999: 1999 Ytd 1998 Ytd % Change 371,669,888.00 217,624,872.00 71.00
Note: The default time templates are contained in the APLIB database.
4.11.5
Patterns January February March April May June July August September October November December 454 4 5 4 4 5 4 4 5 4 4 5 4
Fiscal Patterns
445 4 4 5 4 4 5 4 4 5 4 4 5 544 5 4 4 5 4 4 5 4 4 5 4 4
All fiscal patterns, such as 445 or 454, always begin in the month of January, even if you specify a month other than January to begin the fiscal year.
To begin a fiscal year in August and use a 544 pattern in which August has five weeks, September has four weeks, and October has four weeks, you would use a command similar to this:
SET FISCAL User 454 First August
See also
SET FISCAL
124
November 2011
You can define multiple User-Defined Hierarchies for a dimension, and you can include UserDefined Hierarchies in a User-Defined Hierarchy. Note: When switching databases, all selections related to that database, such as User-Defined Hierarchy creations, are discarded.
4.12.2
where <setname> is the name of the procedure. 2. In the Procedure editor, specify the appropriate ACCESS subsystem, the source file, and descriptions for the dimension:
ACCESS External USE <filename> BEGIN DESCRIPTION statements ... END ACCESS Link CONNECT name SELECT <field>, <field>, ... FROM <filename>
where <dimension> is the name of the dimension to construct. where <fields> are the source field names that you are constructing as dimension levels. You can specify multiple fields, separated by commas, to construct multiple levels for the dimension. where <number> is the maximum number of User-Defined Hierarchies that can be defined for this dimension. 4. Add the following lines to exit from the Access subsystem and compile the dimension:
November 2011
125
where <dimension> is the name of the dimension you are constructing. Note: When you re-compile a dimension, the User-Defined Hierarchy information that Application Server inserts into a copy of the compiled dimension in the work database is cleared. 5. Save the changes to the procedure and exit from the Procedure editor by choosing Exit from the File menu. 6. Run the procedure by entering:
JOB <setname>
Application Server constructs the dimension with the ability to have User-Defined Hierarchies. CUSTOM GROUPS number appears as the first line in the dimension set. Note: For User-Defined Hierarchies to work, the variables involved must have rollups defined. Note: When you compile a dimension (either standard dimension or one used for a UserDefined Hierarchy), the system automatically searches for multiple counting issues that arise if a dimensions members have multiple parents. During aggregation, the system corrects multiple counting issues by creating adjustments to eliminate the multiple counts. The adjustments are used during a CONSOLIDATE. No data values are changed until a CONSOLIDATE command is issued to reconsolidate data. For example: System> COMPILE DIMENSION product 1 Member Rolls Into Multiple Outputs All 6 Members of PRODUCT;MC1 Selected The dimension compiler detected multiple counting issues in Dimension PRODUCT. Adjustments have been made to internal aggregation rules to correct these issues. Automatic multiple counting corrections can only be performed on measures where a smart fast consolidate can be used (i.e., all of the dimensions have either simple additive or subtractive consolidations) i.e. the measure can be used with the ROLLUP editor. Automatic multiple counting corrections will not be performed on a measure if: Any of its dimensions have non additive calculations The measure is an INTEGRAL measure The user uses the NOCORRECTIONS keyword on COMPILE DIMENSION. This turns off the automatic multiple counting corrections for that dimension. All aggregations of a member that cause multiple counting must be of the same "sign" i.e. all additive or all subtractive. For example: System> COMPILE DIMENSION product 1 Member Rolls Into Multiple Outputs All 6 Members of PRODUCT;MC3 Selected Dimension PRODUCT contains both positive and negative sums. Compiler could not check for multiple counting
126
November 2011
where <dimension> is the name of the dimension for which you are defining User-Defined Hierarchies. 2. Add the CUSTOM statement to the first line:
CUSTOM <number>
where <number> is the number of User-Defined Hierarchies that can be defined for the dimension. 3. Save the changes and exit the dimension editor. Application Server automatically compiles the dimension set with the changes when you exit. Note: For User-Defined Hierarchies to work, the variables involved must have rollups defined. Note: When you compile a dimension (either standard dimension or one used for a UserDefined Hierarchy), the system automatically searches for multiple counting issues that arise if a dimensions members have multiple parents. During aggregation, the system corrects multiple counting issues by creating adjustments to eliminate the multiple counts. The adjustments are used during a CONSOLIDATE. No data values are changed until a CONSOLIDATE command is issued to reconsolidate data. For example: System> COMPILE DIMENSION product 1 Member Rolls Into Multiple Outputs All 6 Members of PRODUCT;MC1 Selected The dimension compiler detected multiple counting issues in Dimension PRODUCT. Adjustments have been made to internal aggregation rules to correct these issues. Automatic multiple counting corrections can only be performed on measures where a smart fast consolidate can be used (i.e., all of the dimensions have either simple additive or subtractive consolidations) i.e. the measure can be used with the ROLLUP editor. Automatic multiple counting corrections will not be performed on a measure if: Any of its dimensions have non additive calculations The measure is an INTEGRAL measure The user uses the NOCORRECTIONS keyword on COMPILE DIMENSION. This turns off the automatic multiple counting corrections for that dimension. All aggregations of a member that cause multiple counting must be of the same "sign" i.e. all additive or all subtractive. For example: System> COMPILE DIMENSION product 1 Member Rolls Into Multiple Outputs All 6 Members of PRODUCT;MC3 Selected Dimension PRODUCT contains both positive and negative sums.
November 2011
127
Application Server at the Command Level User-Defined Hierarchies Compiler could not check for multiple counting
or
CREATE <dimension> <user_defined_hierarch> [ "<label>" ] = <member> | <user_defined_hierarchy> + | - <member> | <user_defined_hierarchy> ...
where <dimension> is the name of the dimension for which you are creating User-Defined Hierarchies. where <user_defined_hierarchy> is the name of the user_defined_hierarchy you want to create. where <member> is the member of the dimension to be included in the User-Defined Hierarchy. Use the plus (+) and minus (-) signs to add or subtract members from a User-Defined Hierarchy. where <label> is the label for the User-Defined Hierarchy member. The labels must be in double (" ") quotation marks. Use up to 250 characters. where <user_defined_hierarchy> is the User-Defined Hierarchy to be included in the User-Defined Hierarchy. Use the plus (+) and minus (-) signs to add or subtract User-Defined Hierarchies. SELECTED includes all selected members of the dimension in the User-Defined Hierarchy.
Notes:
For User-Defined Hierarchies to work, the variables involved must have rollups defined. A User-Defined Hierarchy is created in the level above its highest members. For example, if all members of a User-Defined Hierarchy are input members, the User-Defined Hierarchy is created at the first output level.
4.12.3
128
November 2011
Procedure to select the members of the User-Defined Hierarchy as well as the User-Defined Hierarchy output
Enter:
SELECT <dimension> JUST BELOW <user_defined_hierarchy>
Procedure to select a dimension's levels and exclude User-Defined Hierarchies from the selection
Enter:
SELECT <dimension> LEVEL <level> MINUS CUSTOMGROUPS
where <dimension> is the name of the dimension whose User-Defined Hierarchies you want to list.
Procedure to save a dimension's User-Defined Hierarchies that can be quickly restored in the next session
Enter:
SAVE CUSTOM <dimension> <owner>.<setname> [PUBLIC | PRIVATE]
where <dimension> is the name of the dimension whose User-Defined Hierarchies you want to save. where <owner> is the Application Server user who created the User-Defined Hierarchy. If you omit the owner name, it is saved to the current user name. where <setname> is the name of the procedure in which to save the User-Defined Hierarchy information. where PUBLIC or PRIVATE specifies who will gain access to this User-Defined Hierarchy. You can make it available to all users, or to only the user who created the User-Defined Hierarchy. Note: To restore the User-Defined Hierarchies in the next session, you would have to issue the RESTORE command. The User-Defined Hierarchies will be restored from the compiled dimension
November 2011
129
Application Server at the Command Level User-Defined Hierarchies sets saved in the CGLIB database. This method allows you to quickly restore and retrieve UserDefined Hierarchies.
Procedure to save a dimension's User-Defined Hierarchies that can be completely recreated in the next session
Enter:
SAVE CUSTOM <dimension> <setname>
where <dimension> is the name of the dimension whose User-Defined Hierarchies you want to save. where <setname> is the name of the procedure in which to save the User-Defined Hierarchy information. Note: To restore the User-Defined Hierarchies in the next session, you would have to execute the procedure set. The User-Defined Hierarchies will be recreated from the definitions in the procedure set.
where TABS formats the output as tab-separated. where <database> is the name of the database containing the dimension. If you omit the database, the current USE database is used. where <owner> is the Application Server user who is responsible for the User-Defined Hierarchy. This owner was defined during the SAVE CUSTOM command. If you omit this name, the current Application Server user is used. where <dimension> is the name of the dimension whose User-Defined Hierarchies you want to show. where <setname> is the User-Defined Hierarchy procedure to show. This name was specified during the SAVE CUSTOM command. You can use wildcards in any part of the <database>.<owner>.<dimension>.<setname> syntax. 2. Use the RESTORE CUSTOM command to restore the User-Defined Hierarchies for the session. Enter:
RESTORE CUSTOM <dimension> <owner>.<setname>
where <dimension> is the name of the dimension whose User-Defined Hierarchies you want to restore in the current session. where <owner> is the Application Server user who created the User-Defined Hierarchy. If you omit the owner name, the current user name is used. where <setname> is the name of the procedure that contains the User-Defined Hierarchy information you want to restore. Note: Use this procedure when the User-Defined Hierarchy was originally saved using the SAVE CUSTOM <dimension> <owner>.<setname> PUBLIC | PRIVATE command. This method restores the User-Defined Hierarchy based on the saved compiled dimension set in CGLIB. This method is
130
November 2011
quicker than recreating User-Defined Hierarchies and allows you to retrieve User-Defined Hierarchy information quickly too.
Note: Use this procedure when the User-Defined Hierarchy was originally saved using the SAVE CUSTOM <dimension> <setname> command. This procedure completely recreates the UserDefined Hierarchy.
where TABS formats the output as tab-separated. where <database> is the name of the database containing the dimension. If you omit the database, the current USE database is used. where <owner> is the Application Server user who is responsible for the User-Defined Hierarchy. This owner was defined during the SAVE CUSTOM command. If you omit this name, the current Application Server user is used. where <dimension> is the name of the dimension whose User-Defined Hierarchies you want to show. where <setname> is the User-Defined Hierarchy procedure to show. This name was specified during the SAVE CUSTOM command. You can use wildcards in any part of the <database>.<owner>.<dimension>.<setname> syntax.
November 2011
131
where <dimension> is the name of the dimension whose User-Defined Hierarchies you want to clear.
where <dimension> is the name of dimension whose User-Defined Hierarchies you want to clear. You can specify more than one dimension, where each one is separated by a comma.
where <dimension> is the name of dimension whose User-Defined Hierarchies you want to clear. where <user_defined_hierarchy> is the name of the User-Defined Hierarchy you want to delete. You can specify more than one User-Defined Hierarchy, where each one is separated by a comma.
Procedure to clear a dimension of its User-Defined Hierarchies that has been saved to a public or private set in the CGLIB database
Enter:
CLEAR <dimension> USING <owner>.<setname>
where <dimension> is the name of dimension whose User-Defined Hierarchies you want to clear. where <owner> is the name of the Application Server who is responsible for the User-Defined Hierarchy. If you omit the owner, then the current Application Server user is used. where <setname> is the name of the set created during a SAVE CUSTOM command with the PRIVATE or PUBLIC keyword.
Notes:
When you clear a dimension's User-Defined Hierarchies, Application Server selects all the dimension's members. If the User-Defined Hierarchy has been saved using the SAVE CUSTOM command that does not include the PUBLIC or PRIVATE keywords, it can be recreated during another session by executing the procedure set. If this User-Defined Hierarchy has been saved using the SAVE CUSTOM command that includes the PUBLIC or PRIVATE keywords, then the compiled dimension set for this User-Defined Hierarchy remains saved in the CGLIB database and will be restored again during the next RESTORE CUSTOM command. If you want to completely remove the User-Defined Hierarchy from your database, including the compiled dimension set, then use the REMOVE CUSTOM command instead.
where <database> is the name of the database containing the dimension. If you omit the database, the current USE database is used.
132
November 2011
where <owner> is the Application Server user who is responsible for the User-Defined Hierarchy. This owner was defined during the SAVE CUSTOM command. If you omit this name, the current Application Server user is used. where <dimension> is the name of the dimension whose User-Defined Hierarchies you want to delete. where <setname> is the User-Defined Hierarchy procedure to delete. This name was specified during the SAVE CUSTOM command.
Notes:
You can remove more than one User-Defined Hierarchy at a time by separating each database.owner.dimension.setname with a comma. At a minimum, you must specify at least the dimension name and setname.
4.13.2
Database Level
where: database is the name of the database to which you want to add the access key read is the access key you want to use
November 2011
133
Application Server at the Command Level Security and Access To enable a user to read from the database, you must add the read key to the user's record in MASTERDB.
where: database is the name of the database to which you want to add the access key update is the access key you want to use To enable a user to update the database, you must add the update key to the user's record in MASTERDB.
where: access is the access key you want to remove database is the name of the database from which you want to remove the access key Note: Before removing an access key, you must ensure that all users are detached from the database.
where: database is the name of the database to which you want to add the protection key key is the protection key you want to add
Notes:
You can also set a protection key on a database record when you use the CREATE DATABASE command. Use protection keys with caution you need to know the key name in order to remove it later (there is no way to remove an unknown protection key).
134
November 2011
where: database is the name of the database from which you want to remove the protection key key is the protection key you want to remove
Notes:
Before removing a protection key, you must ensure that all users are detached from the database. You need to know the key name in order to remove it there is no way to remove an unknown protection key.
where: database is the name of the database you want to change usage is the default access mode in which the user is attached to the database. You can specify READ for read access, SHARED for shared access, or EXCLUSIVE for exclusive access. Note: The default access mode is used when a user enters a USE or ATTACH command without specifying a usage parameter.
where: database is the name of the database you want to change maxaccess is the maximum level at which a user can access the database. You can specify READ for read access or UPDATE for update access. Note: If you specify READ for the maxaccess parameter, all users are denied shared and exclusive access to the database.
November 2011
135
where: user is the name of the user whose access level you want to change usage is the level of access the user gets when logging in. You can specify READ for read access, SHARED for shared access, or EXCLUSIVE for exclusive access. Note: A user's default level of access is only used when logging in, and therefore applies to the user's default database only.
where: user is the name of the user whose access rights you want to change access is the read or update access key required by the database
where: access is the read or update access key required by the database you want to prevent a user from accessing user is the name of the user whose access rights you want to change
4.13.3
Dimension Level
4.13.3.1 Specifying the Dimension Members Available to Each User and User Group
Procedure
1. Access Application Server as a user with the same name as the database you want to modify. 2. Enter the following command to create a procedure named Security:
PROCEDURE Security
3. Use the INDEX USER command to specify the dimension members each user and user group can access.
136
November 2011
4. From the Procedure menu, choose Save. 5. From the Procedure menu, choose Exit. 6. Enter the following command to activate the dimension restrictions:
JOB Security
Note: The dimension restrictions do not take effect until a user detaches from and reattaches to the database. Logging out by typing Exit or choosing Exit from the File menu is not sufficient to detach the user; the user must enter an EXIT CLEAR or DETACH &USEDATABASE command.
Enter the PROCEDURE command following by the name of the procedure you want to edit or create. For example: If a procedure with this name already exists, it is copied into the editor. If it does not exist, the procedure editor window appears. You can create the procedure. Note: Set names can be 24 characters long and must begin with an alphabetic character. A set name cannot contain spaces unless it is enclosed in single quotation marks (' '). The editor has four menus: Use the Procedure menu to save your changes, quit the editor without saving changes, and so on. Use the Edit menu to cut, copy, and paste changes. Use the Search menu to find and replace text. Use the Fonts menu to select fixed or proportional fonts. Note: If you choose File Exit to quit the editor, the editor attempts to compile the set. However, certain procedures, such as those that contain control variables, or enter an Application Server subsystem, cannot be compiled. If you attempt to compile such procedures, or choose File Exit, you will receive an error; choose File Save and then File Abandon Changes instead.
4.14.2
JOB <set name> <set name> EXECUTE <set name>
Notes:
Running a Procedure
Use JOB <set name> when you are in test mode (debugging). JOB <set name> displays commands and subsequent reassurance or error messages, or both generated as each command is executed. If the procedure set does not run correctly, you can easily identify which command is causing the problem. Once a procedure set has been tested, enter the SET REASSURANCE OFF command and then use the <set name> or EXECUTE <set name> to suppress the display of the commands as they are entered. The SET long command uses variables and dimension labels rather than names.
November 2011
137
4.14.3
Procedure
Saving a Procedure
1. Choose Exit from the Procedure menu. The Confirm dialog box appears, prompting you to save your changes. 2. Click Yes to save your changes. The Application Server command window appears. Other options include: SAVE QUIT Saves the set and remains in the editor. Returns to the Application Server command window without saving changes. Prints the contents of the set. PRINT GO TIDY EXIT
Notes:
Saves the changes and executes the commands. Indents and capitalizes INPUT and OUTPUT statements for easy reading. Requests confirmation to save and compiles the set. See Note below.
If you choose quit instead of Exit, your changes are not saved and your procedure is not compiled. If you choose File Exit to quit the editor, the editor attempts to compile the set. However, certain procedures, such as those that contain control variables, or enter an Application Server subsystem, cannot be compiled. If you attempt to compile such procedures, or choose File Exit, you will receive an error; choose File Save and then File Abandon Changes instead.
138
November 2011
Procedure
1. Data from the source file is read into the Work database. As shown in the diagram, data in the source file is in record/field or row/column format, and data in the Work database is in a matrix format.
2. Data from the Work database is converted from the matrix format to the Application Server format, and saved in a temporary storage area in your Use database. Data is saved in the temporary storage area every 300 records, unless you specify another interval using READ SAVE integer. If you save data in the temporary storage area in your Use database, you need to have a Work database large enough to hold 300 records, or whatever integer you specify. 3. After all the data is converted and copied to the temporary storage area, it is permanently updated in your Use database. The temporary storage area allows data to be rolled back to the record you specify if there is a system failure. For example, if you specify 600 and there is a system failure while reading record 650, data is rolled back to record 600. You can restart the import process at record 601, instead of at record 1. If you specify READ UPDATE SAVE integer, data is permanently updated in your Use database at the same rate it is originally read from the source file.
November 2011
139
Application Server at the Command Level Frequently Asked Questions ((4 bytes * number of periods) + 32) * actual combinations * number of 4 byte variables Add these two numbers together to get a rough estimate of database size. Additional space will be required for the sets in your database (dimensions, procedures, reports, and so on) and for attribute variables, but this is small in comparison to the amount of space the timeseries data occupies.
Procedure
1. If the original data source is no longer available, select the dimension input members and use ACCESS EXTERNAL WRITE to create a text file of the non-consolidated timeseries data. 2. Delete all business measures and data on the database. 3. Issue the new SET FISCAL command. 4. Create the measures. 5. Load the data from source or from the file created using ACCESS EXTERNAL WRITE. Note: If you have a custom calendar set with the SET FISCAL USER STARTING .. ENDING command, you can re-run the procedure that defines the calendar when measures exist on the database. In this case, do not modify the existing ENDING dates in the procedure. You should only add more period end dates to the SET FISCAL USER STARTING .. ENDING command.
140
November 2011
4.16.5 How can I determine the .INI file Application Server is using?
The default .INI file used by Application Server is LSSERVER.INI. The base file name is the same as the executable. You can specify a different .INI file by using the -inifile switch. Examine the Properties of the icon you use to start Application Server. If an alternate .INI file is being used, it will be listed on the command line after LSSERVER.EXE. Application Server will look for this .INI file in the Windows directory unless a full path is specified.
4.16.6 Why won't my construct DESCRIPTION statement work for loading data?
The error message you are getting probably says something like, "There is no Corresponding Field for dimension." When you CONSTRUCT a dimension from an external file, the DESCRIPTION statement you use in ACCESS EXTERNAL names the fields so that they match the levels in your dimension. For example, your GEOGRAPHY dimension may have field names like CITY, STATE, REGION, COUNTRY. When you load data, however, you must name the fields in the external file so they match your dimension names. You really only need the input field when you load data, so you should change your DESCRIPTION statement for the data load and name the CITY field GEOGRAPHY. You can leave the other fields that are part of the GEOGRAPHY dimension as they are and Application Server will ignore them. Also, when you are constructing a dimension, you do not need a field for TIME. Your DESCRIPTION statement must account for TIME when loading data or, if the entire file represents a single time period, you must have TIME as your first DOWN dimension.
4.16.7 Where does the UNIX version put newly created databases?
The UNIX client/server version of Application Server creates files (databases, trace files, and so on) in the working directory on the server. When you connect to Application Server from a client PC, the working directory will be the HOME or login directory of the UNIX user ID you have in your .INI file. The filename will be in upper case letters. To force Application Server to create a database in a different directory, define an environment variable for that database in the client/server startup script, lsstcp.sh, before you issue the CREATE DATA command. Data files that you want to load into Application Server should be also located in the user HOME directory. By default, Application Server expects these load files to have upper case names. If the file name is in lower case, surround the name in single quotation marks (' ') when you reference it.
4.16.8 How can I remove data for some but not all of my observations?
You can remove data before or after a point in time by using the BEFORE or AFTER keyword on the REMOVE DATA command. For example, use the command below to remove Sales data for all months after March 98:
REMOVE DATA Sales AFTER Mar 98
You cannot use the keywords BEFORE and AFTER together to remove data in the middle of a date range. The only way to do this is to calculate null or missing values into the period or periods. To
November 2011
141
Application Server at the Command Level Frequently Asked Questions remove Sales data for March 98 when the measure contains values for January to December 98, issue the following command:
CALCULATE Sales = MISSING PER Mar 98 FULL
You can use a question mark (?) in place of the word MISSING. Be aware that this operation could take as long as a database consolidation.
4.16.9 How can I load data that has a comma for the decimal separator in numbers?
Application Server expects external data to have the decimal separator specified with the SET DEFAULT command. Using the SET VARIABLE command to change the separator on individual measures will not make a difference. The keyword used to set the decimal separator is POINT. To load data that has a comma for the decimal separator issue the following command prior to the data load:
SET DEFAULT POINT ,
4.16.10 How can I load data that has a field for year and a field for each month?
The table below presents sample data in the format described: REGION Boston Boston Boston San Diego PRODUCT P001 P002 P001 P1234 DATA Dollars Dollars Cases Cases YEAR 1998 1998 1998 1999 JAN 1234 3251 2143 1698 FEB 3214 6123 5124 3297
Use a WHERE clause on the SELECT to retrieve data a year at a time. Also, use aliases to rename the DATA and the JAN, FEB, ... fields so they are in the format required by Application Server. For example:
SELECT REGION, PRODUCT, DATA VARIABLES, JAN JAN98, FEB FEB98, MAR MAR98, , DEC DEC99 from <table> WHERE YEAR = "1999"
142
November 2011
5
5.1
Application Server provides several debugging commands to help you find and correct problems with the system, applications errors, bugs in Application Server, or client/server performance problems. Click an underlined topic for more information. top XRAY Determining buffer size Using KEY BOTH statement for a large dimension Other Debugging Commands
5.1.1
Top
Use the UNIX top command on an HP9000 system to view all the processes that are running, the loads on the machine, and machine statistics. Note: If you use the top command during a consolidation, and CPU processing is very active, this might be because you are not using the Rollup editor and are using an old method of consolidation.
5.1.2
XRAY
Use the XRAY command to perform an integrity check on an Application Server database. If you suspect that a database is corrupt, XRAY might be able to find the location of the corruption. A version of XRAY is provided on each Application Server platform. You must run the XRAY command on a server, not from your client machine.
Syntax XRAY database XRAY -t database XRAY -s database XRAY -f database Description Evaluates all the basic structures within the database and reports whether the database is corrupt. Provides a complete analysis of the database structure. Lists information about all internal sets in an Application Server database. Used as a diagnostic tool to determine the structure and content of a model. Reclaims lost space in an Application Server database.
Note: Running the XRAY command can take a significant amount of time, in some cases as long as a database consolidation.
5.1.3
The amount of memory used by Application Server is determined by the number of buffers it creates in memory, and the size of the buffers. Application Server creates the maximum number of buffers possible in the memory available to it, up to the value set for buffers. To optimize data load and consolidate performance, you should set buffers as high as possible, but at a level that ensures they are created in real memory rather than cache or swap memory.
November 2011
143
Administration and Configuration Debugging DEFAULTMEMORY is not set at startup, Application Server uses all available memory to create buffers. If Application Server runs out of real memory for creating buffers, it uses cache or swap memory, which is less efficient and should be avoided. When determining the available memory value, you should reserve enough real memory for the operating system and priority processes, while ensuring that Application Server has as much real memory available to it as possible. The maximum number of buffers that can be created in available memory is initially determined by the Buffers value on the Application Server user account. The default value of 2,000 is usually sufficient for query users. However, you can use the SET BUFFERS command to increase buffers for a specific process, such as a data load and consolidate. The SET BUFFERS command sets buffers for the current session only the next time the user logs in, the Buffers value on the user account is used.
144
November 2011
required. Therefore, you should accurately determinate the buffer size your database actually requires.
5.1.5
RETURN, ON ERROR
You can add the RETURN command to a procedure for debugging. The procedure stops when it reaches RETURN. You can use ON ERROR and then execute a RETURN so that when Application Server encounters an error, a specific procedure can be run.
SHOW EXACTLY WHERESearches a set and lists every line in a report, procedures, and logic that uses the specified word. When you rename a variable, all occurrences are automatically changed. BEGIN, END, & UNIX Core File You can use BEGIN and END to block off continuing commands and avoid the use of an ampersand (&). If an Application Server process running on a UNIX machine does not complete successfully, a core file may be created in your UNIX account's home directory. You can determine if any processes are still running by issuing the following command: ps -ef | grep lsstcp The following command stops leftover processes on most UNIX machines: kill "process_id"
In this command the ampersand (&) runs the batchlss.ksh script as a background process, and nohup ensures that batchlss.ksh is protected from hangups and terminations. Two example scripts for running a batch process are installed with Application Server. These are batchlss.ksh, for use with the Korn or Bourne shell, and batchlss.csh, for use with the C shell. These scripts define all the required environment variables for running Application Server and then execute Application Server with the following commands:
exec $LSSHOME/lss <batch1 >batch1.out 2>batch1.err
in batchlss.ksh, or:
$LSSHOME/lss <batch1 >batch1.out 2>batch1.err
in batchlss.csh. These statements define the file batch1 as the source of all input that a user would normally enter from a terminal. Output is written to the file batch1.out and errors are written to the file batch1.err. You can create multiple copies of the batch scripts to run different jobs.
November 2011
145
5.2
Database maximums Partition size # partitions Total database size Block size # blocks # observations # multiples # open Application Server databases # open files (Use the LSSFILES environment variable in LS.INI to change the maximum number of open files.) # chars in a database name (unless the database is partitioned)
96 bytes Note: For distributed databases, the string specifying the dimension name and the remote database name (for example, product;maindb) cannot exceed (maximum number
NA
146
November 2011
External source maximums # fields (columns) in a DESCRIPTION command (ACCESS EXTERNAL) # chars in a file name (full path) Line size of a text file to read in: Windows UNIX Line size of other file types Maximum number of open files (per CONFIG.SYS): Windows
Minimum 1
Maximum 2048
Default NA
NA
64
NA
NA NA
64K 64K
NA NA
Application Server accepts the limitations set by the database management system.
NA
255
NA
User maximums # chars in a user name Password Usage Work database blocks Work database blocksize # buffers # maxlogins User access key
Minimum 1
Default NA
NA 50 512 20 1
Minimum 3 3
Default NA NA
Maximum 12 dimensions, TIME, and VARIABLES You cannot have more than 22 unique dimensions that the variables in
Default NA
NA
November 2011
147
Administration and Configuration Maximums and Limits must be included in the view # members in a dimension # levels within a dimension # classes within a dimension # hierarchies in a dimension # chars in a member name # chars in a member label 1 1 0 1 1 1 the view are dimensioned by. unlimited 256 64K 256 96 bytes 250 (labels are truncated at 250 bytes) 255 100,000 NA NA 0 NA NA NA
0 0
0 0
Minimum 1 NA NA
Default NA NA NA
Variable maximums # variables # chars in a variable name # chars in a variable label # chars in a control variable # bytes in a virtual variable expression # chars in a text variable value # chars displayable in a text variable value # dimensions a variable can be dimensioned by maximum integer length Time-series combinations
Minimum 0 1 1 1 1 1 1
Default NA NA N/A NA NA NA NA
0 NA
Minimum 0 1
Default NA NA
148
November 2011
96 bytes
NA
Minimum NA
Default NA
User-Defined Hierarchy maximums # User-Defined Hierarchies per dimension # members per User-Defined Hierarchy
Minimum 0 1
Default NA NA
Minimum NA
Maximum 1,000
Default NA
5.2.2
Do one of the following:
By default, you can display up to 5,000 measures. If your users want to display more than 5,000 measures, follow the steps in this section to increase the limitations on measures.
When Application Server is installed on UNIX, add MAXSETS parameter as part of the Application Server start up (for example in lsstcp.sh) as follows: MAXSETS=x export MAXSETS When Application Server is installed on Windows, add MAXSETS to the lsserver.ini file as follows: [Windows] MAXSETS=x Where x is a number greater than the number of measures you currently have. The default setting is 5,000.
November 2011
149
Administration and Configuration Creating a Dump File with Multiple Partitions The following commands support binary set types: ASK COPY (including COPY to or from a LOCAL file) DIRECTORY EXHIBIT RECOVER REMOVE RENAME SHOW DUMP will copy binary sets to EXTERNAL files of the same name, and insert a COPY command into the DUMP file to copy them back to the database. The DUMP command will not compress binary sets. The following commands do not support binary set types: Editor PRINT SET TYPE
5.3
By default, one large dump file is created. It can exceed 2Gb up to 64-bit. If you do not want a database dump to exceed 2GB, you can split the dump across multiple files (partitions). To dump a database to multiple partitions, you specify a wildcard within the dump file name, for example DUMP??. You can also specify NOLARGEFILES to make sure that each partition is less than 2Gb. You can also specify the SIZES keyword to specify the exact sizes of each partition. Application Server replaces the wildcard characters with partition numbers, for example DUMP01, DUMP02, and so on. If you have chosen to store the data and database definition together, you should specify the wildcard within the <filename> parameter; if you have chosen to store the data and database definition separately, you should specify the wildcard within the <datafile> parameter. For example: DUMP dump?? SIZE 1G DUMP dump?? NOLARGEFILES DUMP maindump DATA dump?? SIZE 1G
150
November 2011
dump02=d:\db\dump02 dump03=e:\db\dump03
5.4
When Application Server is installed, it detects the language setting of your system and installs the appropriate language files. By default, Application Server uses the Regional Settings from the Windows Control Panel to define the language, decimal separator, thousands separators, and number of decimal places.
Overriding the default settings for thousands separator, decimal separator, and number of decimal places
The decimal separator, thousands separator, and number of decimal places are defined with the SET DEFAULT command. For example, you could enter SET DEFAULT DECIMALS 3 to display values with three decimal places. To revert to the Regional Settings in the Windows Control Panel, use the LOCALE keyword, for example SET DEFAULT DECIMALS LOCALE.
Overriding the thousands separator, decimal separator, and number of decimal places for a specific variable
You can override thousands separator, decimal separator, and number of decimal places for a specific variable by using the SET VARIABLE command. For example, you could enter SET VARIABLE Sales DECIMALS 0 to display Sales values with no decimal places. To revert to the Regional Settings in the Windows Control Panel, use the LOCALE keyword, for example SET VARIABLE Sales DECIMALS LOCALE.
November 2011
151
Use
ABS returns the absolute value of a variable or expression.
Syntax
CALCULATE <result> = ABS(<input>) Parameter <result> <input> Description Name of the result variable. You must enclose names with embedded spaces and names that contain special characters with single quotation marks (' '). Name of the variable or arithmetic expression whose absolute value you want calculated.
Example: ABS
...This example returns a value of 21: CALCULATE a = ABS(7*(-3))
6.2
Use
ACCESS DBASE
ACCESS DBASE starts the Access subsystem, enabling Application Server to read or write data to dBASEIII and IV files with a .DBF extension. Notes: The field name in the database field must match either the name of the dimension being read in with the READ or the name of the dimension level used in the CONSTRUCT command. All dimension information must be part of the file you are accessing. ACCESS DBASE does not support fields defined as float in DBF (dBASE). The data must be held in a field defined as numeric in the .DBF file. Use ACCESS LSLINK for this data type.
Syntax
ACCESS DBASE
152
November 2011
Example
...This example reads in data from DRINKS.DBF. (Do not specify the .DBF extension. When you use ... ACCESS DBASE, Application Server automatically looks for .DBF files.) Application Server uses ...this data to create the dimensions Product and Channel, and the variables Actsales and Budsales. ACCESS DBASE USE drinks CONSTRUCT product LEVEL product COMPILE dim product CONSTRUCT channel LEVEL channel COMPILE dim channel END CREATE VARIABLE actsales BY product, channel CREATE VARIABLE budsales BY product, channel SELECT VARIABLE actsales, budsales SELECT PRODUCT INPUT SELECT CHANNEL INPUT SET PERIOD Jan 95 - Jan 96 ACROSS variables DOWN product, channel, time ACCESS dbase USE drinks ...This line sets the field to match the dimension name CREATE time=date READ END
6.3
Use
ACCESS EXTERNAL
ACCESS EXTERNAL starts the Access subsystem, enabling Application Server to read or write data to text or binary files. It is possible to read and write files that exceed 2Gb. Note: To read from or write to external text or binary files, you have to specify the external file format using DESCRIPTION. Also, all dimension information must be part of the file you are accessing. Note: If you know that the external data is all uppercase and has no internal spaces in any dimension fields, then use the UPPERCASE and NOSPACE keywords on the type field of DESCRIPTION in ACCESS EXTERNAL to save CPU.
November 2011
153
Syntax
ACCESS EXTERNAL
Keywords
BEGIN-END CONSTRUCT CREATE DESCRIPTION END PEEK PROCEDURE READ RECONSTRUCT SHOW USE WRITE
Example 1
ACCESS External USE 'dim2.txt' BEGIN DESCRIPTION fixed 'SKU2' text 10 1 'Sku_desc' text 15 17 'Busprod' text 3 49 'Busprod_desc' text 30 54 'Prodfamily' text 3 74 'Prodfam_Desc' text 30 79 'Subfamily' text 3 109 'Subfam_Desc' text 30 114 END PEEK CREATE Business = substr(Busprod,1,1) CREATE Sku = Sku2 + Sku_desc CONSTRUCT SKUSRP level SKU2,Subfamily,Prodfamily,busprod,business labels ?,Subfam_desc,Prodfam_desc,busprod_desc,? repla calcu END
Example 2
...This example procedure produces a file called TEXT: SELECT PRODUCT SELECT REGION #1 SELECT SALES SET PERIOD 1/99
154
November 2011
ACROSS VARIABLE,TIME DOWN PRODUCT,REGION ACCESS EXTERNAL USE TEXT BEGIN DESCRIPTION FIXED PRODUCT TEXT 20 REGION TEXT 20 'SALES, Jan 99' NUMERIC 10.2 END WRITE OVERWRITE END ...The output of the file TEXT would look like this: Command Center LightShip TimeBase FCS Navigator Total Product North East North East North East North East North East North East 289.00 285.00 359.00 5.00 833.00 1771.00
...When you are in ACCESS EXTERNAL, you might want to write data out and control the decimal point ... in one of two ways. To print a number with an explicit decimal point, as in: 29.54 ...For example, to get a field ten characters wide with 2 decimal places and an explicit decimal point. SALES NUMERIC 10.2 ...To print that number out with two implied decimal places, as in: 2954 SALES NUMERIC 10(2) ...The parentheses indicate "implied" and must be present. ...When reading data, the same conventions apply. To read "2954" with two implied decimals, enter SALES NUMERIC 10(2)
6.4
Use
ACCESS LSLINK
ACCESS LSLINK starts the Access subsystem with an access link to data stored in relational databases on several platforms. ACCESS LSLINK is available upon installation and configuration of Link. You can access more than 15 data sources for data retrieval. Note: All dimension information must be part of the file you are accessing.
Syntax
ACCESS LSLINK Keywords BEGIN-END CONSTRUCT CREATE (Access) or TS CREATE
November 2011
155
Example 1
...Use ACCESS LSLINK to connect to a dBASE file, and then constructs and compiles a dimension. ... The first SELECT command selects the desired fields in the source file, and PEEK displays the first ... ten records. After you enter PEEK, enter SELECT again, because PEEK removes the selection. ...Use TS CREATE statements when the name of the external field in the .DBF file is different from the .. Application Server internal name. Application Server constructs .and then compiles the dimension. ACCESS LSLINK CONNECT dbase SELECT city, state_code, state, area from cities.dbf,states.dbf where cities.state_code = state.code PEEK ONLY 10 SELECT city, state_code, state, area from cities.dbf,states.dbf where cities.state_code = state.code TS CREATE stcode=state_code TS CREATE region=area PEEK CREATE ONLY 10 SELECT city, state_code, state, area from cities.dbf,states.dbf where cities.state_code = state.code CONSTRUCT location LEVEL city, state, region LABEL ?,stcode,? END COMPILE DIMENSION location
Example 2
...Read in a memo text file from a dBASE file using this format for the SQL SELECT statement: SELECT dimname, SUBSTR(textmemofield,1,200) textvariable FROM database.dbf ...Note: An Application Server text variable only holds 255 characters, so that is all ...that you can read from the dBASE memo text field.
6.5
Use
ACCUM( )
Syntax
CALCULATE <result> = ACCUM(<variable>, <periodicity>) Parameter <result> <variable> Description Name of the result variable. Can be a temporary variable. Name of the variable whose values you want to accumulate. You must enclose names with embedded spaces and names that contain special characters with single quotation marks (' ').
156
November 2011
<periodicity>
Accumulates values at one of the following frequencies: yearly, quarterly, monthly, lunar, bimonthly, weekly, biweekly, daily, or hourly.
Notes: ACCUM only works with the periodicities listed above, as these work on the SET PERIOD range. Periodicities that work on SET LATEST (such as rolling periodicities) do not work with ACCUM. Do not use Accum() or any other time function in the definition of a virtual variable. An error would result if you display that virtual variable in the DOWN and a timeset in the ACROSS because there is no periodicity until a LIST or DISPLAY is executed.
Example
...Consider this statement: CALCULATE Totalsales = ACCUM(Sales, quarterly) ...The following quarterly values yield Totalsales as shown: 1990 Sales Totalsales 13 13 10 23 9 32 15 47 2000 14 14 10 24
6.6
Use
ACROSS/DOWN
Use ACROSS/DOWN to define how data is viewed, imported, or exported. The ACROSS/DOWN command is updated to include attributes in a view.
Syntax
ACROSS {[<dimensions> ] [ <attributes> ] | NOTHING} DOWN {[ <dimensions> ] [<attributes> ] | NOTHING} {SWITCH} Parameter ACROSS DOWN Description Displays the specified dimensions and attributes across the top of each page. Displays the specified dimensions and attributes down the side of each page. The last down dimension or attribute appears as a line item on a page. All other down dimensions are page breaks. One or more dimension names, separated by commas. One or more attribute names, separated by commas. Switches the across and down view. Lists all dimensions, attributes, and variables in one direction, skipping the direction that contains the NOTHING keyword. Dimensions, attributes, and variables display either all across the page or all down the page. Use NOTHING when you are reading in data from an external file formatted so that each column represents one dimension and the data exists in one data column (third normal form). You must name the data column in the external file VALUE. The ACCESS EXTERNAL DESCRIPTION statement must specify the VALUE field.
Example 1
...This example displays combinations of the dimensions Region and Time as columns across the top ... of each page, and rows of Variables for each Product down the side: SELECT Region east, west SELECT cogs, sales
November 2011
157
PRODUCT Processor Chip Cost of Sales Sales PRODUCT Color Monitors Cost of Sales Sales
Example 2
...This ACROSS NOTHING DOWN command displays all dimensions and variables down the page: SELECT Product Processor Chips SELECT Region East, West SELECT cogs, sales SELECT Type Actual ACROSS NOTHING DOWN Product, Region, Variables LIST yearly PERIOD 2000 ...The output of this command would be: PRODUCT Processor Chips REGION East 2000 Cost of Sales Sales 92,702,386 129,452,856
PRODUCT Processor Chips REGION West 2000 Cost of Sales Sales 123,073,628 172,020,562
...This ACROSS NOTHING DOWN command is used to read data from an external file that is ...formatted similarly to the one below, where each column represents a dimension and the data is ...contained in a data column: Region Boston New York Product 80386 80386 Time Jan 00 Jan 00 Variable SALES SALES Value 200 200 ...
...The data column in the external file must be named VALUE and the ACCESS EXTERNAL ...DESCRIPTION statement must specify the VALUE field: SELECT Product
158
November 2011
SELECT Region SELECT VARIABLES SET PERIOD 2000 ACROSS NOTHING DOWN Product, Region, Variables, Time ACCESS EXTERNAL USE sourcefile BEGIN DESCRIPTION statement END READ END
Example 3
...This example switches the ACROSS and DOWN display from ACROSS Region, Time DOWN ...Product, Variables, to ACROSS PRODUCT, Variables DOWN Region, Time: ACROSS SWITCH LIST yearly ...The output of this command would be: Processor Chip Color Monitors Cost of Sales REGION East 1999 2000 REGION West 1999 2000 Sales Cost of Sales Sales
6.7
Use
ACRSLIH( )
Syntax
CALCULATE <depreciation> = ACRSLIH(<asset>, <term>, <start>, <tax_month>, <method>) Parameter <depreciation> <asset> <term> <start> <tax_month> <method> Description Name of the result variable with the calculated time-series depreciation. Asset scalar value. Number of years of asset life. Asset start date. Month of the year (1 to 12) in which the tax year begins. Depreciation method, where: 0 = ACRS 1 = Straight line
November 2011
159
6.8
Use
ACRSPP( )
Syntax
CALCULATE <depreciation> = ACRSPP(<asset>, <term>, <start>) Parameter <depreciation> <asset> <term> <start> Description Name of the result variable with the calculated time-series depreciation. Asset scalar value. Number of years of asset life. Asset start date.
6.9
Use
ACRSRP( )
Syntax
CALCULATE <depreciation> = ACRSRP(<asset>, <term>, <start>, <tax_month>, <method>, <domestic>) Parameter <depreciation> <asset> <term> <start> <tax_month> <method> Description Name of the result variable with the calculated time-series depreciation. Asset scalar value. Number of years of asset life. Asset start date. Month of the year (1 to 12) in which the tax year begins. Depreciation method, where: 0 = ACRS 1 = Straight line <domestic> Location of the property, where: 0 = U.S. 1 = Outside the U.S.
Syntax
ADD ACCESS <key> USER <user> Parameter ACCESS <key> USER <user> Description Specifies the access key to add. The <key> parameter can contain up to 16 alphanumeric characters. Specifies the user ID to which the access key is added. The <user> parameter must begin with an alphabetic character; the remaining 23 available characters can be alphanumeric.
160
November 2011
Remarks
The access mode available to the user (either READ or UPDATE) is defined in the database.
Syntax
ADD DATABASE <database> [MAXACCESS UPDATE | READ] [PROTECTION <key>] Parameter DATABASE <database> Description Creates a database record in MASTERDB for an existing Application Server database (and its partitions). This might be a database created on another system, or a database you defined in a different MASTERDB. The <database> parameter specifies the name of the database to add.
MAXACCESS UPDATE | READ Specifies the maximum level of access permitted for the database. You can specify UPDATE or READ access. PROTECTION <key> Indicates the database had a protection key in the system where it was created and adds the specified protection key to the new database record in MASTERDB, where <key> is the name of the protection key. This does not add the protection key to MASTERDB itself.
Remarks
You should copy the Application Server database (and any partitions) to your system before you use ADD DATABASE. Otherwise, Application Server accepts the database name but marks the database as offline. The database must have the same file name on your system as the name specified in the ADD DATABASE command. You only need to use ADD DATABASE to add the main database file; any partitions are added automatically. Note: If you are trying to load a dump of MASTERDB that was dumped prior to version 9.3 of Application Server and contains information about partitioned APPLICATION SERVER databases, the dump file will be unloadable. You must edit the dump file to remove the PARTITION and NAME clauses from the ADD DATABASE commands, and then you will be able to load the pre-9.3 version of MASTERDB. For help doing this contact Customer Support.
Example
This example adds the Juice database to MASTERDB. SUPERVISOR ADD DATABASE Juice
November 2011
161
Syntax
ADD USER <user> TO <user_defined_hierarchy> Parameter USER <user> Description One or more user names, separated by a comma, that you want to add to the User-Defined Hierarchy. The user names you specify must already exist in MASTERDB. An asterisk (*) adds all users to the specified User-Defined Hierarchy.
TO <user_defined_hierarchy> Specifies the name of the User-Defined Hierarchy to which you want to add users.
Remarks
Once you add users to a User-Defined Hierarchy, you can reference that User-Defined Hierarchy in an INDEX USER-CASE-ENDINDEX statement in a Security procedure. In this procedure, you specify the restricted dimension view for this User-Defined Hierarchy of users.
6.13 ALL-ENDALL
Use
ALL-ENDALL performs calculations at the output levels of dimensions. Note: CALCULATE FULL has the same effect as ALL-ENDALL.
Syntax
ALL . . <logic statements> . ENDALL
Example
... Calculates profit for all input member combinations. Values for Profit are consolidated ... (rather than calculated) for output member combinations. Then, because of the ALL-ENDALL block ..., Application Server calculates the Profit Ratio rather than consolidates for all member combinations. Profit = Sales - Expenses ALL
162
November 2011
Syntax
ALLOCATE [UPDATE] <input>, <output>, <result> Parameter UPDATE <input> <output> <result> Description Indicates that Application Server can automatically add input members to the dimension when data is loaded. Maximum number of input members. Maximum number of output members. Must be 1 or 0.
Example 1
...The dimension Product is defined with a maximum of 100 inputs, 10 outputs, and 1 result: ALLOCATE 100, 10, 1
Example 2
...Inputs, outputs, or results can be specified if they are known. For example, the result of the previous ... example is Total_Product, and two known products are Cars and Trucks. You enter this as: ALLOCATE 100, 10, 1 INPUT Cars, Trucks RESULT Total_Product
6.15 ANALYZE
Use
ANALYZE displays statistics for members of the last down dimension, based on values represented by the across dimension. ANALYZE uses the data specified by previous SELECT and
November 2011
163
Application Server Command Reference ANALYZE: Analytics Options ACROSS/DOWN statements. Application Server groups output according to the down list and analyze according to the across list.
Syntax
ANALYZE [<option>, ..., <option>] [NOHEADING] [TABOUTPUT] [<periodicity>] [<period>] Parameter <option> Description Can be any of the following: Analytics options Statistical options Forecasting options Smoothing options Regression option NOHEADING TABOUTPUT <periodicity> The output has no headings. Tabs delimit columns. Analyzes data at one of the following periodicities: yearly, ytd, ryearly, semiannually, quarterly, qtd, rquarterly, monthly, mtd, mytd, avgytd, rmonthly, lunar, bimonthly, weekly, wtd, biweekly, daily, or hourly. Used to specify one of the following periods: yty - The latest period back to the equivalent period one year ago. yrago - The latest period one year ago. current - The period set with a SET LATEST command. previous - The previous period. latest - The period set with a SET LATEST command. FITTED - Option that you can apply to the Forecasting and Smoothing options.
<period>
Note: The ANALYZE command uses the default options CASES, DEVIATION, MAXIMUM, MEAN, and MINIMUM if you do not specify any options.
Example: ANALYZE
...Calculate the total, minimum, maximum over time of each product for variables Price, Units, Revenue ACROSS Time DOWN Product, Variables SELECT Price, Units, Revenue ANALYZE TOTALS, MINIMUM, MAXIMUM
Syntax
ANALYZE [<option>, ..., <option>] [<format_option>] [<periodicity>] Parameter AUTOCORRELATION CORRELATE Description A study of coefficients that helps determine any pattern in a time series. Linear correlation matrix for the values of a series of variables. Correlation analysis provides a measure of the degree to which variables are linearly related,
164
November 2011
and an index designed to give an immediate picture of how closely two variables move together. DURBIN ERROR KURTOSIS SKEWNESS SPEARMAN THIEL TTEST Durbin-Watson statistic and autocorrelation coefficient indicates whether values in the row are serially correlated. Standard error of the mean, assuming the variable is a sample of a large population. Steepness or flatness of the distribution of values in the variable. Degree of asymmetry of values in the row around the mean. The Spearman Rank Correlation Coefficient tests for a trend or systematic increase or decrease in a time series. Comparison between an actual series of data and a predicted or fitted series. Comparison between two groups of data to determine whether the data comes from the same population, or a comparison between a set of data and a predetermined value for significant differences in the data. For example: ANALYZE TTEST [<Double constant against which to compare>] [<format_option>] [<periodicity>] VARIANCE Relative dispersion of all values in the variable; the coefficient of variation.
18 Feb 98 25 Feb 98 04 Mar 98 11 Mar 98 18 Mar 98 25 Mar 98 SPEAR 49.0000 0.0000 8.0000 2.0000 34.0000 20.0000
01 Apr 98 08 Apr 98 15 Apr 98 22 Apr 98 29 Apr 98 06 May 98 SPEAR 0.0000 3.0000 3.0000 71.0000 4.0000 0.0000
13 May 98 20 May 98 27 May 98 03 Jun 98 10 Jun 98 17 Jun 98 SPEAR 0.0000 3.0000 25.0000 0.0000 22.0000 0.0000
1 Page of Data Listed ANALYZE SPEARMAN 07 Jan 98 - 15 Jul 98 SPEAR Spearman Test 0.3342 1.8078 1.7089 = Rank Correlation Coefficient = T Statistic = T95%
November 2011
165
Syntax
ANALYZE [<option>, ..., <option>] [<<periods_to_forecast>>] [FITTED] [<format_option>] [<periodicity>] [<period>] Parameter Global options FITTED Description You can use these with the Forecasting options: NOHEADING, TABOUTPUT, <periodicity>, and <period>. Displays the generated data by fitting the historical data to the chosen curve. The default is not to display the fitted data. The default for the <periods to forecast> option is 5. EXPONENTIAL GEOMETRIC HYPERBOLIC LINEAR MODHYPERBOLIC QUADRATIC RATIONAL Transformation of curves to a linear form. Forecasts based on historical data fit to a geometric curve. Forecasts based on historical data fit to a hyperbolic curve. Forecasts based on historical data fit to a linear curve. The STRAIGHT LINE curve y = a + bx is the curve normally used for forecasting. Forecasts based on historical data fit to a modhyperbolic curve. Least-squares principle applied to quadratic curves that cannot be transformed directly into a linear equivalent. Rational curve fit to historical data.
Example
This example shows the information displayed when you run the ANALYZE LINEAR command with the Linear dimension for the time frame January 2000 to October 2000: SELECT linear 1 Variable Currently Selected SET PERIOD jan00-oct00 LIST Jan 00 LINEAR 0.2030
166
November 2011
LINEAR Linear Forecast Observation 1 2 3 4 5 Forecast 0.2784 0.2856 0.2927 0.2999 0.3071
Syntax
ANALYZE REGRESSION [<format_option>] [<periodicity>] [<period>] Parameter Global options Description You can use these options with the regression options: NOHEADING, TABOUTPUT, <periodicity>, and <period>.
Example
This ANALYZE REGRESSION example analyzes the regression of the fixed cost, variable cost, number of machines, and R. M. Grade dimensions for the time frame January 1997, to May 1998: SET PERIOD jan99-may00 SELECT fixed_cost, variable_cost, no_machines, r_m_grade 4 Variables Currently Selected SET default decimal 4 LIST
Feb 99
Mar 99
Apr 99
May 99
3,067.0000 2,828.0000 2,891.0000 2,994.0000 3,082.0000 7,107.0000 6,373.0000 6,796.0000 9,208.0000 14,792.0000 21.0000 129.0000 22.0000 141.0000 22.0000 153.0000 20.0000 166.0000 25.0000 193.0000
Jul 99
Aug 99
Sep 99
Oct 99
VARIABLE COST 14,562.0000 11,964.0000 13,526.0000 12,656.0000 14,119.0000 NO MACHINES 23.0000 20.0000 23.0000 20.0000 20.0000
November 2011
167
Application Server Command Reference ANALYZE: Regression Option R M GRADE 189.0000 175.0000 186.0000 198.0000 187.0000
Dec 99
Jan 00
Feb 00
Mar 008
VARIABLE COST 16,691.0000 14,571.0000 13,619.0000 14,575.0000 14,565.0000 NO MACHINES R M GRADE 22.0000 195.0000 19.0000 206.0000 22.0000 198.0000 22.0000 192.0000 21.0000 191.0000
May 00
4,488.0000 3,259.0000
VARIABLE COST 18,573.0000 15,618.0000 NO MACHINES R M GRADE 21.0000 200.0000 22.0000 200.0000
Jan 99 - May 00 Cases FIXED_COST 17 Minimum Maximum Mean Std Dev 428.867044 Total 55,127.0000
6,373.0000 18,573.0000 12,900.8824 3,526.992414 219,315.0000 19.0000 129.0000 25.0000 206.0000 21.4706 182.2941 1.462773 22.264784 365.0000 3,099.0000
ANALYZE REGRESSION
Multiple correlation coefficient(R) Coefficient of determination (R^2) Standard error of estimate F - Value 7.5430
X-Variable 1 2
168
November 2011
-2.7715
7.4448
Analysis of Variance
Degrees of Freedom 3 13 16
Sum of squares
Mean square
Table of Residuals
Observation 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Y-Value 3,067.0000 2,828.0000 2,891.0000 2,994.0000 3,082.0000 2,898.0000 3,502.0000 3,060.0000 3,211.0000 3,286.0000 3,542.0000 3,125.0000 3,022.0000 2,922.0000 3,950.0000 4,488.0000 3,259.0000
Y-Estimate 3,272.8885 2,763.6594 2,598.2295 3,036.6281 2,969.1158 3,245.0400 3,386.3179 3,105.6831 3,046.1750 3,557.3538 3,653.8621 3,372.1572 2,995.1811 3,304.6997 3,442.4259 4,035.3346 3,342.2483
Residual -205.8885 64.3406 292.7705 -42.6281 112.8842 -347.0400 115.6821 -45.6831 164.8250 -271.3538 -111.8621 -247.1572 26.8189 -382.6997 507.5741 452.6654 -83.2483
% -6.2907 2.3281 11.2681 -1.4038 3.8019 -10.6945 3.4162 -1.4710 5.4109 -7.6280 -3.0615 -7.3294 0.8954 -11.5805 14.7447 11.2175 -2.4908
2.1583
November 2011
169
Syntax
ANALYZE [<option>, ..., <option>] [<<periods_to_forecast>>] [FITTED] [<format_option>] [<periodicity>] [<period>] Parameter Global options FITTED Description You can use these options with the Smoothing options: NOHEADING, TABOUTPUT, <periodicity>, and <period>. Displays the generated data by fitting the historical data to the smoothed data. The default is not to display the fitted data. The default for the [<periods to forecast>] option is 5. ADAPTIVERESPONSE A smoothing procedure similar to SINGLEEXPONENTIAL except that the smoothing constant is calculated as a function of the data and previous errors. ADAPTIVERESPONSE is better than SINGLEEXPONENTIAL for forecasting from a series without a trend because ADAPTIVERESPONSE is responsive to changes in the pattern of the data.
DOUBLEEXPONENTIAL Performs two weighted-averaging calculations using the results from the previous calculation as input for the next calculation. Use DOUBLEEXPONENTIAL smoothing where there is a linear trend. MOVINGAVERAGE A linear data smoother. The average of n adjacent observations replaces each observation. Moving averages of a data series reduce the amount of variation in the data. For a time series, moving averages are often used to eliminate unwanted fluctuations, for example to smooth the data series. You can remove cyclical, seasonal, and irregular patterns and leave only the trend. A quadratic equation is calculated to fit a curve to the averaged data. Use this equation to reconstruct smoothed data at the ends of the series. Note: You must specify two parameters. For example: ANALYZE MOVINGAVERAGE 5 4 FITTED SINGLEEXPONTENTIAL A weighted-averaging technique where the weights decrease with the age of the data. Use SINGLEEXPONENTIAL where there is no trend. TRIPLEEXPONENTIAL Performs three weighted-averaging calculations using the results from the previous calculation as input for the next calculation. Use TRIPLEEXPONENTIAL smoothing where there is a non-linear trend. A weighted-averaging calculation that incorporates a linear trend and a seasonal factor. Use WINTERS for forecasting where seasonality and trend are suspected in the data. For example: ANALYZE WINTERS <Random Constant> <Seasonal Constant> <Trend Constant> <obs per cycle> [FITTED] [<periodicity>]
WINTERS
Note: Exponential smoothing is not the best forecasting method if the series is fairly smooth (that is, if there are not positive and negative deviations from the trend).
Example
This example runs the ANALYZE MOVINGAVERAGES command to forecast the variable Wage for the next five months using the last five periods to average. The command uses the Wage dimension for the time frame January 1998 to October 1998.
170
November 2011
SELECT wage 1 Variable Currently Selected SET PERIOD jan98-oct98 LIST Jan 98 WAGE 7800.0000 Jul 98 WAGE 7800.0000 Feb 98 7850.0000 Aug 98 7855.0000 Mar 98 7955.0000 Sep 98 7900.0000 Apr 98 7800.0000 Oct 98 7855.0000 May 98 7775.0000 Jun 98 7805.0000
1 Page of Data Listed ANALYZE MOVINGAVERAGE 5 4 FITTED Jan 98 - Oct 98 WAGE Moving Average Forecast
Observation Jan 98 Feb 98 Mar 98 Apr 98 May 98 Jun 98 Jul 98 Aug 98 Sep 98 Oct 98
Fitted Value 7891.7857 7863.5000 7836.0000 7837.0000 7827.0000 7807.0000 7827.0000 7843.0000 7860.5000 7887.9286
Observation 1 2 3 4
Syntax
ANALYZE [<option>, ..., <option>] [<format_option>] [<periodicity>] [<period>]
November 2011
171
<period>
DIVNA 16.0000 14.0000 14.0000 15.0000 16.0000 17.0000 DIVNB 18.0000 14.0000 15.0000 16.0000 16.0000 16.0000 1 Page of Data Listed ANALYZE MEAN MEDIAN MODE SKEWNESS TOTAL Jan 99 - Dec 99 Mean Median Mode Skewness Total 92.0000 95.0000
DIVNA 15.3333 15.5000 14.0000 0.041703 DIVNB 15.8333 16.0000 16.0000 0.244476
6.21 ASK
Use
ASK creates dialog boxes that prompt users for information. ASK can also set control variables and validate user responses automatically.
172
November 2011
Note: Because ASK commands are usually long, you should include them in a procedure enclosed in a BEGIN-END block. You can specify one or more options within a single ASK command (see Example 3). Note: This command is provided for backward compatibility only, and is likely to be removed in a future release.
Syntax
ASK [GLOBAL <global_options> [<global_options>]*] [TITLE <text>] [ALIGN [CENTER | RIGHT] ENDALIGN] [PAD <n>] [SPACING <n>] [SKIP [<n>] ] [KEY [<key_options>] ]* [TEXT <text> [<field_options>] ]* [BUTTON [<field_options>] ]* [NAME [<name_options>] ]*
Global options
The global options describe the default dialog box and dialog element characteristics that apply when it generates.
NOBORDER RESTART <procedure> WIDTH [FULL | <n>] Specifies that the dialog box should not include a border. Specifies a default procedure to execute when a user selects a button or key. Specifies the width of the dialog - either full screen, or an integer, <n>. Specifies the dialog colors, where <color> can be one of: blue, green, red, orange, yellow, white, black, brown, cyan, turquoise, purple, violet, magenta, pink, gray, or grey. FONTHEIGHT <n> Specifies a default font size, <n>. Specifies the position of the dialog. Where MIDDLE, BOTTOM or <row> can be used for vertical positioning, and LEFT, CENTER, RIGHT or <col> can be used for horizontal positioning. ORIGIN [TOP | BOTTOM | LEFT | RIGHT | TOP,MIDDLE | CENTER] <row>, <col>
General options
TITLE '<title>' Defines the dialog title. Aligns dialog elements. PAD <n> SPACING <n> SKIP <n> Pads <n> spaces before and after text. Inserts <n> spaces between buttons. Skips <n> lines before dialog elements. ALIGN [CENTER | RIGHT] ENDALIGN
November 2011
173
[BUTTON <prompt> [<field_option>]* [ASK | <commands>] [<field_option>]* ['+' <command> ] ] Specifies a button dialog element, where:
<prompt> <command> Specifies the caption to appear on the button. Specifies command or button information.
[NAME <control_variable> [PROMPT <text> [OPTIONAL] [HIDE] [NOPROMPT] [ONE] [MANY] [<validation>] ]* [ASK | <commands>] [<field_option>]* ] ] Specifies a input field dialog element, where:
<control_variable> PROMPT '<text>' OPTIONAL HIDE NOPROMPT ONE MANY <validation> Is the name of a control variable in which to store the user response. Specifies a label for the input field. Indicates that no response is required. Indicates that the user response is hidden. Used with a validation clause. Bypasses the display of the dialog, and goes straight to the validation option list for user input. Indicates that the user can only enter a single value. Indicates that the user can enter a list of values. Specifies the validation options. For more information, see the Validation Options section later in this topic.
Field options
Field options specify dialog element characteristics. They can be one or more of the following:
ORIGIN <row>, <column> Places the origin, or upper left corner, of a dialog element at the specified <row> and <column>. BACKGROUND <color> | FOREGROUND <color> | <color> [ON <color>] Specifies the dialog element color, where <color> can be: blue, green, red, orange, yellow, white, black, brown, cyan, turquoise, purple, violet, magenta, pink, gray, or grey. WIDTH <n> FONTHEIGHT <n> RESTART <procedure> NORESTART QUIT Specifies the dialog element width, where n is an integer. Specifies a font size of the dialog element, <n>. Specifies a <procedure> to execute on activation of the dialog element. Cancels the global restart procedure for the specified dialog element. Exits from the ASK procedure.
Validation options
Validation options describe valid user responses. They also define popup windows with selections the user can access by entering a blank or a question mark (?). Validation options can be one or more of the following:
FROM <list> [HIDE] [SUPPRESS] A list of possible responses, enclosed in single quotation marks (' ') if they do not comply with rules for Application Server variable names. For example: FROM Tom, Dick, Harry, '123'. HIDE indicates that the user response does not appear on the screen. SUPPRESS prevents the list of available options from appearing on the screen. HIDE and SUPPRESS are useful for passwords. <periodicity> PERIOD <daterange> A standard periodicity, for example, MONTH PERIOD 97-99. VARIABLE Specifies an existing variable. MEMBER | SELECTED | INPUT | LEVEL <n> ] <dimension>
174
November 2011
Specifies an existing dimension. For example: ASK NAME TEST MEMBER PRODUCT lists members of the PRODUCT dimension ASK NAME TEST LEVEL <n> PRODUCT lists members of the PRODUCT dimension at level <n> ASK NAME TEST INPUT PRODUCT lists the input members of the PRODUCT dimension ASK NAME TEST OUTPUT lists the output members of the PRODUCT dimension. TIME | LOGIC | REPORT | PROCEDURE | RECORD | DOCUMENT | SYNONYM | PORTFOLIO | MULTIMEDIA | LIGHTSHIP | AUDIO | VIDEO | BINARY | DIMENSION Specifies the name of a set, for example, a logic or dimension set.
Example 1
...This procedure contains an ASK command that prompts the user for a variable ...name and then executes a SHOW VARIABLES command using that response. ...Application Server performs validation to ensure that a valid variable name is entered, ...and will provide a list box of choices if a blank field is entered: CLEAR Varname BEGIN ASK TITLE 'Example 1' NAME Varname PROMPT 'Enter variable name:' VARIABLE 'SHOW VARIABLES &Varname' END
Example 2
...The following procedure, REPDEMO, defines three buttons that the user can click to obtain one of ... three reports. The user can use an additional button to exit after Application Server ...executes the desired reports: BEGIN ASK TITLE 'Example 2' GLOBAL RESTART RepDemo BUTTON 'Sales Report' 'SalesRep' + 'Expense Report' 'ExpRep' + 'Variance Report' 'VarRep' + EXIT NORESTART END ...The plus sign (+) causes buttons to appear across the page. You do not need to repeat the BUTTON
November 2011
175
Example 3
...This procedure defines a pop-up dialog box that is called from Mainmenu. The dialog box displays ... three fields that prompt you to select variables, a dimension, and a time ...period. If you enter a question mark or a space in a field, a list of items to choose from appears. After ... you select a dimension, another dialog box appears, prompting you to select its members. When all ... the fields are defined, the system returns to Main menu: Clear Varname, Dimname, Memnames, Pername BEGIN ASK GLOBAL red ON white NOBORDER RESTART Mainmenu NAME Varname PROMPT 'Enter variables: ' VARIABLE 'SELECT VARIABLE \&Varname' NAME Dimname PROMPT 'Enter dimension: ' DIMENSION ASK TITLE 'Member Selection' NAME Memnames PROMPT 'Enter members: ' MEMBER &Dimname 'SELECT \&Dimname \&Memnames' ENDASK NAME Pername PROMPT 'Enter period: ' MONTH PERIOD 96-LATEST 'SELECT PERIOD \&Pername' END
176
November 2011
A backslash (\) delays the resolution of a control variable. In the SELECT command in Example #3, the control variables are evaluated when the commands are executed, not when the ASK command is read. In addition to creating text for control variables in ASK windows, it is useful to create, display, and clear control variables outside of the ASK window. The commands that allow you to perform these operations are:
SET CONTROL name []text [] SHOW CONTROL [pattern] CLEAR <name> [, ..., <name>]
6.22 ATTACH
Use
ATTACH attaches a database in a specified order.
Syntax
ATTACH <database> [FIRST | LAST] [EXCLUSIVE | SHARED | READ] Parameter <database> FIRST LAST EXCLUSIVE SHARED Description Name of the database to attach. Attaches the database as the first database. This is the same as entering the command USE <database> RETAIN. Attaches the database as the last database (the default). Indicates that only you can read and update the database (the default). Indicates that all users can read and update the database. Users can update sets within the database, but they cannot change the structure of the database or data within it. Indicates that all users can read the database, but cannot update it.
READ
Example:
...This example attaches the Juice database: ATTACH Juice
6.23 ATTRIBUTE
Use
ATTRIBUTE opens the Attribute editor. You use an attribute set to view, create, or edit attributes for a dimension. Entering a CONSTRUCT ATTRIBUTE command constructs an attribute and automatically creates an attribute set. You can also manually create the attribute set by following the syntax described here.
Syntax
ATTRIBUTE <setname> BY <dimension> [RESULT] [LEVEL] [LABEL "<label>"] [CUSTOM <number>] VARIABLE <attribute> <member> ['<label>' ] ,<member> ['<label>']
November 2011
177
178
November 2011
,Green ,Mauve
Application Server displays the attribute sets. Optionally, you can enter SHOW ATTRIBUTE. 2. Go to the attribute set:
ATTRIBUTE <setname>
3. Check the structure. Multiple VARIABLE statements mean that this attribute set has multiple attribute dimensions and was constructed from one source file. If the attribute information was in separate source files, you will have separate attribute sets.
BY <dimension> VARIABLE <field> <member> '<label>' , ... ,<member> '<label>' VARIABLE <field> ,<member>, ... CLASS <name> <member>, <member>, ...
where <dimension> is the name of the entity dimension this attribute is associated with. where <field> is the name of the attribute. Application Server derives them from the source column name. where <members> are the attribute members. Application Server derives them from the values in the source column. where <labels> are the attribute member labels. They are optional. Application Server derives these labels from the values in the source column. If your label contains single (' ') or double (" ") quotation marks, you need to encapsulate the member label in a different quoting character. For example: "Don't try this at home".
November 2011
179
6.24 BEGIN-END
Use
With BEGIN-END you can spread long commands over several lines in a procedure. When Application Server finds BEGIN, it treats successive lines as part of one command until it finds END, at which point Application Server executes the command.
Syntax
BEGIN . . <long Application Server command> . END
6.25 BYPERIOD-ENDBYPERIOD
Use
BYPERIOD-ENDBYPERIOD forces all enclosed statements to execute for period 1 before moving to period 2. Application Server executes all statements for period 2 before moving to period 3, and so on. Note: You cannot nest BYPERIOD-ENDBYPERIOD statements.
Syntax
BYPERIOD . . <logic_statements> . ENDBYPERIOD
Example
...This user-defined function calculates Net Terminal Value (NTV). Application Server computes a ...new value of NTV for each period, based on the previous value of NTV, and then inputs Forecast ...and Rate. Without BYPERIOD-ENDBYPERIOD, Application Server would add NTV to forecast [1] for ... all periods, multiply that result by rate [1] for all periods, and then store the results in NTV. INPUT Forecast, Rate RESULT SCALAR NTV NTV = 0 BYPERIOD NTV = Rate[-1] * (NTV + Forecast[-1]) ENDBYPERIOD NTV = NTV + VALUE(Forecast, NCASES())
6.26 CALCULATE
Use
CALCULATE evaluates an expression and assigns the result to a variable, or evaluates a group of expressions in a logic set and makes multiple assignments. In either case, CALCULATE creates new variables from existing ones.
180
November 2011
Syntax
CALCULATE { <variable> = <expression> [FULL] [TRACE [<n>]] [DATA] [GROUP | NOGROUP] [ RESOLVE ] [SPARSITY] | <logic> [<periodicity>] [PERIOD <daterange>] [FULL] [TRACE [<n>]] [DATA] [ RESOLVE ] | <variable> = <expression> [FULL] [TRACE [<n>]] [DATA] [ RESOLVE ] [ FASTMODE | SPARSITY <n> ] } Parameter <variable> <expression> <logic> Description Name of the result variable. Variable names that use special characters should be in single quotation marks (' '). Arithmetic expression or an integer. Name of a logic set containing one or more expressions. If you do not specify a name, Application Server uses the default logic set (if defined). Otherwise, it uses the last logic set edited. Performs the calculation at one of the following periodicities: yearly, semiannually, quarterly, monthly, lunar, bimonthly, weekly, biweekly, daily, or hourly. Limits the calculation to a specified date range. A range of dates separated by a dash (-). Calculates the logic set at all levels in a dimension. Displays the names of the dimension member combinations for which variables are being calculated. Displays the name of every <n>th dimension member combination calculated. The default, 1, displays the name of every dimension member combination calculated. If you are calculating data into an output level, DATA marks the data as read-in data instead of calculated data. During consolidation, Application Server treats calculated data differently from read-in data. If you mark the calculated data as DATA, Application Server does not overlay values in the output level in quadrants specified with CHANGE UPDATE NOOVERWRITE. Note: The DATA keyword applies only when new output series are created. For any existing output series which are modified by the CALCULATE, the DATA keyword is not applied. For example, say you are projecting this year's budget data into next year, modified by some percentage. This would require a calculation in which budget data is entered at a consolidated level. If you will not be allocating this calculated data down to a lower level, you must tell Application Server to treat it as read-in data. You would enter a CALCULATE DATA command to have Application Server treat the calculated data as read-in data. If you allocate the budget data down to the detail level, do not use DATA since Application Server should treat the data as calculated data. During consolidation, Application Server would add the data correctly. <VARIABLE> GROUP Calculates all selected variables. Attempts to partition the output series better during a calculation. Time-series are clustered by quadrant in the Application Server database. All series for quadrant N go into the same database block. There is no mixing of series from different quadrants in the same database block. The larger the calculation, the more effective this is. If you do not specify the GROUP or NOGROUP keyword, then GROUP is used by default. Does not cluster time-series by quadrant in the Application Server database during a calculation. If you specify this parameter, the procedure or logic automatically recompiles before execution. This ensures that the current values of control variables in the set are used.
DATA
NOGROUP RESOLVE
November 2011
181
Examples
...This example creates the variable Sales_Revenue, which has the dimensions, periodicity, ...and date range indicated by the variables Price and Number_of_Cases. Number_of_Cases ...is dimensioned by Product and Region, and Price is dimensioned by Product. Therefore, ...Sales_Revenue is dimensioned by Product and Region: CALCULATE Sales_Revenue = Price * Number_of_Cases ...This example shows a conditional calculation. The revenue expression varies based on ...the volume, taking into account discounts: BEGIN CALCULATE Sales_Revenue IF Number_of_Cases LT 1000 = Price * Number_of_Cases OTHERWISE = 0.9 * Price * Number_of_Cases END ...Set a time period and calculates daily results according to the logic set FLOW: CALCULATE flow PERIOD 00/1 daily ...See how Application Server assigns values to several variables in one statement: CALCULATE x=1 y=2 z=3 ...This example sets all selected variables equal to 4: CALCULATE <VARIABLE> = 4 ...This example calculates sales data as read-in data at the output level: ROLLUP Sales ADD EVERYBODY CHANGE 5 UPDATE CONSOLIDATE Product, Region END SELECT Sales SELECT Product OUTPUT SELECT Region OUTPUT SELECT Manufacturer INPUT SET PERIOD 1/00 CALCULATE Sales = 4 FULL DATA
182
November 2011
Syntax
CHANGE DATABASE <database> [ EXHIBIT | NOEXHIBIT ] [ ADD <num> PARTITIONS [SIZES <sizes>] [PREFORMAT] ] [ PROTECTION <key> ] [ READ <read> ] [ UPDATE <update> ] [ DISPOSITION {OFFLINE | ENABLED | DISABLED} ] [ MAXACCESS { READ | UPDATE } ] [ USAGE [EXCLUSIVE | READ | SHARED] [RETAIN] ] [ VARIABLES <var> ] Parameter <database> EXHIBIT NOEXHIBIT Description The name of the database to change. Specifies that the database details will always be displayed by the EXHIBIT DATABASES command. This is the default value. Specifies that the database details will only be displayed by the EXHIBIT DATABASES command if you use the command with the HIDDEN keyword.
ADD <num> PARTITIONS The number of partitions to add to the database. See Creating a database with multiple partitions for more information. SIZES <sizes> One or more numbers that identify the size of each new partition in blocks. You must separate each size with a comma. You can specify <sizes> as the number of blocks (for example, 20,000), as a multiple of 1,000 with a K suffix (for example, 20K), or as a multiple of 1,000,000 with an M suffix (for example, 1M). By default, Application Server divides the partition sizes evenly based on the number of blocks. If you specify fewer sizes than the number of partitions, Application Server divides the remaining blocks equally among the remaining partitions. If you increase the partitions to a size greater than the database, you should extend the database. You cannot change the size of an existing partition. Application Server writes to all the blocks in the partition to ensure that the space is preallocated. A protection key, where <key> is an alphanumeric name up to 16 characters. One or more read access keys separated a comma. Each read access key is an alphanumeric name up to 16 characters. You can set both a READ key and an UPDATE key on a database. Use the Supervisor REMOVE command to remove a read or update access key. One or more update access keys separated a comma. Each update access key is an alphanumeric name up to 16 characters. Specifies the disposition of the database. You can specify OFFLINE, ENABLED, or DISABLED. Specifies the maximum access level at which users can attach to the database. You can specify READ for read access or UPDATE for update access. Indicates the access mode when a user enters a USE or ATTACH command without specifying a usage parameter. You can specify READ for read access, SHARED for shared access, or EXCLUSIVE for exclusive access (the default). In addition, you can specify the RETAIN keyword to keep the current database attached. VARIABLES <var> The maximum number of variables the database can contain. The default value is 1,000, and the maximum is 10,000.
November 2011
183
Example 1
...This example changes the definition of the database BUDGET: CHANGE DATABASE budget MAXACCESS READ
Example 2
...The ACCNT database already has three partitions. The following command adds two partitions. One ... is 40,000 blocks long, and the other is 20,000 blocks long. Because the partitions are larger than ... the number of blocks specified for the database, Application Server extends the database. DETACH Accnt CHANGE DATABASE Accnt ADD 2 PARTITIONS SIZES 40K, 20K ...The output of this command would be: Warning: The Number of Blocks Specified in the PARTITION SIZES (120000) for Database ACCNT is Larger than the BLOCKS specified. Database: ACCNT Maxaccess: UPDATE Disposition: ENABLED Current State: AVAILABLE Protection Key: None Last user: Last access:
Blksize: 8192 Observations 500 Maxblocks: 60000 Number Free: 59990 Database ACCNT Partition Information. Number of Partitions: Blocksize: 8192 Thu Feb 9 15:34:10 1999 Thu Feb 9 15:34:10 1999 5
Date Last Opened for Update: Date Last Closed After Update: Partition 1 2 3 4 5 USE Accnt EXTEND Accnt 60000 Size Name 20000 ACCNT01 20000 ACCNT02 20000 ACCNT03 40000 ACCNT04 20000 ACCNT05
Syntax
CHANGE USER <user> [ USEDB <usedb> ] [ USAGE [EXCLUSIVE | SHARED | READ] ]
184
November 2011
[ WORKDB <workdb> ] [ BLOCKS <blocks> ] [ BLKSIZE <blksize> ] [ BUFFERS <buffers> ] [ SECURITY [0 | 99] ] [ LOGIN [ON | ENABLED | DISABLED | PAUSED] ] [ EXPIRATION <date> ] [ PASSWORD <password> ] [ MAXLOGIN <lognum> ] [ ACCESS <key> ] Parameter <user> USEDB <usedb> Description The name of the user record to change. Specifies the database the user is attached to after logging in. If you omit this parameter, Application Server attempts to attach the user to a database with the same name as the user name. Specifies the mode in which the default database is opened. You can specify READ for read access, SHARED for shared access, or EXCLUSIVE for exclusive access. This setting is used when logging in. WORKDB <workdb> Specifies the file name Application Server should use to create the Work database. You can specify an alphanumeric name of up to eight characters. Do not include a path; Application Server creates all Work databases in the home directory. The default is DB<nnnn>. The user has read and update access to this database. The number of blocks that should be allocated to the Work database. The minimum is 2000 blocks and the default is 2000 blocks. The size of blocks in the Work database in bytes. You can specify 512, 1K, 2K, 4K, 8K, or 16K. The default is 8K. The number of buffers to use. The minimum is 20 and the default is 2000. The library database for the user. You can specify an alphanumeric name up to 16 characters. The default is TBDB. The user's security level. Specify 0 for a normal user or 99 for a user with Supervisor privileges. The default is 0. Specifies the state of the user's login. Specify ON, ENABLED, DISABLED, or PAUSED. EXPIRATION <date> The date on which the user's account expires. After this date, the user will be unable to access Application Server.
BLOCKS <blocks> BLKSIZE <blksize> BUFFERS <buffers> LIBRARY <libdb> SECURITY [0|99]
PASSWORD <password> The user's password. Specify an alphanumeric name with up to 12 characters. The first character must be alphabetic, not numeric. MAXLOGIN <lognum> The number of times the user can log in to Application Server concurrently. Specify a number between 1 and 32,000. The default is 255. You might want to allow a user multiple logins when many users within a User-Defined Hierarchy or department will use the same login ID to access Application Server. Specifies an access key that is required to access a database in either read or update mode.
ACCESS <key>
Example
...This example changes the record for user Fin2: CHANGE USER Fin2 SECURITY 99
November 2011
185
6.29 CHECKPOINT
Use
CHECKPOINT defines how and when to update a database.
Syntax
CHECKPOINT { [BACKUP] [FREEZE [CONTINUE] [NOBACKUP]] [SHOW] [SYNCHRONIZE [0|1]] [UPDATE [<n>]] [WORKDB <n>] } Parameter BACKUP Description Restores the database to the state it was in when you entered the last CHECKPOINT FREEZE command, or to the state it was in when Application Server last automatically updated it according to the value of <n> in CHECKPOINT UPDATE <n>. Updates the database to its present state and then suppresses automatic updating of the database after every command, even when the Use database is in READ mode. Application Server does not update the database, data, and sets again until you issue CHECKPOINT UPDATE. Keeps you in CHECKPOINT FREEZE mode automatically after an error occurs. Application Server rolls back your database to the point it was at when you entered the original CHECKPOINT FREEZE CONTINUE command, but you do not have to re-enter the command to stay in CHECKPOINT FREEZE mode. You remain in that mode until you enter a CHECKPOINT BACKUP or a CHECKPOINT UPDATE command. Keeps you in CHECKPOINT FREEZE mode automatically after an error occurs, but, unlike the CONTINUE keyword, does not roll back your database. You remain in CHECKPOINT FREEZE mode until you enter a CHECKPOINT BACKUP or a CHECKPOINT UPDATE command. Outputs a line of four values. The first is the current CHECKPOINT FREEZE status, where 0 means that it is not in a CHECKPOINT FREEZE and 1 means that it is in a CHECKPOINT FREEZE. The second value represents the value specified in a CHECKPOINT UPDATE. The third value represents the value specified in a CHECKPOINT SYNCHRONIZE. The last value represents the value specified in a CHECKPOINT WORKDB. Enables "soft" writes to the work database. By default, Application Server performs soft writes to the work database. If you are already using checkpoint effectively in applications, this feature may not result in a performance gain. If you are not yet using checkpoint, CHECKPOINT SYNCHRONIZE could reduce enduser response time by up to 30%. Enables automatic updating of the database and, if CHECKPOINT FREEZE is in effect, brings the database to its current state. If n > 1, Application Server updates the database after the successful completion of every <n> commands. Otherwise, it updates the database after the successful completion of every command. Controls the number of commands that Application Server waits before it flushes its buffers to the work database. <N> represents the number of commands. The default value is 1.
FREEZE
CONTINUE
NOBACKUP
SHOW
SYCHRONIZE [0 | 1]
UPDATE <n>
WORKDB <n>
Example: CHECKPOINT
...In this example, the database has three logic sets: PROFIT, REVENUE, and SALES. CHECKPOINT ... FREEZE is entered and the database is not automatically updated. REMOVE removes the logic set
186
November 2011
... PROFIT from the database. CHECKPOINT BACKUP then restores the database to its state during the ... initial FREEZE. PROFIT appears in the directory list. CHECKPOINT FREEZE DIRECTORY LOGIC LOGICS PROFIT REVENUE SALES REMOVE LOGIC profit DIRECTORY LOGIC LOGICS REVENUE SALES CHECKPOINT BACKUP DIRECTORY LOGIC LOGICS PROFIT REVENUE SALES
Syntax
CLASS <class> <member> [,... <member>] Parameter <class> <member> Description Name of the class up to 24 alphanumeric characters. Name of a previously defined member. You can use an asterisk (*) in a member name as a wildcard that indicates that any character can occupy that position or any of the remaining positions.
Example
...Consider the following statements defined in a Dimension editor: INPUT Coca_Cola, Diet_Cola, Cherry_Coke, Orange_Fanta, Sprite CLASS Cola Coca_Cola, Diet_Cola, Cherry_Coke ...This statement selects a class: SELECT Product Cola ...This statement uses a class in a logic statement: WHEN Product IS Cola ...These statements define a new dimension member to be the sum of an existing class:
November 2011
187
6.31 CHG( )
Use
CHG returns the absolute differences between the current period and the same period a specified interval (for example, a year or month ago).
Syntax
CALCULATE <result> = CHG(<variable> [, <period>]) Parameter <result> <variable> <period> Description Name of the result variable. Name of the variable to evaluate. Variable names that use special characters should be in single quotation marks (' '). Period in which to evaluate: year (default), quarter, month, or week.
Syntax
CLEAN WORK DATABASES [TRACE] [PREVIEW] [<pattern>] Parameter TRACE PREVIEW <pattern> Description Specifies that you want to output trace information listing each database that is removed. Specifies that you want to preview a list of databases that will be removed without actually removing them. A standard pattern with or without wildcards to remove only databases that match this pattern, for example, DB*.
Examples:
Supervisor> clean work preview DB* DB40510 DB40575 Supervisor> clean work trace *75* DB40575 Supervisor> clean work preview DB* DB40510
188
November 2011
6.33 CLEAR
Use
The CLEAR command clears User-Defined Hierarchies from a dimension. You can also use the CLEAR command to remove control variables.
Notes:
When you clear a dimension's User-Defined Hierarchies, Application Server selects all of the dimension's members. If this User-Defined Hierarchy has been saved using the SAVE CUSTOM command that includes the PUBLIC or PRIVATE keywords, then the compiled dimension set for this User-Defined Hierarchy remains saved in the CGLIB database and will be restored again during the next RESTORE CUSTOM command. If you want to completely remove the User-Defined Hierarchy from your database, including the compiled dimension set, then use the REMOVE CUSTOM command instead.
Syntax
CLEAR {<dimension> [USING [<owner>].<setname>} {<dimension> <user_defined_hierarchy> [,<user_defined_hierarchy>,]} {CUSTOM <dimension> [,<dimension>,]} {<control_variable>} Parameter <dimension> Description Name of the dimension whose User-Defined Hierarchies you want to clear. If you use CLEAR <dimension> without specifying any other keywords, then all the User-Defined Hierarchies for that dimension will be cleared except those created using SAVE CUSTOM PUBLIC or SAVE CUSTOM PRIVATE. Clears User-Defined Hierarchies from a dimension that has the PUBLIC or PRIVATE keywords applied in a SAVE CUSTOM command. Name of the owner of this User-Defined Hierarchy. If you omit the owner name, the current Application Server user is used. Only the administrator or owner of a User-Defined Hierarchy can clear a User-Defined Hierarchy. Name of the procedure set to clear, that was created during the SAVE CUSTOM command that included a PRIVATE or PUBLIC keyword. This clears all the UserDefined Hierarchies for the dimension.
USING <owner>
<setname>
<user_defined_hierarchy> Name of the User-Defined Hierarchy you want to clear from the session. Specify more than one User-Defined Hierarchy, separated by commas, to clear multiple User-Defined Hierarchies. <control_variable> Name(s) of control variable(s) you want to remove. To indicate more than one control variable, separate them with commas: CLEAR variable1,variable2
Examples:
...This example removes two control variables, Logset and Dimset: CLEAR Logset, Dimset ...This example removes all control variables: CLEAR * ...This example clears all User-Defined Hierarchies from the Product dimension: CLEAR product ...This example clears the Monitor User-Defined Hierarchies from the Product dimension: CLEAR product monitor
November 2011
189
Syntax
CLEAR STATUS
VARIABLES 2 Cost of Sales, Sales Periodicity MO Period 1995/1/2 - 1995/12/31 Earliest 04 Jan 95 (MO) Latest 30 Oct 95 (MO) Attached Databases: DEMO User: ADMIN 445 Fiscal Year Starts in January, Weeks Begin Monday ...This example shows the output when the status is cleared using the ...CLEAR STATUS command, and the STATUS command is entered. CLEAR STATUS STATUS ...The output of this command would be: Earliest 04 Jan 95 (MO) Latest 30 Oct 96 (MO) Attached Databases: DEMO User: ADMIN 445 Fiscal Year Starts in January, Weeks Begin Monday
190
November 2011
Syntax
COLHEADING . . <column heading specifications> . ENDCOLHEADING
Example
...In this block, the across dimension is Country: COLHEADING TEXT OVER 2 "United", OVER 3 "United" TEXT OVER 2 "Kingdom", OVER 3 "States" TEXT OVER 2 "=======", OVER 3 "======" ENDCOLHEADING ...Application Server will produce the following column headings: United Kingdom ======= United States ======
6.36 COMPILE
Use
COMPILE compiles a set or an attribute set. Generally, when you exit from a set editor, Application Server automatically compiles the set. You must compile a set at the following times: When you construct a dimension or attribute from the ACCESS subsystem. (If you construct a dimension or attribute in the Set editor, Application Server automatically compiles it when you exit from the editor.) When you copy a file from an external source into an Application Server set. When you recover a set using the RECOVER command.
November 2011
191
Application Server Command Reference COMPILE ATTRIBUTE Automatic multiple counting corrections can only be performed on measures where a smart fast consolidate can be used (i.e., all of the dimensions have either simple additive or subtractive consolidations) i.e. the measure can be used with the ROLLUP editor. Automatic multiple counting corrections will not be performed on a measure if: Any of its dimensions have non additive calculations The measure is an INTEGRAL measure The user uses the NOCORRECTIONS keyword on COMPILE DIMENSION. This turns off the automatic multiple counting corrections for that dimension. All aggregations of a member that cause multiple counting must be of the same sign i.e. all additive or all subtractive. For example: System> COMPILE DIMENSION product 1 Member Rolls Into Multiple Outputs All 6 Members of PRODUCT;MC3 Selected Dimension PRODUCT contains both positive and negative sums. Compiler could not check for multiple counting Note: If you have created an attribute with hierarchies and you are issuing the COMPILE DIMENSION command to compile the hierarchical attribute, the system checks for multiple counting issues in the hierarchical attribute dimension just like it does for standard dimensions. At run time, any dynamic aggregations performed will automatically adjust the aggregations to correct any multiple counting issues in an regular dimensions or hierarchical attribute dimensions in the view. For information, see Multiple Counting in Dimensions.
Syntax
COMPILE <settype> <setname> [NOCORRECTIONS] Parameter <settype> <setname> Description Type of set: dimension, attribute, logic, procedure, report, synonym, or time. Name of the set to compile.
NOCORRECTIONS
When compiling a dimension, this setting specifies that the system should perform multiple counting. Application Server will not search for multiple counting issues and all subsequent aggregations performed on those dimensions are aggregated exactly as defined in the hierarchy with no corrections.
Syntax
COMPILE ATTRIBUTE <name> Parameter <name> Description The name of the attribute set.
192
November 2011
Example
...Copy an external file extrep into a report set in the DEMO database and then compiles the report set: COPY Report Extrep;EXTERNAL Newrep;DEMO COMPILE newrep ...Construct a dimension in the ACCESS subsystem, exit from ACCESS, and compile the dimension: ACCESS EXTERNAL USE sourcefile BEGIN DESCRIPTION statements END BEGIN CONSTRUCT statement END COMPILE DIMENSION Product ...This example compiles the Product attribute: COMPILE ATTRIBUTE Product
Example
...This example compiles the Product attribute: COMPILE ATTRIBUTE Product
6.38 CONSOLIDATE
Use
CONSOLIDATE consolidates variables. When you compile a dimension, the system automatically searches for multiple counting issues that arise if the dimension members have multiple parents. During aggregation, the system corrects multiple counting issues by creating adjustments to eliminate them. The adjustments are used during a CONSOLIDATE or any dynamic runtime consolidations. No data values are changed until a CONSOLIDATE command is issued to reconsolidate data. For information, see Multiple Counting in Dimensions.
November 2011
193
Syntax
CONSOLIDATE [<logic> | <report> | <variables> [GROUP | NOGROUP] ] [PERIOD <daterange>] Parameter <logic> <report> <variables> Description Name of a logic set whose variables you want to consolidate. Name of a report whose variables you want to consolidate. One or more variable names separated by commas. If you do not specify a variable name, Application Server consolidates the currently selected variables. Variable names that use special characters should be in single quotation marks (' '). Attempts to partition the output series better during a consolidation. Time-series are clustered by quadrant in the Application Server database. All series for quadrant N go into the same database block. There is no mixing of series from different quadrants in the same database block. The larger the consolidation, the more effective this is. If you do not specify the GROUP or NOGROUP keyword, then GROUP is used by default. Does not cluster time-series by quadrant in the Application Server database during a consolidation. Consolidates data within the specified date range. A range of dates separated by a dash (-).
GROUP
Examples
...This example consolidates the variables Sales and Expenses: CONSOLIDATE Sales, Expenses ...This example consolidates all variables used in the report BUDREP: CONSOLIDATE budrep
194
November 2011
LSS CREATE customer = account_co LSS CREATE time = SUBSTR(date,1,2) + "/" + SUBSTR(date,3,2) SELECT * FROM transact READ ADD END ...Consolidate SELECT Product SELECT Customer SELECT var BY product, customer ROLLUP sales ADD EVERYBODY END CONSOLIDATE
The best way to load two or more years of data, is to load all the data at one time. In this way Application Server puts all the data into contiguous space. This speeds up the load times and keeps the space considerations down.
Use the CONSTRUCT ATTRIBUTE command to construct attributes without hierarchies. If you have, or want to create hierarchical attributes associated with a dimension, you must construct a separate dimension for each attribute using a separate CONSTRUCT command. When constructing a dimension, if a member is referenced in the input file more than once, the label that is eventually used for that member is the last label encountered in the input file. You can use the OVERWRITE keyword to rebuild an existing dimension based on the information in the external data source. Consolidation rules will be rewritten and members that are no longer part of the external source will be deleted from the dimension. Use of the OVERWRITE keyword generally requires a reconsolidation of the model.
November 2011
195
CUSTOM <number>
196
November 2011
LEVEL <field>
Specifies the data source fields to use when building the levels of the dimension or the levels in a dimension's hierarchy. You must separate all fields with commas. Each field represents a level. Field values are the members of the dimension. You can specify up to 20 levels in a dimension. You define the lowest level first. The first field you specify contains the lowest level of data, the input members. The next field you specify contains the next higher level of data, the output members. The next field contains the next higher level, and so on. Notes: The field's values become member names when constructed; member names can be up to 24 alphanumeric characters. You specify a LEVEL statement once in a CONSTRUCT command.
LABEL <field>
Specifies the external source fields containing the labels for the members of the corresponding attribute. You must separate all field names with a comma. Use a question mark (?) instead of a field name if no label exists for a particular attribute. Note: Labels can be up to 250 alphanumeric characters. Note: The label field cannot contain labels that begin with an asterisk and then a blank space. Labels can begin with other characters though. For example, the field cannot use a label * Massachusetts but it can use the label ~ Massachusetts.
If an attribute containing a hierarchy is associated with this dimension, <attributeset> specifies the name of the attribute. Name of an existing dimension that the hierarchical attribute will be associated with. Disallows multiple parents and can be used when you want to be alerted that your data contains relationships defining multiple parents. SINGLE generates an error message and stops the procedure from completing as soon as it detects a record which will cause a member to have multiple parents. Application Server does not read the data file. Creates an index based on the dimension member names and labels. Keying a dimension allows quick selection of its members when selected by a member name or label. Defines the maximum number of input and output members in a dimension. If you later add members to the dimension, the database is not reorganized. Specifies a number between 1 and 32,768 for the size of the array you want to fetch from the RDBMS during the construct process. If you do not specify an array size, rows are fetched in batches of 100. Note: Some drivers do not support array fetching, such as the Microsoft ODBC driver for MS Access. In those cases, the array size will have a value of 1, and Link will only run single row fetches. Note: If you do not specify the ARRAYSIZE keyword on the command line or you do not add an ARRAYSIZE=n parameter in the [linkid] section of the LSDAL.INI file, the default array size value is 100. If you add the ARRAYSIZE parameter to LSDAL.INI, that value will be used instead of the default value. If you use the ARRAYSIZE keyword on the CONSTRUCT command, the CONSTRUCT ARRAYSIZE command will override all default values and ARRAYSIZE parameter settings in LSDAL.INI. Tip: The best array size may be different on different systems and networks, so you should experiment with array size numbers until you find the optimal value.
REPLACE CALCULATIONS Replaces the consolidation rules with new ones derived from the external file. By default, Application Server preserves any consolidation relationships that exist in the dimension and adds new rules based on the external file. Omitting the
November 2011
197
REPLACE CLASSES
SINGLE
APEX
Syntax
CONSTRUCT ATTRIBUTE <setname> BY <dimension> [VARIABLES <field> [,...<field> ]] [LABEL <field> [,...<field> ] ] [CLASS <field> [MEMBER <field> ] ] [HIERARCHY<hierarchy_name> [,..., <hierarchy_name>]] [PREFACE "<keyword_string> [LEVEL [NAME '<level_name>' ] [<keyword_string> ] " ]
198
November 2011
Parameter <setname>
Description Name of the attribute set to create. You might want to use the same name as the dimension that this attribute will be associated with. If the attribute set will contain only one attribute, you might want to name the set the same name as the attribute. Name of the dimension that the attributes will be associated with. Note: You can construct multiple attribute sets referring to the same dimension. When constructing a simple attribute, <field> specifies the data source fields to use when building the attributes. You must separate all fields with commas. The field is the attribute name, such as size or color. Note: The field's values become attribute member names when constructed; member names can be up to 24 alphanumeric characters.
LABEL <field>
Specifies the external source fields containing the labels for the members of the corresponding attribute. You must separate all field names with a comma. Use a question mark (?) instead of a field name if no label exists for a particular attribute. Note: Labels can be up to 250 alphanumeric characters. Identifies the fields to use when building the classes in the dimension, where <field> is the name of the external source field containing the class name(s). You can specify up to five CLASS clauses. Identifies a field, other than the input member field, to use when building classes in the dimension, where <field> is the name of the external source field containing the members of a class. If you do not specify a field, Application Server uses the members in the first level (input members). When constructing a hierarchical attribute, <hierarchy_name> is the name of the dimension created by the CONSTRUCT <hierarchy_name> command that contains an attribute's hierarchies. If you construct multiple hierarchical attributes, specify each one separated by a comma.
CLASS <field>
MEMBER <field>
HIERARCHY <hierarchy_name>
PREFACE "<keyword_string>" Prefaces the resultant attribute set with the specified keyword(s). You must enclose the keyword string in quotation marks (' '). This option allows you to put anything in an attribute set. For example: CONSTRUCT ATTRIBUTE COLOR BY PRODUCT VARIABLE COLOR PREFACE "RESULT LEVEL" constructs an attribute set containing the RESULT LEVEL keyword. LEVEL Specifies a level name for the input level of the attribute so that the input level name is different from the attribute name. Use LEVEL NAME '<level_name>' when an attribute has the same name as one of its members and you want to avoid problems with duplication of names. If the attribute is named differently from its members, you do not have to use the LEVEL NAME '<level_name>' keyword. NAME '<level_name>' Specifies a name for the input level of the attribute. By adding a level name in situations where the attribute shares the same name as one of its members, you prevent duplicate dimension or attribute level or class names. You will get an error message if there is any conflict between a level name or class name and a member name or if a level name is duplicated in a multiple hierarchy dimension. <keyword_string> Allows you to add keywords to the LEVEL keyword. You must enclose the keyword string in quotation marks (' '). This option allows you to put anything in an attribute set.
Example 1: CONSTRUCT
...Create a dimension, Stores, containing three hierarchies, States, Regions, and Ownership:
November 2011
199
Example 2
...This procedure creates a hierarchy: PROCEDURE setname ACCESS subsystem ...statement(s) to select/describe the source CONSTRUCT hierarchy_name1 LEVEL field, field LABEL field, field PREFACE "BY dimension" CONSTRUCT hierarchy_name2 LEVEL field, field, field LABEL field, ?, ? PREFACE "BY dimension" END COMPILE DIMENSION ...Sample resulting set of <hierarchy_name1>: BY dimension INPUT 'member' ,'member ...' OUTPUT 'member' ,'member'...
200
November 2011
Example 3
...This example adds the By Product "Custom n" to attributes on construct: CONSTRUCT attribute_set PREFACE "Custom 2"
November 2011
201
The following is an example of the dimension set for the Region dimension. Application Server consolidates two input members into a Result member.
INPUT COLA ,SPRITZ RESULT TOTAL_DRINKS 'TOTAL DRINKS' LEVEL DRINKS TOTAL_DRINKS = INPUTS
The following is an example of the dimension set for the Region dimension. Application Server consolidates two input members into an output level. Application Server consolidates the output level into a result.
INPUT PHOENIX ,BOSTON OUTPUT AZ ,MA RESULT TOTAL_REGION 'TOTAL REGION' LEVEL CITY ,STATE AZ = PHOENIX MA = BOSTON TOTAL_REGION = SUM AZ, MA
202
November 2011
CONSTRUCT ATTRIBUTE attset BY drinks VARIABLE pkg_type HIERARCHY size END COMPILE ATTRIBUTE attset
The following is an example of the attribute set, attset. It shows that Application Server has constructed two attributes: the simple attribute Pkg_type and the hierarchical attribute Size.
ATTRIBUTE attset BY DRINKS VARIABLE PKG_TYPE BOTTLE ,CAN VARIABLE SIZE HIERARCHY
6.41 COPY
Use
You use COPY to copy sets into, out of, or within Application Server databases (EXTERNAL) or client (local) files. You can also use this command to copy from EXTERNAL to EXTERNAL.
Syntax
COPY [<settype>] <fromset>[;<database>] <toset>[;<database>] [OVERWRITE] [RESOLVE] COPY [<settype>] <fromset>;[LOCAL|EXTERNAL] <toset>[;<database>] [OVERWRITE] [RESOLVE] COPY [<settype>] <fromset>;[LOCAL|EXTERNAL] <toset>;[LOCAL|EXTERNAL] [OVERWRITE] [RESOLVE] COPY [<settype>] <fromset>[;<database>] <toset>;[LOCAL|EXTERNAL] [OVERWRITE] [RESOLVE] COPY [<settype>] TERMINAL <toset>[;<database>] Parameter <settype> Description Type of set: dimension, document, logic set, procedure, report, synonym, time, or binary set types. If you do not specify a set type, Application Server will copy the first set it finds with the specified name.
November 2011
203
Examples: COPY
...Copy the dimension Product to the dimension Prod within the current Use database: COPY dimension Product Prod ...This example copies the logic set Cashflow in the Bank database to the logic set cashflow in the ... Corp database. Both Corp and Bank must be attached. COPY logic cashflow;bank cashflow;corp ...This example copies the procedure Setqtr to the external file Setupq: COPY procedure setqtr setupq;EXTERNAL ...Copy the local DOS or Windows file c:\lsserver\myfile to a UNIX path /lsserver/MYFILE: COPY procedure 'c:\lsserver\myfile' /lsserver/MYFILE COPY procedure 'c:\lsserver\myfile' ;local /lsserver/MYFILE;external ...This example displays the settype Proc and copies it to the procedure ...Document, when it is part of a procedure and executed with the JOB command: COPY procedure TERMINAL document
204
November 2011
Notes:
Virtual measures do not support periodicity-based conditions, for example, WHEN YEAR IS XXX. Virtual variables calculated with time based functions like LAG, LEAD, MOVING, MOVING2, and PERCHG should be used with caution. These measures can be displayed with Application Server's standard and to-date time periodicities but errors will result when a time set is used in place of time.
'<label>'
BY <dimensions>
November 2011
205
SUM
WEIGHTED <weighted_variable>
MIN
206
November 2011
file. The variables will be created according to the SET SPARSE setting when the dump file is loaded. DENSE Indicates the variable is dense. Note: SPARSE is a better method for creating measures when databases are removed, recreated and populated from scratch each time and no additional data for extra periods is added to the series in that database. DENSE may be a better method for creating measures when additional data for extra periods is added because DENSE measures honor the MULTIPLES keyword, while SPARSE ones do not. This allows extra space in series to house the extra periods. INTEGRAL Indicates that Application Server stores data as integers instead of double precision. 1, 2, or 4 bytes per value are used instead of 8. The following values will be accepted into integral variables: integral bytes 1 stores data between 0 and 254 integral bytes 2 stores data between 0 and 32,766 integral bytes 4 stores data between 0 and 2,147,483,647 BYTES <n> Number of bytes to use per data value. <n> can be 1, 2, or 4 with INTEGRAL, or 4 without it (single precision). The default number of bytes per data value is 8 (double precision), which allows 15 digits of precision. Single precision allows six digits of precision. Thus, a million dollar sales figure can be in error by as much as 10 dollars. You can reduce database size by specifying single precision for variables that do not require accuracy to the penny. Indicates the variable contains characters. If you do not specify another periodicity, the default periodicity for text variables is constant. The maximum number of characters for any value in a text variable is 255. Note: Although a variables value may contain up to 255 characters, the SET VARIABLE WIDTH, SET DEFAULT WIDTH, and SET-WIDTH-ENDSET commands in the Report editor allow you to specify a width up to 50 characters. EXPENSE Specifies that the variable as an expense variable. This enables you to use commands such as WHEN <variable> IS EXPENSE.
TEXT
DESCRIPTION <description> Literal text that is displayed next to the variable when you enter SHOW VARIABLES. <expression> Specifies the expression to use to calculate the normal virtual variable. You can specify any expression, for example CREATE MARGIN AS Sales-Costs, except one containing time calculations. Expressions cannot be longer than 999 bytes long. LOGIC <logic> COUNT OF variable Specifies a logic to use to calculate the virtual variable. Creates a virtual variable that is the count of the number of individual time series that make up a particular view.
DISTINCT COUNT BY <dimension> [,<dimension>] OF <variable> Creates a virtual variable that is a distinct count of the number of individual time series for that dimension. Note: Alternatively, if you want to display the distinct count of a variable by certain dimensions, you can simply select the variable and specify the DISTINCT COUNT BY clause in the SELECT variable command. The benefit to creating a virtual variable for the distinct count is that you can provide a label, a name, and also see the variable in the Selector and Viewer dialog boxes. See the SELECT <variable> command for information about the alternative method.
Example 1
...This example creates a yearly variable YSales with the label Yearly Sales. CREATE yearly YSales 'Yearly Sales' by Product, Customer, Region ...This example creates a text variable Contact.Name dimensioned by Customer: CREATE TEXT Contact.Name BY Customer
November 2011
207
Example 2
...Create a virtual variable named Margin% and dimensions it by Product and Channel. CREATE 'Margin%' BY Product, Channel as ((Sales - Costs)/Sales) * 100
208
November 2011
Syntax
CREATE <field> = <piece1> + <piece2> + ...
Note: Use the following syntax in ACCESS LSLINK so as not to confuse the command with the SQL CREATE command.
LSS CREATE <field> = <piece1> <piece2> + ... Parameter <field> <piece1> Description Name of the field to create. A quoted literal string, field name, or substring expression. A substring expression has the format: SUBSTR(<field>, <position>, length) <field> Name of a new or existing field. <position> <position> in the field to start. <length> Number of characters to include in the field.
Note: CREATE cannot be used when reading data into attribute sets. The only method of renaming fields for use with Attributes is to use SQL field aliasing in the SQL statement. For example, the following would produce an error:
SELECT VARIABLE FLAVOUR SELECT PRODUCT INPUT ACROSS VARIABLE DOWN TIME, PRODUCT ACCESS EXTERNAL CONNECT DBASE SELECT SKU, FLAVOR FROM DBFILE.DBF LSS CREATE FLAVOUR = FLAVOR
November 2011
209
Examples
...If your field Month does not contain the year, but only the values 1 to 12, ...you can append the year with a statement like the following: CREATE Date = Month + '/99' ...If two fields contain the date, the month as the 3rd and 4th digits in a field called Paymentdate, and ... the year in a field called Year, you can append the year with a statement like the following: CREATE Date = SUBSTR(Paymentdate, 3, 2) + Year
Syntax
CREATE DATABASE <database> [ EXHIBIT | NOEXHIBIT ] [ BLOCKS <blocks> ] [ BLKSIZE <blksize> ] [ PARTITIONS <partitions> [SIZES <size> [,..., <size>] ] [ PREFORMAT ] { OBSERVATIONS <obs> | MEMBERS <members> } [ OVERWRITE ] [ DEFER ] [ PROTECTION <protection> ] [ UPDATE <update> ] [ READ <read> ] [ SORTKEYS {ALPHABETIC | NMEMBERS } ] [ MULTIPLE <multiple> [INPUT] ] [ GIGABYTES 16 | 32 | 64 | 128 | 256 | 512 ] [ USAGE [EXCLUSIVE | READ | SHARED] [RETAIN] ] [ VARIABLES <var> ] Parameter <database> Description Name of the database to create. If you are creating a database without partitions, <database> can be up to eight characters long. If you are creating a database with partitions, <database> can be up to six characters long (five characters long if you are creating 100 or more partitions). Do not use embedded underscores in the database name.
210
November 2011
Specifies that the database details will always be displayed by the EXHIBIT DATABASES command. This is the default value. Specifies that the database details will only be displayed by the EXHIBIT DATABASES command if you use the command with the HIDDEN keyword. Specifies the number of blocks of physical disk space for the database. The default is 200. Application Server does not preallocate blocks; it uses them on an as-needed basis. Therefore, you should check the availability of space because it is possible to specify a block size and then find that at the time Application Server actually uses the blocks, they are not available. Specifies the number of bytes per block: 512, 1K, 2K, 4K, 8K, 16K, 32K, 64K, or 128K. 16K is the default, and is recommended because it causes less I/O. The initial database potential capacity is <blocks> x <blksize>.
BLKSIZE <blksize>
PARTITIONS <partitions> Number of database partitions to create, up to 256. Specify the PARTITIONS keyword after the BLKSIZE keyword. See Creating a dimensional model with multiple partitions for more information. SIZES <size> One or more numbers that identify the size of each new partition in blocks. You must separate each size with a comma. You can specify <size> as the number of blocks (for example, 20,000), as a multiple of 1,000 with a K suffix (for example, 20K), or as a multiple of 1,000,000 with an M suffix (for example, 1M). By default, Application Server divides the partition sizes evenly based on the number of blocks. If you specify fewer sizes than the number of partitions, Application Server divides the remaining blocks equally among the remaining partitions. Preformats the database up to the database size as specified by the BLOCKS keyword. Application Server writes to all the blocks to ensure that the space is preallocated.
PREFORMAT
OBSERVATIONS <obs> Specifies the maximum number of observations a time series can contain. To determine this number, multiply the periodicity of each variable by its date range. For example, if the variable Sales will contain monthly observations from January 1999 to December 2000 inclusive, you will have two years of monthly data, making a total of 24 observations. In addition, the <obs> parameter determines the maximum number of columns that can be displayed. For example, if you have 52 weeks of data for two variables, and you want to display variables and time across for the whole 52 weeks, you must ensure that the <obs> value is set to at least 104 (equal to 52 observations * two variables). Note: The maximum number of observations for a database is 32,000. MEMBERS <members> OVERWRITE DEFER Specifies the number of members in the largest dimensions. See Using the MEMBERS keyword for more information. Specifies that Application Server should overwrite any existing file with the same name. Use DEFER on systems where write access to the database storage location is restricted to a specific user.
PROTECTION <protection> Name of the protection key that is required to remove the database record from one MASTERDB to another. You can specify a protection key with up to 16 characters. READ <read> One or more read access keys separated by commas. Each read access key is an alphanumeric name up to 16 characters. You can set both a READ key and an UPDATE key on a database. Use the Supervisor REMOVE command to remove a read or update access key. Determines the criteria used for the order that dimensions are referenced in internal Application Server database key structures. ALPHABETIC orders the dimensions alphabetically and NMEMBERS orders the dimensions based on the number of members in each dimension. To optimize performance, it is recommended that NMEMBERS be used. However, ALPHABETIC remains the default for backward compatibility reasons. Notes:
November 2011
211
GIGABYTES 16 | 32 | 64 | 128 | 256 | 512 The maximum size of the database. You should set this parameter to the anticipated size of your database, not larger. A maximum database size of 32 GB is currently tested and supported. USAGE [EXCLUSIVE | READ | SHARED] [RETAIN] Indicates the access mode when a user enters a USE or ATTACH command without specifying a usage parameter. You can specify READ for read access, SHARED for shared access, or EXCLUSIVE for exclusive access (the default). In addition, you can specify the RETAIN keyword to keep the current database attached. VARIABLES <var> The maximum number of variables the database can contain. The default value is 1000, and the maximum is 10,000.
Example
...This example creates a database BUDGET: CREATE DATABASE budget BLOCKS 700 OBSERVATIONS 100 ...This example creates a 500-block database PAYABLES: CREATE DATABASE payables BLOCKS 500 OBSERVATIONS 400 UPDATE payable ...The following example creates a database called ACCNT with 400,000 blocks in a ...50,000-block partition and a 350,000-block partition: CREATE DATA Accnt BLOCK 400000 BLKSIZE 8K OBS 500 PARTITIONS 2 SIZES 50K, 350K ...The output of this command would be: Database: ACCNT Maxaccess: UPDATE Disposition: ENABLED Current State: AVAILABLE Protection Key: None Last user: Last access:
Blksize: 8192 Observations 500 Maxblocks: 400000 Number Free: 399990 Database ACCNT Partition Information.
212
November 2011
Date Last Opened for Update: Date Last Closed After Update: Partition 1 2 Size Name 50000 ACCNT01 350000 ACCNT02
...The following example creates a database called DEMO with 600,000 blocks in three ...partitions of 200,000 blocks each. They are named DEMO01, DEMO02, and DEMO03. CREATE DATA DEMO BLOCK 600000 PARTITIONS 3 ...The following example creates a database called ACCNT with 10,000 blocks, with ...each block 8K in size, and with the number of members in the largest dimensions ...not to exceed 36,000 members: CREATE DATABASE ACCNT BLOCK 10000 BLKSIZE 8K MEMBERS 36000 ...This example creates a database called ACCNT with 3 partitions 200K in size. ...Application Server writes to all the BLOCKS to ensure that the space is preallocated: CREATE DATABASE ACCNT PARTITION 3 SIZE 200 PREFORMAT ...This example creates a database called ACCNT 12000K in size. Application Server ...writes to all the BLOCKS to ensure that the space is preallocated: CREATE DATABASE ACCNT SIZE 12000 PREFORMAT ...This example creates a database called ACCNT with maximum size of 64GB: CREATE DATABASE ACCNT GIGABYTE 64
Syntax
CREATE <dimension> [REPLACE] [NOCORRECTIONS] <user_defined_hierarchy> [<label>] = { SELECTED | <expression> }
November 2011
213
NOCORRECTIONS .
Performs multiple counting when any descendants of the User-Defined Hierarchy causes multiple counting within the User-Defined Hierarchy. Application Server will not search for multiple counting issues in dimensions compiled and all subsequent aggregations performed on those dimensions are aggregated exactly as defined in the hierarchy with no corrections. If you omit NOCORRECTIONS, any multiple counting within nested UserDefined Hierarchies or multiple counting arising from descendants of UserDefined Hierarchies will automatically be corrected in the aggregations performed at run time. For information, see Multiple Counting in Dimensions.
<user_defined_hierarchy> Name of the User-Defined Hierarchy to define for this dimension. <label> SELECTED <expression> Optional label for a User-Defined Hierarchy member. Must be in double quotation marks (" "). Use up to 250 characters. Adds only selected members to this User-Defined Hierarchy. <member> ["<label>"] [+ <member> | - <member>] [+ <member> | - <member>] or <user_defined_hierarchy> [+ <user_defined_hierarchy> | <user_defined_hierarchy>] <member> Members to add or remove from the User-Defined Hierarchy. You can add and subtract members using the plus (+) and minus (-) signs. <label> Optional label for a User-Defined Hierarchy member. Must be in double quotation marks (" "). Use up to 250 characters.
<user_defined_hierarchy> Name of an existing User-Defined Hierarchy to add or remove from the User-Defined Hierarchy. You can add and subtract User-Defined Hierarchies using the plus (+) and minus (-) signs.
214
November 2011
Syntax
CREATE GROUP <user_defined_hierarchy> Parameter Description
<user_defined_hierarchy> Name of the User-Defined Hierarchy to create. You can create any number of User-Defined Hierarchy.
Example
...The following example creates a User-Defined Hierarchy called Finance: CREATE GROUP Finance
Syntax
CREATE USER <user> [ USEDB <usedb> ] [ USAGE [EXCLUSIVE | SHARED | READ] ] [ WORKDB <workdb> ] [ BLOCKS <blocks> ] [ BLKSIZE <blksize> ] [ BUFFERS <buffers> ] [ SECURITY [0 | 99] ] [ LOGIN [ON | ENABLED | DISABLED | PAUSED] ] [ EXPIRATION <date> ] [ PASSWORD <password> ] [ MAXLOGIN <lognum> ] [ ACCESS <key> ] Parameter <user> Description Specify a name for the new user. The user name must begin with an alphabetic character but the rest of the name can be alphanumeric. You can specify up to 96 bytes. Note: User names must not contain spaces or underscore characters (_). USEDB <usedb> Specifies the database the user is attached to after logging in. If you omit this parameter, Application Server attempts to attach the user to a database with the same name as the user name. Specifies the mode in which the default database is opened. You can specify READ for read access, SHARED for shared access, or EXCLUSIVE for exclusive access. This setting is used when logging in. WORKDB <workdb> Specifies the file name Application Server should use to create the Work database. You can specify an alphanumeric name of up to eight characters. Do not include a path; Application Server creates all Work databases in the home
November 2011
215
PASSWORD <password> The user's password. Specify an alphanumeric name with up to 12 characters. The first character must be alphabetic, not numeric. MAXLOGIN <lognum> The number of times the user can log into Application Server concurrently. Specify a number between 1 and 32,000. The default is 255. You might want to allow a user multiple logins when many users within a User-Defined Hierarchy or department will use the same login ID to access Application Server. Specifies an access key that is required to access a database in either read or update mode.
ACCESS <key>
Example
...This example creates the user Mel with default Use and Work databases: CREATE USER Mel USE salesdb WORK wkmel ...This example creates the user Mel and sets an access key of "account1' for that user: CREATE USER Mel ACCESS account1
Syntax
CREATE VERSION <version> [REPLICATE [DATA]] Parameter <version> REPLICATE DATA Description Name of the version you want to create. The default version name is DEFAULT. Duplicates the structure of all variables in the version. Duplicates the data of all variables in the version.
6.49 CSWITCH
Use
Use the CSWITCH command to clear the current user and Work database before you log into Application Server again as a different user. Or, you can also switch to a different Work database in
216
November 2011
the same session while deleting the previous Work database and staying logged in as the same user.
Syntax
CSWITCH { <username> [PASSWORD <password>] | WORKDB [<name>] } Parameter <username> PASSWORD <password> WORKDB Description The user name you want to log in as. Indicates that the user name has a password. The password for that user. Clears all prior Work databases in the session and creates a new Work database named DBxxxxx while remaining logged in as the same user . Note: See the SWITCH command if you want to switch to a different Work database and save the previous Work database. Clears all prior Work databases in the session, and switches to the Work database name specified while remaining logged in as the same user. If the name already exists, it is used and the state is restored. If that Work database exists but is not a valid Work database, you get an error and rollback. If the Work database does not exist, a new one is created with the blocksize and blocks defined for the current user, that is, just as original Work database would have been created. Note: Some settings like the ACROSS and DOWN commands and SELECT statements are saved in a Work database. If you switch back to a previous Work database, you will get those settings, and as a result, your view may change. Tip: The WORKDB feature is helpful in applications that use User-Defined Hierarchies, such as the strategy management application. The strategy management application typically creates and clears User-Defined Hierarchies for each transaction. By switching between multiple Work databases, you can maintain the appropriate state and avoid the constant creating and clearing of the User-Defined Hierarchies.
<name>
November 2011
217
6.50 DECONSTRUCT
Use
DECONSTRUCT is an Access command that generates input data from a compiled dimension that can be used to later CONSTRUCT the same dimension. DECONSTRUCT will work with ACCESS EXTERNAL or ACCESS LSLINK. Note: For ACCESS EXTERNAL if no DESCRIPTION is supplied, DECONSTRUCT will generate a default DESCRIPTION internally. For ACCESS LSLINK you must supply a SELECT statement from an existing table that you want the output to be inserted into.
Syntax
DECONSTRUCT [DIMENSION] <dimname> [LABEL SUFFIX <literal> ] [NOATTRIBUTES] [NOSPACES] [PROCEDURE {<set> | <filename>}] [OVERWRITE]
Parameter DIMENSION <dimname> NOATTRIBUTES LABELSUFFIX <literal> Description Option keyword. Name of the dimension to deconstruct. Specifies that you do not want to have fields for any attributes of the dimension in the output file. Specifies the suffix that you want applied to LEVEL fields to produce a LABEL field. For example in JUICE for dimension PRODUCT there are levels PRODUCT,BRAND and CATEGORY. The output file needs fields for LABELS corresponding to each level. By default it will generate fields called PRODUCTLABEL, BRANDLABEL, CATEGORYLABEL by appending a suffix "LABEL" to the level name. You can supply an alternative suffix to use that instead. Specifies that all the fields will have no spaces in them in the output file. Any spaces will be written as underscores in the output. This allows you to use the NOSPACES keyword in the DESCRIPTION statement in ACCESS EXTERNAL if you want to use the output file created by DECONSTRUCT as input to a subsequent CONSTRUCT command. Generates a procedure that will have all the statements to run a CONSTRUCT from the output of the DECONSTRUCT command. The procedure can be a procedure in PAS or an external text file. The procedure will include a PREFACE statement to generate any CUSTOM or ALLOCATE statements in the original dimension. OVERWRITE Specifies that you want to overwrite a system file with the same name, if there is one.
NOSPACES
Syntax
DEFINE SYNONYM <dimension><synonym> Parameter <dimension> <synonym> Description Name of the dimension, including Time and Variables, whose members have different names in an external data source. Name of the synonym set that contains all the synonyms for a given dimension.
218
November 2011
Example
...If the variables Sales and Expenses are known as Msales and Mcosts in ...an external data source, you can create a synonym set, VARSYM, that contains: ...Sales Msales ...Expenses Mcosts ...Then in the Access subsystem, enter the following statement: DEFINE SYNONYM Variables Varsym
6.53 Description
DESCRIPTION is an Access External command that defines an external file format.
Parameter BINARY <length> FREE <separator> Description Indicates the external file is a binary file. Record length in the binary file. This value is an integer less than 32,768. Indicates the external file is a free format file. A punctuation symbol (, /\ | ; # / \ . : = ), the word SPACE or TAB, an integer, or a hexadecimal number representing the value of the separator character in your character set. Indicates the external file is a fixed format file (the default). Indicates logical records read are represented by more than one physical record; however, each logical record must begin a new physical record. The decimal point character used in the external file. Name of the field of up to 24 alphanumeric characters starting with a letter. You must enclose names with spaces in single quotation marks (' '). You would typically use names of dimensions or variables. For example, a field might be Time, Sales, Product, or Hour. You can specify more than one field statement. Note: You can define a maximum of 2048 fields. DATE <type> An optional prefix to the date format type. Type of data the field contains: BINARY Valid only with binary files. <date format> Can be: myy, ymd, yymd, dmyy, dmy, mdyy, mdy, ydm, yydm, yym, my, or ym If the year is four digits (2000), the formats with yy are used. If the year is two digits (00), the formats with y are used. If the month is alphabetic (May 2000), the letter m is replaced with the word month, for example monthyy. The separator characters dash (-), slash(/), or period (.) can be used in the date; however, they must appear in the actual date format. For example, the format for 12-3-07 would be m-d-y.
November 2011
219
Note: When more than a few fields are being defined, you should enclose DESCRIPTION in a BEGIN-END block in a procedure and execute the procedure from the Access subsystem.
Example
... Product is a 16-character text field beginning in column 12 of a fixed format record. ... It is followed by the numeric field Sales, which is 10 characters wide with 2 decimal places: BEGIN DESCRIPTION Product TEXT 16 12 Sales NUMERIC 10.2 END
6.54 DETACH
Use
DETACH detaches a database, preventing users from accessing sets and data in it.
220
November 2011
Note: You should detach a database before you increase the database partitions using the CHANGE DATABASE command.
Syntax
DETACH [<database>][.] Parameter <database> . Description Name of the database to detach. A period (.) is a synonym for &USEDATABASE.
Example 1: DETACH
...This example detaches the database MARKET and then shows all attached databases: DETACH market SHOW DATABASE
Example 2: DETACH
...This example detaches a database to increase the number of database partitions. The database is ... then used and extended so that the database size equals the increased partition sizes. DETACH Accnt CHANGE DATABASE Accnt ADD 2 PARTITIONS SIZES 40K, 20K ...The output of this command would be: Warning: The Number of Blocks Specified in the PARTITION SIZES (120000) for Database ACCNT is Larger than the BLOCKS specified. Database: ACCNT Maxaccess: UPDATE Disposition: ENABLED Current State: Available Protection Key: None Last user: Last access:
Blksize: 8192 Observations 500 Maxblocks: 60000 Number Free: 59990 Database ACCNT Partition Information. Number of Partitions: Blocksize: 5 8192 Thu Feb 9 15:34:10 2000 Thu Feb 9 15:34:10 2000
Date Last Opened for Update: Date Last Closed After Update: Partition 1 2 3 4 5 USE Accnt EXTEND Accnt 60000 Size Name 20000 ACCNT01 20000 ACCNT02 20000 ACCNT03 20000 ACCNT04 20000 ACCNT05
November 2011
221
6.55 DIFF( )
Use
DIFF returns the difference between the value of a variable in the current period and in the same period a specified time period ago, (for example, a year or month ago), or in a different time period, using the <period> parameter.
Syntax
CALCULATE <result> = DIFF(<variable>[, <period>])
If you enter the following command, Application Server returns the original sales, because it handles the change at the start of the fiscal year:
DIFFSALES=DIFF(ACCSALES)
The optional second argument overrides the yearly default, forcing some other periodicity, such as quarterly. However, if you specify ACCUM(<variable>,MONTHLY) for a monthly variable, Application Server accumulates the data over a span of one month, which in effect does not accumulate any data. Similarly, if you enter DIFF(<variable>, MONTHLY), you are asking Application Server to reset the difference process every month. Application Server returns the original series you gave the function as an argument.
Parameter <result> <variable> <period> Description Name of the result variable. Name of the variable whose difference you want to measure. Variable names that use special characters should be in single quotation marks (' '). Overrides the default period (year) to compare by quarter, month, or week.
Example 1: DIFF
...Calculate the difference between this period's sales and sales in the same period last year: CALCULATE Change = DIFF(Sales)
Example 2: DIFF
...Calculate the change in Sales for the current period and the same period in the previous quarter: CALCULATE Q_Change = DIFF(Sales, Quarter)
Example 3: DIFF
...Accumulate the value of x over a year and uses the DIFF command to reset the difference as z: USE ron CREATE x ...The output of this command would be: 1 Variable Created SET PERIOD 1999
222
November 2011
CALCULATE x = obs() CALCULATE y= accum(x) CALCULATE z=diff(y) SELECT VARIABLE ...The output of this command would be: 3 Variables Currently Selected across variable down time Across List: # Selected
VARIABLES 3 X, Y, Z Down List: TIME ...The output of this command would be: Period 1999/1/1 - 1999/12/31 Attached Databases: RON User: ADMIN LIST ...The output of this command would be: X Jan 99 Feb 99 Mar 99 Apr 99 May 99 Jun 99 Jul 99 Aug 99 Sep 99 Oct 99 Nov 99 Dec 99 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 Y Z 1.00 3.00 6.00 10.00 15.00 21.00 28.00 36.00 45.00 55.00 66.00 78.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00
6.57 DIMENSION
Use
DIMENSION starts the Application Server editor, where you can create or edit dimensions. A dimension consists of input members, output members, and a result member that identify the time series for variables in a database. The dimension contains arithmetic rules for these members that define relationships and consolidation methods. Note: If you manually create a dimension and the first OUTPUT member in the consolidation rules must be enclosed in single quotation marks (' ') because it contains special characters, the last OUTPUT or RESULT member must have a label. If you omit the label, Application Server assumes that the member in quotation marks in the rules section is the label for the last OUTPUT or RESULT member.
November 2011
223
DIMENSION - Rules
A dimension does not have to have output members or a result member. You must define a dimension before creating a variable that is dimensioned by it. You can use all logic set functions/constructs in output and result member calculations. When a variables dimension is omitted from the across/down list, the dimension's result member is used in reports. For example, assume the selected variable SALESVOL is dimensioned by Product. If you enter ACROSS Time DOWN Variables followed by DISPLAY, Application Server displays only the result member of the dimension Product for the variable SALESVOL. If you create labels for dimension members, the first 24 characters of each label must be unique.
Syntax
DIMENSION [<dimension>] [;<database>| ;EXTERNAL|LOCAL] Parameter <dimension> Description Name of a new or existing dimension up to 96 bytes. If you do not specify a name, Application Server uses the default dimension (if defined) or the last dimension you edited. Name of the database where the dimension is located. If you do not specify a database, Application Server uses your Use database. Indicates the dimension is a text file that is not in an Application Server database. Indicates that the dimension is a text file on the client. Note: You can create or edit a dimension with the EXTERNAL or LOCAL extension, but you must copy it into a model and compile it before it can be used in the model. See also these Dimension editor commands: ALLOCATE Specifies the maximum number of input, output, and result members in a dimension. If you later add members to the dimension, Application Server will not reorganize the database. Optimizes the selection of dimension members by indexing the members. This occurs when you select by specific member name or label. Specifies the input members, which are the lowest level of data collected or entered in a database. Specifies the output members, which are the intermediate consolidated (or calculated) members. Specifies the result member, which is the final consolidated member. There can be only one result member. LEVEL defines the members and levels within a dimension. You can select a group of members by specifying the level name instead of selecting the members individually. When a dimension has LEVEL statements without a HIERARCHY statement, members have only one path for rolling up into output levels. Such a dimension has only one hierarchy. HIERARCHY defines the members and levels within a hierarchy in a dimension that contains multiple hierarchies. You define hierarchies when the input members are consolidated into more than one output member. CLASS Defines a class or group of dimension members within a dimension. This allows you to select dimension members by their class name instead of selecting them individually. Arithmetical statements that define how Application Server consolidates input and output members and defines their relationships between one another. For example: total_region = SUM, Northeast, Southeast, Midwest, West
Consolidation statement
224
November 2011
Note: If a dimension uses subtraction, you must use the sum operator with a negative sign in the dimension set. For example: VARIANCE = SUM ACTUAL, -BUDGET
Example
...This example creates a dimension Country, with labels for the dimension members: DIMENSION Country INPUT US United States ,UK United Kingdom RESULT Total Total Market ...The text labels United States, United Kingdom, and Total Market appear on lists and reports ... instead of the member names US, UK, and Total (unless you enter SET SHORT). ...Note: If you create labels for dimension members, the first 24 characters of each label must be unique.
6.58 DIRECTORY
Use
DIRECTORY displays the sets in a database.
Syntax
DIRECTORY {DATABASE <database>} [SORT {SIZE | UPDATED} [REVERSE]] {FULL} {<settype> [,...<settype>]} {<setname>} {SYNC} FORMAT string, string Parameter DATABASE <database> FULL Description Displays all sets in the specified database. Name of the database. Displays information about the size of each set in the database, when Application Server last updated it, and whether you can recover it. If you have made changes to a set during a session, the letter R appears under the Recover category, indicating that you can restore the set to the state it was in when you started the session. Displays all sets of the specified set types in the database. You can specify more than one set type. For example, DIRECTORY REPORT LOGIC ATTRIBUTE lists all reports, logic sets, and attribute sets. Sorts and lists sets. You can use SORT options with any DIRECTORY keyword. For example, DIRECTORY FULL SORT SIZE or DIRECTORY LOGIC SORT UPDATE REVERSE. Sorts sets from largest to smallest. Sorts sets from most recently updated to least recently updated. Reverses the sort order. Displays all the sets with the specified name in the database. You can use an asterisk (*) in a set name as a wildcard that indicates that any character can occupy that position or any of the remaining positions in the name. For example, prod* searches for all sets whose name begins with prod. Compares database elements (dimensions, report, logics, and so on) for compile synchronization.
<settype>
SORT
SYNC
November 2011
225
Example
...This example displays information about all sets: DIRECTORY FULL ...The output of this command would be: Recover Procedures Logics PROFIT REVENUE R SALES Reports YEARLY Dimensions COMPANY PRODUCT 2 2 Sun Apr 19 14:25:59 2000 Fri Apr 17 16:22:02 2000 2 Sat Apr 18 09:11:16 2000 2 2 2 Sun Apr 12 16:13:30 2000 Fri Apr 24 14:38:28 2000 Fri Apr 17 14:35:55 2000 Size Last Updated 2 Fri Apr 24 11:38:41 2000
PROFILE
...This example uses the asterisk (*) to display all sets that begin with the letters prof: DIRECTORY prof* ...This example displays all the sets in the attached database LIBDB: DIRECTORY DATABASE libdb
Syntax
DISABLE {LOGINS <users> | DATABASE <databases>} Parameter LOGINS <users> Description Prevents the specified user(s) from logging in to Application Server, where <users> is one or more user names separated by commas. You can use an asterisk (*) in a user name to indicate that any character can occupy that position or any of the remaining positions in the name. Suspends access to the specified database(s). One or more database names separated by commas. You can use an asterisk (*) in a database name to indicate that any character can occupy that position or any of the remaining positions in the name.
DATABASE <databases>
Example
...This example disables two users, Fin1 and Fin2: DISABLE LOGINS Fin1, Fin2
226
November 2011
6.60 DISPLAY
Use
DISPLAY displays a report.
Syntax
DISPLAY [<report>] [WIDTH <width>] [LENGTH <length>] [<periodicity>] [PERIOD <daterange>] [TAB '<symbol>'] [ RESOLVE ] Parameter <report> WIDTH <width> LENGTH <length> <periodicity> Description Name of an existing report. If you do not specify a name, Application Server displays the default report (if defined) or the last report you edited. Sets the maximum number of characters that can appear on a line. Sets the maximum number of lines that can appear on a page. Displays data at one of the following periodicities: yearly, ytd, ryearly, semiannually, quarterly, qtd, rquarterly, monthly, mtd, mytd, avgytd, rmonthly, lunar, bimonthly, weekly, wtd, biweekly, daily, or hourly. Limits the display to a specified date range, where <daterange> is a range of dates separated by a dash (-). For example, 00/12/3 - 00/12/31 is the period from December 3, 2000 through December 31, 2000, and 99 - 00 is all of 1999 and 2000. Uses the character specifies by <symbol> as a column delimiter. You must enclose the symbol in single (' ') or double (" ") quotation marks. Use TAB '<symbol>' when the report set uses the TABS keyword but you want to use a different symbol so that you can easily transfer the report into another application. Note: If you use commas as the thousands separator, enter SET DEFAULT COMMA OFF so that Application Server does not display the thousands character. This prevents the thousands character from being interpreted as a column delimiter. RESOLVE If you specify this parameter, Application Server recompiles the report before execution. This parameter ensures that Application Server uses the current value of control variables in the set.
PERIOD <daterange>
TAB '<symbol>'
Examples: DISPLAY
...This example displays the report EXPREP with a monthly periodicity: DISPLAY exprep monthly ...This example displays the report ABCREP with a weekly periodicity for ...the period from June 1, 1999, to September 30, 1999: DISPLAY abcrep weekly PERIOD 99/6 - 99/8/30 ...This example displays the report EXCELREP with commas for column ...delimiters so that you can transfer the report into Microsoft Excel: DISPLAY excelrep TAB ','
November 2011
227
Syntax
DISPLAY <variables> Parameter <variables> Description One or more Scalar or Temp variable names separated by commas.
Example
...This example displays the value of the scalar variable i in a logic set: SCALAR i DO i = 1, 3 DISPLAY i ENDDO ...The output from this logic set looks like this: I 1 I 2 I 3
6.62 DOCUMENT
Use
DOCUMENT starts the Document editor, where you can create or edit documents. You can use DOCUMENT to examine sets created by OUTPUT.
Syntax
DOCUMENT [ <document> ] [ ;<database> | ;EXTERNAL|LOCAL] Parameter <document> Description Name of a new or existing document. If you do not specify a name, Application Server uses the default document. If you do not have a default report, Application Server uses the last document edited. Name of the database where the document is located. If you do not specify a database, DOCUMENT uses the database specified in the last USE command. Indicates the document is a server text file that is not in an Application Server database. If the document is a DOS file, its name cannot have an extension. Indicates that the document is a client text file.
Examples: DOCUMENT
...This example opens an external file "AUTOEXEC.BAT": DOCUMENT 'C:\AUTOEXEC.BAT';EXTERNAL ...This example creates and opens a document TEXTFILE in the current use database: DOCUMENT TEXTFILE
228
November 2011
6.63 DO-ENDDO
Use
DO-ENDDO repeatedly executes a block of statements for a specified series of values.
Syntax
DO <variable> = <m>, <n> . . <statements> . ENDDO Parameter DO <variable> <statements> ENDDO Description Indicates the start of a loop. Executes the statements in the loop as long as the value of the specified variable is within the range of <m> to <n>. Name of the variable assigned the values <m>, <m> + 1, ..., <n>; the value is incremented by 1. A sequence of statements or commands. Indicates the end of a loop.
Example
...This example executes the statements in the DO-ENDDO block 10 times: DO x=1, 10 ...your statements ENDDO
6.64 DUMP
Use
Transfers the Use database to one or more external text files (dump files). You can use these dump files with the LOAD command to recreate the database. Note: Application Server can dump files greater than 2Gb on UNIX).
Syntax
DUMP <filename> [DATA <datafile>] [SIZES <sizes>] [DUMMY] [NODATA] [OVERWRITE] [DRILLTHRU] [NODENSE] [NOLARGEFILES] [CHARSET {ASCII | ISO2022 | SHIFTJIS | JEUC | TCEUC | SCEUC | KEUC | UTF8 } ] Parameter <filename> Description Specifies the alphanumeric name of the external file in which to store the entire database, including data, dimensions, procedures, and so on. By default, one dump file will be created. The file can exceed 2Gb. If you don't want the dump file to exceed 2Gb, you can partition it by specifying a name containing wildcard characters and using the NOLARGEFILES and/or SIZES keywords. You can choose to include just the database definition within <filename>, and place data within another file specified by the <datafile> parameter. If you choose to do this, you cannot specify wildcards within <filename>. DATA <datafile> Stores just the data from the database in an external file with the name specified by <datafile>. The database definition is stored in <filename>. By default, one dump file will be created. The file can exceed 2Gb. If you don't want the dump files to exceed 2Gb, specify a file name containing wildcards and use the NOLARGEFILES and/or SIZES keywords.
November 2011
229
NOLARGEFILES
Remarks
DUMP copies binary object sets to EXTERNAL files with a name consisting of the first letter of the binary type (for example, 'B' for BINARY, 'M' for MULTIMEDIA) followed by the set name, and inserts a COPY command into the dump file to copy them back to the database. The DUMP command does not compress binary object sets.
230
November 2011
Server replaces the wildcard characters with partition numbers, for example DUMP01, DUMP02, and so on. If you have chosen to store the data and database definition together, you should specify the wildcard within the <filename> parameter; if you have chosen to store the data and database definition separately, you should specify the wildcard within the <datafile> parameter. For example:
DUMP dump?? SIZE 1G DUMP dump?? NOLARGEFILES DUMP maindump DATA dump?? SIZE 1G
Rules
If you load a file into a database that is not empty, the sets or variables loaded overwrite any existing sets or variables with the same name. File and datafile are alphanumeric names, but the first character must be alphabetic. Due to its size, you may not be able to edit the dump file. In this case, either separate your data from the rest of the database, or use SNAPSHOT to dump a subset of your database.
Example
...This example dumps the contents of the database CORPFIN to an ...external file FINANCE and then loads that file into the database NEWFIN: USE corpfin
November 2011
231
Syntax
DUMP <filename> [CREATE|DEFINE] [OVERWRITE] Parameter <filename> CREATE DEFINE OVERWRITE Description Name of the external file where you want to store the contents of MASTERDB. Adds CREATE DATABASE commands to the dump file so that when you load the dump file, Application Server creates the database. Adds DEFINE DATABASE commands to the dump file. Application Server creates the databases when you enter the first explicit or implicit USE command. Overwrites a system file with the same name.
Rules
DUMP creates an external file with the Supervisor commands necessary to recreate MASTERDB in its current state. The file has commands to recreate database records and user records. For database records, the file contains ADD DATABASE commands to add the record for that database and any partitions in MASTERDB. The file containing the database must already exist on the system. Following ADD DATABASES is a comment with the number of observations, the number of blocks, and the block size of the database. For user records, the first command removes the user and the next command recreates the user with the characteristics of that user as those that exist in the dumped MASTERDB; Application Server replaces any existing records with the same names as those in the dump file. You must be in the Supervisor subsystem to restore the external file created with DUMP. Application Server dumps access keys, and user and database entries, but does not dump protection keys.
Example
...This example dumps the contents of MASTERDB to an external file named MSTRBAK: DUMP mstrbak ...In the event that the file containing MASTERDB is destroyed, you can restore ...MASTERDB with the following SUPERVISOR command: LOAD mstrbak
232
November 2011
6.66 ECHO
Use
ECHO displays a message on either the OUTPUT, REASSURANCE, or ERROR streams. The default stream is to display the message on the OUTPUT stream.
Syntax
ECHO [ERROR | REASSURANCE] <message> Parameter ERROR REASSURANCE <message> Description Specifies that Application Server will display the message on the ERROR stream. Specifies that Application Server will display the message on the REASSURANCE stream. Message text of up to 255 characters.
Note: To include a percent sign (%) in the output generated by the ECHO command, use two percent symbols. For example, the following command: ECHO A%%B generates the output: A%B
Example
...This example displays the message "Executing Stage 3" on the default OUTPUT stream: ECHO Executing Stage 3 ...This example displays the message "Stage 3 failed!" on the ERROR stream: ECHO ERROR Stage 3 failed!
Syntax
ENABLE {LOGINS <users> | DATABASE <databases>} Parameter LOGINS <users> Description Restores the specified user's access to Application Server, where <users> is one or more user names separated by commas. You can use an asterisk (*) in a user name to indicate that any character can occupy that position or any of the remaining positions in the name.
DATABASE <databases> Restores access to the specified database(s), where <databases> is one or more database names separated by commas. You can use an asterisk (*) in a database name to indicate that any character can occupy that position or any of the remaining positions in the name.
Example
...This example enables two users, Fin1 and Fin2: ENABLE LOGINS Fin1, Fin2
November 2011
233
6.68 END
Use
END exits and saves all changes made in the current session to the Access, Rollup, and Supervisor subsystems.
Syntax
END [LEAVE] Parameter LEAVE Description Ends the Access subsystem and keeps the connection to the RDBMS open so that the next time you go back to the Access subsystem, it is still connected. If you are going in and out of ACCESS LSLINK over and over, you can avoid connecting and disconnecting by using the LEAVE statement in ACCESS LSLINK.
6.69 EXECUTE
Use
EXECUTE executes the commands in a procedure, or in an external file or tape device, without displaying them on your screen.
Syntax
EXECUTE <procedure> <setname>[;<database>] | <filename>[;EXTERNAL} | TAPE '<tapename>' [UPDATE] [ RESOLVE ] Parameter <setname> <procedure> <filename> Description Name of a set, such as a logic set or a dimension set. Name of a procedure. If you do not specify a name, Application Server uses the default procedure (if defined) or the last procedure you edited. Name of an external file that Application Server created by the SUPERVISOR DUMP command that contains user and database information about MASTERDB. Name of the database where the procedure is located. If you do not specify a database, Application Server uses your Use database. Indicates the procedure is a text file that is not in an Application Server database. Indicates that the data source is a tape device. The UNIX name for the tape drive in double quotation marks (" "). Forces a database update after each command in the procedure. By default, EXECUTE freezes the database until Application Server completes the procedure, and then updates it. EXECUTE runs faster if you do not specify UPDATE. However, if you do not specify UPDATE, and the procedure causes an error, none of the commands in the procedure update the database. If you specify this parameter, Application Server recompiles the procedure before execution. This option ensures that Application Server uses the current value of control variables in the set.
RESOLVE
EXECUTE - Rules
If you do not want to include any of the EXECUTE options, you can execute a procedure by typing its name and then clicking the OK button.
Examples: EXECUTE
...This example executes the procedure ENDYEAR:
234
November 2011
EXECUTE endyear ...Optionally, you can execute the procedure without specifying EXECUTE. For example: endyear ...This example executes the DOS/Windows file c:\myjob: EXECUTE c:\myjob;external ...This example executes the procedure FRED on the USE database, if found, ...otherwise Application Server searches for a file called FRED. EXECUTE FRED ...This example executes the external file FRED in the current directory: EXECUTE ./FRED
6.70 EXHIBIT
Use
EXHIBIT displays information about attributes, databases, dimension members, sets, users, UserDefined Hierarchies, variables and virtual variables. EXHIBIT provides a mechanism for interrogating the contents of a database. You can use the EXHIBIT TOPS command to exhibit and select the top members of all dimensions.
Output Formats
The output for requests that return object information is formatted in a list format with the information followed by a line feed (ASCII 10). For example, EXHIBIT <database> returns: APLIB DEMO1 INITIAL JUICE SMREPORT The output for requests that return property-related information is formatted as a tab-separated (ASCII 9) string. For example, EXHIBIT GROUP TEST FULL returns: TEST ADMIN TEST1 TEST2 SUPER SUPERVISOR
If you request property-related information for multiple objects, a tab-separated string terminating in a line feed is returned for each object. For example, EXHIBIT GROUP FULL returns: TEST ADMIN USER1 USER2 SUPER SUPERVISOR
6.70.1
Displays the across dimensions.
EXHIBIT ACROSS
Note that attribute names are displayed with a leading underscore (_), as shown in the example.
Example
... This example displays the current across dimensions in the JUICE database: USE JUICE EXHIBIT ACROSS ... The output of this command would be:
November 2011
235
6.70.2
Displays the down dimensions.
EXHIBIT DOWN
Note that attribute names are displayed with a leading underscore (_), as shown in the example.
Example
... This example displays the current down dimensions in the JUICE database: USE JUICE EXHBIT DOWN ... The output of this command would be: VARIABLES PRODUCT _FLAVOR ... Note that because FLAVOR is an attribute, the name is displayed with a leading underscore (_).
236
November 2011
Comma-separated list showing the number of members in each level (ordered from input to result) Number of selected members Maximum number of User-Defined Hierarchies Actual number of User-Defined Hierarchies
Example
... This example displays the name of each attribute in the JUICE ... database, followed by the base dimension name: USE JUICE EXHIBIT ADIMENSION BASIS ... The output of this command would be: CONTAINER COT FLAVOR PARENT SIZE STATE PRODUCT CUSTOMER PRODUCT CUSTOMER PRODUCT CUSTOMER
Where <keyword> can be one of the following: [ TOPS LEVELS [<level>] <pattern> INPUTS OUTPUTS RESULT
ABOVE <member> BELOW <member> DRILL ABOVE <member> DRILL BELOW <member> JUST ABOVE <member> JUST BELOW <member> Parameter ALL
Description Modifies the command to display all the members of a dimension, regardless of any set hierarchy. Note: The ALL keyword must directly follow the EXHIBIT command, as in EXHIBIT ALL.
SELECTED
Lists the selected members of the specified dimension. If the dimension contains multiple hierarchies, it lists the selected members of the currently set hierarchy within the dimension. However, if used with the ALL keyword, it displays all members of all hierarchies.
November 2011
237
TOPS
LEVEL [<level>]
OUTPUTS
238
November 2011
If the dimension contains multiple hierarchies, DRILL BELOW member lists all the members in the same hierarchy below it, but not including that member (unless used with the ALL keyword). To drill below a member that is not in the currently set hierarchy, specify the alternate hierarchy name using a HIERARCHY statement. JUST ABOVE <member> Lists the specified member and all members one level above it. If the dimension contains multiple hierarchies, JUST ABOVE member lists the member from the currently set hierarchy and the members in the same hierarchy one level above it (unless used with the ALL keyword). To exhibit just above a member that is not in the currently set hierarchy, specify the alternate hierarchy name using a HIERARCHY statement. JUST BELOW <member> Lists the specified member and all members one level below it. If the dimension contains multiple hierarchies, JUST BELOW member lists the member from the currently set hierarchy and the members in the same hierarchy one level below it (unless used with the ALL keyword). To exhibit just below a member that is not in the currently set hierarchy, specify the alternate hierarchy name using a HIERARCHY statement.
Example
... This example displays the attributes of the Product dimension in the JUICE database: USE JUICE EXHIBIT ATTRIBUTES PRODUCT ... The output of this command would be: CONTAINER FLAVOR SIZE
6.70.6
Parameter <attribute> BOTH
Example
... This example displays both the structural dimension and attribute ... dimension names for the Flavor attribute in the JUICE database: USE JUICE EXHIBIT BASIS FLAVOR BOTH ... The output of this command would be:
November 2011
239
... If you omit the BOTH keyword, only the structural dimension name is displayed: EXHIBIT BASIS FLAVOR ... The output of this command would be: PRODUCT
6.70.7
Use
EXHIBIT CHARSET
EXHIBIT CHARSET displays the current CHARSET in effect from a SET CHARSET command.
Syntax
EXHIBIT CHARSET [ INPUT | INTERNAL | OUTPUT | EXTIN | EXTOUT | SESSION ]
Result
Outputs will be one of the following: ASCII, ISO2022, SHIFTJIS, JEUC, TCEUC, SCEUC, KEUC or UTF8
Example
EXHIBIT CHARSET INPUT Display the current INPUT setting. EXHIBIT CHARSET INTERNAL Display the current INTERNAL setting. EXHIBIT CHARSET OUTPUT Display the current OUTPUT setting. EXHIBIT CHARSET EXTIN Display the current EXTIN setting. EXHIBIT CHARSET EXTOUT Display the current EXTOUT setting. EXHIBIT CHARSET SESSION Display the current PAS process SESSION CHARSET. EXHIBIT CHARSET Display all CHARSET setting. One output example: INPUT: UTF8 INTERNAL: SCEUC OUTPUT: UTF8 EXTIN: SCEUC EXTOUT: SCEUC SESSION: UTF8
6.70.8
EXHIBIT CHECKPOINT
240
November 2011
Example
... This example displays the current checkpoint status: USE JUICE EXHIBIT CHECKPOINT ... The output of this command would be: UPDATE
6.70.9
Lists all the dimensions that have been compiled. Note that attribute names are displayed with a leading underscore (_) character, as shown in the example.
Example
... This example displays a list of the compiled dimensions in the JUICE ... database, with attribute dimensions prefixed by an underscore (_): USE JUICE EXHIBIT COMPILED DIMENSIONS ... The output of this command would be: CHANNEL CUSTOMER PRODUCT _CONTAINER _COT _FLAVOR _PARENT _SIZE _STATE
Example
... This example displays the timesets in the DEMO1 database: USE DEMO1 EXHIBIT COMPTIME FROM DEMO1 ...as follows: WKLY1 WKTREND WY
November 2011
241
Example
... This example displays the value of the control variable Selection: USE JUICE EXHIBIT CONTROL selection
Syntax
EXHIBIT COUNT [<dimension> | <attribute>] [BYLEVEL [SECURITY [FULL]]] [DRILLTHRU]
Parameter COUNT Description Lists the counts for allocated inputs, allocated outputs, allocated result, total selected members, defined User-Defined Hierarchies, and available User-Defined Hierarchies. Note: If you execute a basic EXHIBIT COUNT command with no keywords, the output represents all ALLOCATED numbers, independent of any security. Displays the number of members at each level of the dimension. If used with the SECURITY keyword, it only shows counts for the members at each level that have security applied. SECURITY Shows counts for the members at each level that have security applied by a Security procedure. If a level does not have secured members, that column representation does not appear in the output. Shows counts for the members at each level that have security applied by a Security procedure. If a level does not have secured members, that column is represented with a 0. Hybrid OLAP only. Reads the dimension counts from the RDBMS to ensure that the full counts are displayed and not just the number of members that have been imported into Application Server.
FULL
DRILLTHRU
Example
... In this example, for the PRODUCT dimension in the JUICE database, the counts for allocated ... inputs, allocated outputs, allocated result, total selected members, defined User-Defined ... Hierarchies and available User-Defined Hierarchies are returned: USE JUICE EXHIBIT COUNT PRODUCT
242
November 2011
... There are 36 allocated input members, 17 allocated output level members, one allocated result ... member, two selected members, and five defined and available User-Defined Hierarchies. ... If you use the BYLEVEL keyword, as in this example, the return value lists the number of levels in ... the dimension, followed by a count of the members in each level: EXHIBIT COUNT PRODUCT BYLEVEL ... The output of this command would be: 4 36 9 3 1
... The PRODUCT dimension has four levels - the top level, and the levels PRODUCT, BRAND, and ... CATEGORY. The PRODUCT (input) level has 36 members, the BRAND level has nine members, the ... CATEGORY level has three members, and the top level has one member.
Syntax
EXHIBIT CUSTOM { PRESENT | <dimension> [SELECTED | FORMAT <%s text>] }
Parameter PRESENT Description Displays a 0 or 1 that identifies whether any dimensions in the current across/down list have any User-Defined Hierarchies selected. A value of 0 means that no dimensions in the across/down have any User-Defined Hierarchies selected. A value of 1 means that at least one dimension in the across/down has a User-Defined Hierarchy selected. Specifies the name of a dimension whose User-Defined Hierarchies you want to view. Displays just the selected User-Defined Hierarchies for this dimension. Display the specified text appended to the User-Defined Hierarchy names in the %s location. This allows you to quickly build a set of similar commands. For example:
EXHIBIT CUSTOM Product FORMAT 'SELECT %s' SELECT UDH1 SELECT UDH2
Example
... This example displays a list of the currently defined User-Defined Hierarchies for the PRODUCT ... dimension in the JUICE database: EXHIBIT CUSTOM PRODUCT ... The output of this command would be: NEW_PRODUCTS
November 2011
243
244
November 2011
Examples
... This example displays a list of all databases in MASTERDB: EXHIBIT DATABASES ... The output of this command would be: APLIB DEMO1 INITIAL JUICE SMREPORT ... This example displays the properties of the specified database, JUICE: USE JUICE EXHIBIT DATABASES JUICE FULL ... The output of this command would be: JUICE C:\PROGRA~1\SAP BUSINESSOBJECTS\STRATEGY MANAGEMENT\APPLICATIONSERVER\DATA\JUICE.ENG 1 Enabled In use (read) ADMIN Read-only Update 90.42 0 10000 1000 0 No 2000/04/02 14:51:07 5000 8192 32 4521
... This example displays the properties of all the databases in MASTERDB:
EXHIBIT DATABASES FULL
JUICE C:\PROGRA~1\SAP BUSINESSOBJECTS\STRATEGY MANAGEMENT\APPLICATIONSERVER\DATA\JUICE.ENG 1 Enabled In use (read) ADMIN Read-only Update 90.42 0 10000 1000 0 No
SMREPORT C:\PROGRA~1\SAP BUSINESSOBJECTS\STRATEGY MANAGEMENT\ APPLICATIONSERVER\DATA\SMREPORT 1 2000/02/25 11:21:36 Enabled Available ADMIN Shared Update 10000 2048 32 9969 99.69 0 10000 5000 0 No TBDB C:\PROGRA~1\SAP BUSINESSOBJECTS\STRATEGY MANAGEMENT\APPLICATIONSERVER\DATA\TBDB.ENG 1 Exclusive Read-only 600 8192 0 0 No Enabled 15.00 0 Available 0 0
90
November 2011
245
Example
... This example displays a list of all the databases currently listed in MASTERDB: EXHIBIT DATABASES ... The output of this command would be: APLIB DEMO1 INITIAL JUICE SMREPORT ... Specify the USE keyword to display the name of the current Use database. For example: EXHIBIT DATABASES USE ... The output of this command would be: JUICE ... Specify the WORK keyword to display the name of the current Work database. For example: EXHIBIT DATABASES WORK ... The output of this command would be: WKADMIN ... Specify the UPDATE keyword to list databases in MASTERDB that have MAXACCESS set for ... update, and are not offline or disabled. For example: EXHIBIT DATABASES UPDATE ... The output of this command would be: APLIB DEMO1 INITIAL JUICE SMREPORT
246
November 2011
UPDATEKEYS
SORTKEYS
Note: Access keys are added with the SUPERVISOR ADD ACCESS command, and removed with the SUPERVISOR REMOVE ACCESS command.
Examples
... Note: You must be logged on as SUPERVISOR in order to use this command. This example ... returns a list of read keys for the DEMO1 database:
EXHIBIT DATABASES DEMO1 READKEYS
... This example returns a list of update keys for the DEMO1 database:
EXHIBIT DATABASES DEMO1 UPDATEKEYS
November 2011
247
Note: You can also view details of user privileges in Application Server.
Examples
... This example displays a list of users for the JUICE database: USE JUICE EXHIBIT DATABASES JUICE USERS ... The output of this command would be: ADMIN INITIAL SUPER SUPERVISOR TEST1 ... This example lists users with read access to the JUICE database: USE JUICE EXHIBIT DATABASES JUICE USERS READ ... The output of this command would be: ADMIN INITIAL SUPER SUPERVISOR TEST1 ... This example lists users with update access to the JUICE database: USE JUICE EXHIBIT DATABASES JUICE USERS UPDATE ... The output of this command would be: ADMIN INITIAL SUPER SUPERVISOR ... USERS CONNECTED displays a list of the users currently connected to the database. EXHIBIT DATABASES JUICE USERS CONNECTED ... The output of this command would be:
248
November 2011
ADMIN TEST1
For example, if the Juice database has an access mode of Shared, and you type: EXHIBIT DATABASE JUICE ACCESS the system will return: SHARED
Example
... This example returns the day names in English:
EXHIBIT DAYS
Example
... This example returns the name of the member, followed by three tab-separated numbers that ... denote the number of parents, number of children, and the level of the member:
EXHIBIT DIMENSION PRODUCT DETAIL
...This example returns the number of parents, children, and the level of the member
EXHIBIT DIMENSION PRODUCT BELOW b1c1 DETAIL
Courtyard 12oz Conc. 1 0 1 Courtyard 12oz 1 0 1 Courtyard 16oz 1 0 1 Courtyard 36oz 1 0 1 Courtyard 48oz 1 0 1
November 2011
249
Application Server Command Reference EXHIBIT Courtyard 64oz 1 0 1 Courtyard 1 6 2 ...This example returns a 1 to represent that the members have parents EXHIBIT DIMENSION PRODUCT BELOW c1 POSITION BOTH PARENTS 1 UPC1B1C1 Courtyard 12oz Conc. 1 2 UPC2B1C1 Courtyard 12oz 1 3 UPC3B1C1 Courtyard 16oz 1 4 UPC4B1C1 Courtyard 36oz 1 5 UPC5B1C1 Courtyard 48oz 1 6 UPC6B1C1 Courtyard 64oz 1 ...This example returns the number 0 to show that the members do not have children EXHIBIT DIMENSION PRODUCT BELOW c1 POSITION BOTH CHILDREN 1 UPC1B1C1 Courtyard 12oz Conc. 0 2 UPC2B1C1 Courtyard 12oz 0 3 UPC3B1C1 Courtyard 16oz 0 4 UPC4B1C1 Courtyard 36oz 0 5 UPC5B1C1 Courtyard 48oz 0 6 UPC6B1C1 Courtyard 64oz 0
6.70.21 EXHIBIT DIMENSION dimension [keyword] [POSITION] [BOTH] [SORTED [REVERSE [ LONG]]] [MDXNAME] [SECURITY] [RANGE <number>-<number>] [DETAIL [CUSTOM]] [ALLHIERARCHIES] [LEVEL [FULL]]
Use
Displays information about dimensions.
Syntax
EXHIBIT DIMENSION <dimension> [<keyword>] [POSITION] [BOTH] [SORTED [REVERSE [LONG]]] [MDXNAME] [SECURITY] [RANGE <number>-<number>] [DETAIL [CUSTOM]] [ALLHIERARCHIES] [LEVEL [FULL]] Where <keyword> can be one of the following: [ SELECTED UNSELECTED INPUTS OUTPUTS RESULT TOPS LEVELS [<level>] CLASSES [<class>] DRILLTHRU
ABOVE <member> [COUNT]
250
November 2011
BELOW <member> [COUNT] JUST ABOVE <member> [COUNT] JUST BELOW <member> [COUNT] ONLY BELOW <member> [COUNT] ONLY JUST BELOW <member> [COUNT] ONLY ABOVE <member> [COUNT] ONLY JUST ABOVE <member> [COUNT]
Displays members of the specified dimension. If SET SHORT is in effect, Application Server displays the dimensions member names. If SET LONG is in effect, Application Server displays the dimensions member labels. Displays the numeric order of the dimension members. This option is not valid for the variables dimension. Note: The default selection for a dimension is ALL, meaning that Application Server selects all members.
POSITION
BOTH SORTED
Displays both short and long names for the specified dimension. The BOTH keyword ignores the SET SHORT/LONG setting, as appropriate. Sorts all the members of the dimension in alphabetical order from a to z by the short names. Note: You can sort by long names by including the BOTH and LONG keywords. Sorts all the members of the dimension in alphabetical order from z to a by the short names. Sorts the long names of the selected dimension members. When using the SORTED LONG keywords, you must also use the BOTH keyword, which displays both short and long names. For example, EXHIBIT DIMENSION product BOTH SORTED LONG. Filters the exhibited list by displaying only those items that have security applied in a Security procedure. Note: It is not necessary to use the SECURITY keyword on the SELECTED, UNSELECTED, INPUTS, OUTPUTS, RESULTS, TOPS, pattern, ABOVE, and BELOW, and variants of those keywords because the output from those keywords are already displayed based on any security applied.
REVERSE LONG
SECURITY
RANGE <number>-<number> Displays the dimension members within the range of numbers. For example, EXHIBIT DIMENSION product INPUTS RANGE 1-10 displays the first ten input members from the Product dimension. DETAIL Displays the number of parents, the number of children, and the level of each member. If you use DETAIL with the SECURITY keyword, the output will only show counts of children and parents that you are actually allowed to see according to the Security procedure. The children are only the descendents that are visible through the security definitions, recursing as deep down the hierarchy as necessary. For example if there are children directly below total_customer but those children are excluded by security, then they will not be displayed in the EXHIBIT output. The following Security procedure:
November 2011
251
Application Server Command Reference EXHIBIT CASE guest ... User can see all stores and overall totals SEL CUSTOMER INPUT SEL CUSTOMER PLUS 'TOTAL CUSTOMER' SEL SALES,COSTS endindex Would yield results like this:
SELECT Customer RESULT 1 Member of CUSTOMER Selected EXHIBIT DIMENSION Customer SELECTED DETAIL TOTAL CUSTOMER 0 3 4 EXHIBIT DIMENSION Customer SELECTED DETAIL SECURITY TOTAL CUSTOMER 0 83 4 SELECT Customer ONLY JUST BELOW Total_Customer 0 Members of CUSTOMER Selected SEL Customer ONLY JUST BELOW Total_Customer SECURITY 83 Members of CUSTOMER Selected CUSTOM Displays additional detail about whether the member is a User-Defined Hierarchy. The identifier is the last value in the detail output. A value of 0 means that it is not a User-Defined Hierarchy and a value of 1 means that the member is a UserDefined Hierarchy. Forces the EXHIBIT DIMENSION command to work on all the dimension's hierarchies. By default, the EXHIBIT DIMENSION command always works on the current hierarchy. Lists the dimensions user-defined level names. If a dimension has a level without a user-defined name, that level will not be listed unless you use the FULL keyword. If the dimension contains multiple hierarchies, it lists the user-created levels in the currently set hierarchy, in the order in which you define the levels. FULL Lists all the dimensions level names, including user-defined names and names generated by Application Server for the unnamed levels. Application Servergenerated level names have the form $<num>$<num> where the first number is the hierarchy number and the second number is the level number. Lists the selected members of the specified dimension. Lists the unselected members of the specified dimension. Lists all the dimension's input members. If the dimension contains multiple hierarchies, INPUT lists only the input members that are part of the currently set hierarchy. Lists all the dimension's output members. If the dimension contains multiple hierarchies, OUTPUT lists only the output members that are part of the currently set hierarchy. Lists the result member of the specified dimension. If a dimension contains multiple hierarchies, you cannot use RESULT because a dimension with multiple hierarchies does not have a result member. Lists the dimension's top member, which normally is the result. If the dimension has no result member, Application Server displays the first member from the highest output level. If the dimension has no outputs and no result, the first input member is displayed. If your dimensions are declared with ALLOCATE or CUSTOM statements that reserve space for additional members, you can use the keyword to display the top member of an individual dimension (EXHIBIT DIMENSION <dimname> TOP). You cannot use this keyword to get a list of the top members for all dimensions (EXHIBIT TOP and EXHIBIT TOP SELECT <setname>). Lists the dimension's levels. If the dimension contains multiple hierarchies, LEVELS returns the members of the hierarchy's level. It shows only the members of a level in the currently set hierarchy. Specify <level> if you want to display the members at that level.
ALLHIERARCHIES
LEVEL
OUTPUTS
RESULT
TOPS
LEVELS [<level>]
252
November 2011
If you use LEVEL with the SECURITY keyword, the output will only show levels that have secured members. It is not necessary to use LEVEL [level] with SECURITY because the displayed members have already been filtered by security. CLASSES [<class>] Lists the dimension's classes. Specify <class> if you want to display all the members in that class. If you use CLASS with the SECURITY keyword, the output will only show classes that have secured members. It is not necessary to use CLASS [class] with SECURITY because the displayed members have already been filtered by security. DRILLTHRU For Hybrid OLAP dimensions only. Displays the dimension members stored in Application Server, and also displays dimension members stored in Hybrid OLAP schema tables. Note: If you do not specify the DRILLTHRU keyword for a Hybrid OLAP dimension, just the members that are stored in Application Server are displayed. If you use the NO_GUESTS and MAX_GUEST_LEVEL keywords in the Dimension table and you use an EXHIBIT ABOVE | BELOW | DETAIL | PARENTS | CHILDREN keyword that accesses a member stored in the RDBMS, then the EXHIBIT command is forced to query the RDBMS to complete the command. ABOVE <member> Lists the specified member and all members in the same hierarchy above it. If you use the SECURITY keyword with ABOVE or BELOW or any of the variants of those keywords, you will get the descendants or ascendants that are accessible with security applied. Application Server will recurse through as many levels of the dimension as necessary to skip descendants/ascendants that are excluded by security to do this. For example:
type proc security index user CASE guest ... User can see all stores as well as overall totals. SEL CUSTOMER INPUT SEL CUSTOMER PLUS 'TOTAL CUSTOMER' SEL SALES,COSTS endindex EXH DIM Customer ONLY JUST BELOW Total_Customer EXH DIM Customer ONLY JUST BELOW Total_Customer SECURITY RANGE 1-10 7 Eleven - Nashua, NH Costco - Hudson, NH CVS - Lowell, MA CVS - Providence, RI Market Basket - Chelmsford, MA RITE-AID - Worcester, MA Shaw's - Framingham, MA Stop & Shop - Andover, MA Stop & Shop - Newton, MA Stop & Shop Burlington, MA
COUNT BELOW <member> Counts the number of members resulting from the EXHIBIT command. For example, EXHIBIT DIMENSION customer BELOW region COUNT. Lists the specified member and all members in the same hierarchy below it.
JUST ABOVE <member> Lists the specified member and the members of the same hierarchy one level above. JUST BELOW <member> Lists the specified member and the members of the same hierarchy one level below.
November 2011
253
ONLY BELOW <member> Lists all members in the same hierarchy below this member, but not including the specified member. ONLY JUST BELOW <member> Lists only the members in the path directly below the specified member. ONLY ABOVE <member> Lists all members in the same hierarchy above this member, but not including the specified member. ONLY JUST ABOVE <member> Lists only the member in the path directly above the specified member. HIERARCHY <hierarchy> Lists the members of the specified hierarchy, regardless of whether it is the currently set hierarchy in the dimension. FORMAT <text> | %s | %d Display the specified text with the dimensions appended in the %s location. Use %d to represent decimal output. This allows you to quickly build a set of similar commands. For example, FORMAT SELECT %s displays dimensions with the SELECT command in front of them. You can also use the syntax FORMAT %s text. You must supply the same number of placeholders that will appear in the EXHIBIT output. For example, EXHIBIT DETAIL outputs a name, the number of parents, the number of children and the level. You must supply four %s characters. CHILDREN Displays either a 0 or 1, indicating whether this member has children. 0 represents that the member does not have children. 1 represents that the member has children. If you use CHILDREN with the SECURITY keyword, the output will show a 0 or 1 depending on whether any children or parents exist and have security applied. ORPHANS PARENTS Shows the input and output members that do not have a parent (do not belong to a hierarchy) within the specified dimension. Displays either a 0 or 1, indicating whether this member has parents. 0 represents that the member does not have a parent. 1 represents that the member has a parent. Lists the dimension's members based on the specified wildcard pattern. The wildcard finds dimension member matches using the short names of the dimension member whenever the short name is present in the output (ie, whenever you use the BOTH keyword or use the SET SHORT command or use the SET SELECT NAME command). You can override this by using the MATCH LONG keyword. The wildcard finds dimension member matches using the long names if you are using the SET LONG command or using the SET SELECT LABEL command and you are not using the BOTH keyword on the EXHIBIT command. You can override this by using the MATCH SHORT keyword. MATCH SHORT MATCH LONG Allows wildcard matching to occur on the short names of dimension members. This will override any SET LONG or SET SELECT LABEL commands. Allows wildcard matching to occur on the long names of dimension members. This will override any SET SHORT or SET SELECT NAME commands.
<pattern>
Examples
... This example displays all members of the FLAVOR dimension in the JUICE database: USE JUICE EXHIBIT DIMENSION FLAVOR ... The output of this command would be: APPLE BLUEBERRY
254
November 2011
CHERRY CRANBERRY/APPLE CRANBERRY/GRAPE GRAPE GRAPE/APPLE LEMON LEMON/LIME ORANGE RASPBERRY RASPBERRY/GRAPE STRAWBERRY TOTAL FLAVOR
November 2011
255
Example
... This example displays details of all dimensions in the JUICE database: USE JUICE EXHIBIT DIMENSION FULL ... The output of this command would be: CHANNEL CONTAINER COT 4 3 4 4 84 13 24 37 6 10 2 4 6 83 13 24 36 6 6 2 6 0 18 6 6 18 0 0 0 0 1 12 0 0 12 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 2 2 2 2 4,1 4 2 2 4 6,1 10,1 2,1 4,1 5 3 5 5 0 5 0 5 5 5 5 0 0 0 0 0 0 0 0
36,9,3,1 49 7 11 5 5
STATE 10
Example
... This example displays a description of the fiscal year of your Use database, in this example, ... JUICE. The first line indicates the fiscal pattern, the second line indicates the first month in the ... fiscal year, the third line indicates the first day in the fiscal year, and the fourth line indicates if the ... database is lunar (the line is blank if the database is not lunar). USE JUICE EXHIBIT FISCAL
Example
... This example lists the existing User-Defined Hierarchies in the TEST database:
256
November 2011
USE TEST EXHIBIT GROUP ... The output of this command would be: MANAGE TEST ... This example lists the members of the MANAGE User-Defined Hierarchies in the TEST database: USE TEST EXHIBIT GROUP MANAGE FULL ... The output of this command would be: MANAGE ADMIN ROBBINST01 SMITHW01 SUPERVISOR
Example
... This example shows the number of hierarchies in all dimensions. STORES has three ... hierarchies, and both of the other dimensions have only one hierarchy:
EXHIBIT HIERARCHY
Example
... This example displays the names of the hierarchies for the PRODUCT dimension in the DEMOMH ... database, and shows the order in which the hierarchies were added: USE DEMOMH EXHIBIT HIERARCHY PRODUCT ... The output of this command would be: 1 2 PRODUCTLINE MANUFACTURER
... In the JUICE database, the PRODUCT dimension has a single hierarchy: USE JUICE EXHIBIT HIERARCHY PRODUCT
November 2011
257
Example
... In this example, PRODUCTLINE is the currently set hierarchy defined for the PRODUCT dimension in the DEMOMH database. PRODUCTLINE is the first hierarchy in the PRODUCT dimension. USE DEMOMH EXHIBIT SELECTED HIERARCHY Product ... The output of this command would be: 1 PRODUCTLINE
Example
... This example lists the indexes and their internal index ... numbers in the Use database, in this case, JUICE: USE JUICE EXHIBIT INDEXES ... The output of this command would be: 11 Container 14 Costs 8 Class of Trade 12 Flavor 10015 Margin 9 Parent 16 Quota 17 Sales 13 Size 10 State 18 Units 10019 Variance
258
November 2011
Examples
The output of this command: USE DEMO1 EXHIBIT LEVELS PRODUCT would be: 1 2 DEVICE CATEGORY
The output of this command: USE DEMO1 EXHIBIT LEVELS PRODUCT FULL Would be: 1 2 3 DEVICE CATEGORY $1$4
This example shows the levels of the second hierarchy in the PRODUCT dimension in the DEMOMH database. VENDORCLASS is the lowest level: ... The output of this command: USE DEMOMH EXHIBIT LEVELS PRODUCT HIERARCHY 2 would be: 1 2 3 DEVICE VENDOR VENDORCLASS
November 2011
259
Example
... This example displays the name of the current user: USE JUICE EXHIBIT LOGIN ... The output of this command would be: ADMIN
JUST BELOW
BELOW
<virtual_variable>
260
November 2011
EXPENSE Indicates whether the variable is an expense. FLOAT Indicates that the number of decimal places varies as required (rather than always displaying the number of places specified by the DECIMALS setting). FIXCUR Indicates whether the currency symbol is displayed at the left edge of the field, or immediately to the left (or right) of the value. FIXNEG Indicates whether the negative symbol is displayed at the left edge of the field, or immediately to the left (or right) of the value. INTEGRAL Indicates how Application Server stores the data values internally 1-, 2-, or 4-byte, or 4- or 8-byte floating point variables. JUXCUR Indicates whether the currency symbol is displayed after the value (corresponds to the REVERSE setting). LABEL Displays the long name. LINKID (Hybrid OLAP only) Displays the Link ID that Application Server uses to access data that is stored in a relational database in a Hybrid OLAP configuration. METHOD Indicates the time conversion method used to convert the variable from one periodicity to another sum (default), inclusive average, exclusive average, first value, last value, or weighted on another variable. MISSING Displays the scale, and the symbol used for missing values. NEGATIVE Displays the scale, and the negative symbol. NOCONSOLIDATE Indicates that the variable will not be consolidated by Application Server. OBSERVATIONS Displays the variable name and the number of observations. PAD Indicates whether values are padded with leading zeros to fill the WIDTH setting. PERIODICITY Displays the periodicity. POINT Displays the character used as the decimal separator. POINTLOCALE Indicates whether the locale setting is used to determine the decimal separator. PREFIX (Hybrid OLAP only) Displays the prefix of the Hybrid OLAP schema in which the data is stored. RANGE Displays the date range of the variable. RATE Indicates that the variable is a rate variable which undergoes time conversion but not consolidation. SCALE Displays the number of places by which the variable is scaled (by moving the decimal point to the left). For example, a variable with a scale setting of 1 is converted from 1000.00 to 100.00. SPARSE Indicates that the variable contains many consecutive similar values over time (for example, 10, 10, 10, 10, 5, 5, 5). Application Server uses compression to store SPARSE variables more efficiently. TYPE Displays the variable type text, numeric, or virtual. UNITS Indicates whether Application Server rounds values to the nearest whole number when performing time conversions. WIDTH Displays the maximum number of spaces a value can occupy when displayed (for example, by a LIST command). ZERO Displays the character that Application Server uses to display zeros.
Examples
... This example displays the suffix: EXH VAR TEST AFTER ... returns: VARIABLE=TEST AFTER=CAL
November 2011
261
... This example displays the thousands separator and the scale. EXH VAR COST COMMA ... returns: VARIABLE=COSTS COMMA=,
... This example indicates that COSTS uses the locale setting to determine the thousands separator: EXH VAR COSTS COMMALOCALE ... returns: VARIABLE=COSTS COMMALOCALE=Yes
... This example displays the currency symbol, and the scale: EXH VVAR PROFIT CURRENCY ... returns: VARIABLE=PROFIT CURRENCY=$ SCALE=10
... This example displays the measure name, the number of decimal places, and the scale: EXH MEA TEST DECIMALS ... returns: TEST DECIMALS=2 SCALE=10
... This example indicates that the locale setting is not used to determine the number of decimal places: EXH VAR COSTS DECIMALLOCALE ... returns: VARIABLE=COSTS DECIMALLOCALE=No
... This example displays the dimensions for COSTS: EXH VAR COSTS DIMENSIONS ... returns: VARIABLE=COSTS DIMENSION=CHANNEL, CUSTOMER, PRODUCT
... This example indicates that the TEST variable is an expense: EXH VAR TEST EXPENSE ... returns: VARIABLE=TEST EXPENSE=YES
... This example indicates that the currency symbol for the TEST measure is displayed to the left of the field: EXH MEASURE TEST FIXCUR ... returns: TEST FIXCUR=YES
262
November 2011
... This example indicates that the negative symbol for the TEST measure is displayed to the left of the field: EXH MEASURE TEST FIXNEG ... returns: TEST FIXNEG=YES
... This example indicates that COSTS is stored as a 4-byte integral variable: EXH VAR COSTS INTEGRAL ... returns: VARIABLE=COSTS BYTES=4
... This example indicates that the currency symbol for COSTS appears after the value: EXH VAR COSTS JUXCUR ... returns: VARIABLE=COSTS JUXCUR=YES
... This example displays the long name: EXH VAR COT LABEL ... returns: VARIABLE=COT LABEL=Class of Trade ... This example displays the time conversion method used for the TEST measure: EXH MEASURE TEST METHOD ... returns: TEST Sum
... This example displays the symbol used for missing values: EXH VAR COSTS MISSING ... returns: VARIABLE=COSTS MISSING=-
... This example displays the negative symbol: EXH VAR COSTS NEGATIVE ... returns: VARIABLE=COSTS NEGATIVE=-
... This example indicates that COSTS is not consolidated: EXH VAR COSTS NOCONSOLIDATE ... returns: VARIABLE=COSTS NOCONSOLIDATE=YES
... This example displays the number of observations: EXH VAR COSTS OBSERVATIONS ... returns: VARIABLE=COSTS NOBS=18
... This example indicates that leading zeros are displayed to fill the variable width: EXH VAR COSTS PAD ... returns: VARIABLE=COSTS PAD=YES
November 2011
263
... This example displays the decimal separator: EXHIBIT VAR COSTS POINT ... returns: VARIABLE=COSTS POINT=.
... This example indicates that the locale setting is used to determine the decimal separarator: EXH MEA SALES POINTLOCALE ... returns: SALES POINTLOCALE=Yes ... This example displays the date range: EXH VAR COSTS RANGE ... returns: VARIABLE=COSTS RANGE=Jan 96 - Jun 97
... This example displays the scale: EXH VAR COSTS SCALE ... returns: VARIABLE=COSTS SCALE=10
... This example indicates that QUOTA uses the SPARSE setting: EXH MEA QUOTA SPARSE ... returns: QUOTA SPARSE=YES ... This example indicates that QUOTA is numeric EXH MEA QUOTA TYPE ... returns: QUOTA VARTYPE=NUMERIC ... This example indicates that Application Server rounds values to the nearest ... whole number when performing time conversions for TEST: EXH MEA TEST UNITS ... returns: TEST UNITS=YES
... This example displays the QUOTA width: EXH MEA QUOTA WIDTH ... returns: QUOTA WIDTH=15 ... This example displays the scale, and the character used to display zeros: EXH MEA TEST ZEROS
264
November 2011
Example
... This example displays the long and short names of the COGS measure: EXH MEASURE COGS BOTH ... returns: COGS Cost of Goods
... This example displays the long and short names of the Variance virtual variable: EXH VVAR VARIANCE BOTH ... returns: VARIANCE Variance
November 2011
265
266
November 2011
Sorts the output from the EXHIBIT command. Sorts in reverse order (last to first). Sorts the long names of the measures. When using the SORT LONG keywords, you must also use the BOTH keyword, which displays both short and long names. For example, EXHIBIT MEASURE BOTH SORT LONG. When displaying data from an SAP NetWeaver BI InfoCube, this keyword exhibits the MDX measure name immediately after the Application Server short and/or long name in the output. Limits the sort to the specified range of measures between and including the first integer and the last integer. Displays nonvirtual measures. Displays the virtual or nonvirtual measures with the specific wildcard pattern. Use an asterisk (*) as a wildcard to indicate that any character can occupy that position or any of the remaining positions in the name. Displays the dimensions associated with the virtual or nonvirtual dimensions.
MDXNAME
DIMENSIONS
Example
... This example displays details of the COSTS measure in the JUICE database: USE JUICE EXHIBIT MEASURES COSTS FULL ... The output of this command would be: COSTS MON Costs No No CHANNEL, CUSTOMER, PRODUCT Yes . Yes No No No No , 4 18 No Yes Jan 96 - Jun 97 15 Yes No No No 2
... This example creates an Excludevar doc and exhibits all virtual variables and all variables ... not included in the Excludevar: USE JUICE DOCUMENT EXCLUDEVAR Costs Units Margin EXHIBIT MEASURES EXCLUDE ... The output of this command would be: Quota Sales Variance
6.70.35 EXHIBIT MEASURE FROM { <report> | <logic> | <virtual_variable> } [RECURSE] [EXCLUDE] [SORT [REVERSE]]
Parameter FROM <report> Description Displays variables from the specified report or logic set or virtual variable. Displays variables from the specified report.
November 2011
267
Examples
... This example displays a list of dimensions in the JUICE database: USE JUICE EXHIBIT DIMENSION ... The output of this command would be: CHANNEL CONTAINER COT CUSTOMER FLAVOR PARENT PRODUCT SIZE STATE ... This example lists the members of the PRODUCT dimension in the JUICE database: USE JUICE EXHIBIT MEMBER PRODUCT ... The output of this command would be: Courtyard 12oz Conc. Courtyard 12oz
268
November 2011
Courtyard 16oz Courtyard 36oz Courtyard 48oz Courtyard 64oz Summer Delight 12oz Grape Conc. Summer Delight 48oz Grape Fall Berry 24oz Cran/Apple Fall Berry 48oz Cran/Apple Fall Berry 64oz Cran/Grape Conc Fall Berry 24oz Cran/Grape Fall Berry 48oz Cran/Grape Timeless Timber 12oz Apple Timeless Timber 36oz Apple Timeless Timber 48oz Apple Grapevine Goodness 48oz Grapevine Goodness 12oz Conc Grapevine Goodness 64oz Grapevine Goodness 24oz Savory Summer 12oz Raspberry Savory Summer 16oz Raspberry Lasting Lemon 12oz Lemon Lasting Lemon 16oz Lemon Citrus Plantation 36oz Lemon Citrus Plantation 24oz Lemon Citrus Plantation 36oz Lemon/Li Citrus Plantation 24oz Lemon/Li Regatta 24oz Raspberry Regatta 24oz Raspberry/Grape Regatta 36oz Raspberry/Grape Regatta 36oz Raspberry Regatta 48oz Raspberry Warm Springs 24oz Strawberry Warm Springs 24oz Cherry Warm Springs 24oz Blueberry Courtyard Summer Delight Fall Berry Festival Timeless Timber Grapevine Goodness Savory Summer
November 2011
269
270
November 2011
Warm Springs TOTAL PRODUCT Timeless Timber 48oz Apple Timeless Timber 36oz Apple Timeless Timber 12oz Apple Timeless Timber Summer Delight 48oz Grape Summer Delight 12oz Grape Conc. Summer Delight Seltzer Water Savory Summer 16oz Raspberry Savory Summer 12oz Raspberry Savory Summer Regatta 48oz Raspberry Regatta 36oz Raspberry/Grape Regatta 36oz Raspberry Regatta 24oz Raspberry/Grape
Example
... This example displays the short month names in English:
EXHIBIT MONTHS
November 2011
271
Example
... This example displays the OEM;TBDB set: USE JUICE EXHIBIT OEM
Example
... This example displays the time periods for the variable SALES in the JUICE database: USE JUICE EXHIBIT PERIOD SALES ... The output of this command would be: Jan 96 Feb 96 Mar 96 Apr 96 May 96 Jun 96 Jul 96 Aug 96 Sep 96 Oct 96 Nov 96 Dec 96 Jan 97 Feb 97 Mar 97 Apr 97 May 97 Jun 97
PERIOD <daterange>
272
November 2011
'<dateformat>'
Any reserved letters, and any text you want to appear in the date format. The reserved letters are preceded by a percent sign (%), and are as follows: y (year), f (fiscal year), m (month), d (day), h (hour, 12-hour clock), t (hour, 24hour clock), s (am or pm), S (AM or PM), mi (minute), n (period number), and w (weekday name).The lowercase letters y, f, m, d, h, t, mi, and w indicate the starting year, month, day, and so on. The uppercase letters Y, F, M, D, H, T, MI, and W indicate the ending year, month, day, and so on.
LOCALE
Displays the months in the language in use by the operating system for French or German. If this option is not specified, the months are displayed in English.
Examples
... This example displays the monthly periods for 1997: USE JUICE EXHIBIT MONTHLY PERIOD 1997 ... The output of this command would be: Jan 97 Feb 97 Mar 97 Apr 97 May 97 Jun 97 Jul 97 Aug 97 Sep 97 Oct 97 Nov 97 Dec 97 ... This example displays the quarterly periods for 1997: USE JUICE EXHIBIT QUARTERLY PERIOD 1997 ... The output of this command would be: Jan 97 - Mar 97 Apr 97 - Jun 97 Jul 97 - Sep 97 Oct 97 - Dec 97
Examples
To display the month in alphabetic character format, use a single M. For example, '%2D %3M %2Y' gives 31 Jan 99. To display the month in numeric format, use MM. For example, '%2D %2MM %2Y' gives 31 01 99. To specify a single digit day or month, use %D or %MM without a number preceding the letters. For example, '%D-%3M-%2Y' gives 1-Jan-99. To display a 2-digit year, use %2Y. For example, '%D/%2MM/%2Y' gives 31/01/99. To display a 4-digit year, use %Y without a number preceding the Y. For example, '%Y' gives 1999.
November 2011
273
Application Server Command Reference EXHIBIT To display the full weekday name, use %W. To abbreviate the weekday name, use a number with W. For example, '%3w %2d %3m %2y' gives Tue 01 Nov 99. This table shows the default date formats for the Application Server default periodicities:
Periodicity avgytd bimonthly biweekly daily hourly lunar monthly mtd mytd qtd quarterly rmonthly rquarterly ryearly semiannual weekly wtd yearly ytd Default output 1999 Avg Jan-Feb 00 01 Jan 00 12am 30 Jan 28 Jan 00 Jan 00 Jan 00 Mtd Jan 00 Ytd Jan-Mar Qtd Jan-Mar 00 31/01/00 Jan-Mar 00 2000 Jan-Jun 00 07 Jan 00 07 Jan 00 2000 2000 Ytd Default date format %Y Avg %3m-%3M %2y %2d %3m %2y %h%s %d %m %2D %3M %2Y %3m %2y %3M %2Y Mtd %3M %2Y Ytd %3m-%3M Qtd %3m-%3M %2Y %D/%2MM/%2Y %3m-%3M %2Y %Y %3m-%3M %2Y %2D %3M %2Y %2D %3M %2Y %Y %Y Ytd
LONGEST
BOTH
SELECTED
274
November 2011
Displays the shortest, longest, or both shortest and longest periodicity for all measures that are not virtual. Displays the shortest, longest, or both shortest and longest periodicity for constant measures including attribute variables. Displays the shortest, longest, or both shortest and longest periodicity for all measures except those listed in an EXCLUDEVAR document. Displays the periodicity corresponding to the current SET <periodicity> command. If no periodicity is set, you will get "DEFAULT".
Possible periodicity output: "Bie" "Yea" "Rye" "Ytd" "Avg" "Sem" "Qua" "Rqu" "Qtd" "Aqt" "Bim" "Mon" "Rmo" "Mtd" "Amt" "Myt" "Lun" "Ltd" "Pbi" "Biw" "Wtd" "Wee" "Bus" "Dai" "Shi" "Hsh" "Hourly" "Qho" "Con" Biennial yearly Ryearly Year to date Average Year to date Semi-annual Quarterly Rquarterly Quarter to date Average quarter to date BiMonthly Monthly Rmonthly Month to date Average month to date Mytd Lunar Lunar to date PBIWeekly BIWeekly Week to date Weekly BSDaily Daily Shift Half Shift Hourly Qhourly Constant
November 2011
275
EXHIBIT SDIM FORMAT 'SEL %s RESULT' SEL CHANNEL RESULT SEL CUSTOMER RESULT SEL PRODUCT RESULT
Example
... This example displays the structural dimensions of the JUICE database: USE JUICE EXHIBIT SDIMENSION ... The output of this command would be: CHANNEL CUSTOMER PRODUCT ... This example displays full details of the PRODUCT dimension: USE JUICE EXHIBIT SDIMENSION PRODUCT FULL ... The output of this command would be: PRODUCT 37 36 18 12 1 1 4 36,9,3,1 49 5 0
276
November 2011
6.70.44 EXHIBIT QUERY [VARIABLES] { DETAILS | SETTINGS } [LINKID < LinkId>] [CUBE <cube>] [<variable>]
Use
This command dumps out a subset of the information from the SAP VARIABLES rowset that is cached in Application Server. The output appears in tab-separated form.
Syntax
EXHIBIT QUERY [VARIABLES] {DETAILS|SETTINGS} [LINKID <LinkId>] [CUBE <cube>] [<variable>]
Parameter DETAILS Description Supplies most information from the rowset with any current setting for a Variable as the last field: LINKID CUBE_NAME VARIABLE_NAME VARIABLE_CAPTION VARIABLE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH PROCESSING_TYPE SELECTION_TYPE ENTRY_TYPE REFERENCE_DIMENSION REFERENCE_HIERARCHY DEFAULT_LOW DEFAULT_HIGH DEFAULT_LOW_CAPTION DEFAULT_HIGH_CAPTION DESCRIPTION CURRENT_SETTING SETTINGS Displays a minimal set of information with any current setting added as the last field:
November 2011
277
Syntax
EXHIBIT SECURITY { <dimension> | VARIABLES | LEVELS | VIEWERFORMAT | FORMAT %s <text> %d | <pattern> } [EXCLUDE] [FULL]
Parameter <dimension> VARIABLES LEVELS Description Displays a 0 if this dimension does not have security applied in a Security procedure. Displays a 1 if this dimension does have security applied. Displays a 0 if any of the variables do not have security applied in a Security procedure. Displays a 1 if any of the variables do have security applied. Shows three columns of information: a count of the number of hierarchies in a dimension, the dimension name, and a 0 or 1 for whether the dimension has security applied in a Security procedure. It displays a 0 if the dimension does not have security applied, and displays a 1 if the dimension does have security applied. This example output shows that all dimensions have one hierarchy, and the Product dimension has security applied:
Displays the following tab-separated columns of information for each dimension: Column Description 1 2 3 4 5 6 7 8 9 10 11 12 13 Dimension name Maximum number of input members Actual number of inputs Maximum number of outputs Actual number of outputs Maximum number of result members (0 or 1) Actual number of result members (0 or 1) Number of levels Comma-separated list showing the number of members in each level (ordered from input to result) Number of selected members Maximum number of User-Defined Hierarchies Actual number of User-Defined Hierarchies Whether the dimension has security applied. (0 if no security applied, 1 if security is applied).
278
November 2011
VIEWERFORMAT
Displays the dimension, then its default member that would be displayed in any Viewer dialog box, and then either a 0 or 1 depending on whether the dimension has security applied. It displays a [0] if the dimension does not have security applied in a Security procedure, and displays a [1] if the dimension does have security applied. Checks for the existence of a document set called EXCLUDEDIM in the Use database; the document specifies a list of dimensions that should be excluded from the EXHIBIT list. The resulting list shows the dimensions not excluded from the EXCLUDEDIM document set, and also includes a 0 or 1 for whether the dimension has security applied. For example, assume an EXCLUDEDIM document contains the Channel dimension and State attribute. The result list shows all dimensions and attributes except Channel and State, and includes whether there is security applied to that dimension:
EXCLUDE
EXHIBIT SECURITY EXCLUDE CONTAINER 0 COT 0 CUSTOMER 0 FLAVOR 0 PARENT 0 PRODUCT 1 SIZE 0
FORMAT %s <text> %d Displays each dimension, the text to append to each dimension, and also displays a 0 or 1 for whether the dimension has security applied. For example:
EXHIBIT SECURITY FORMAT '%s security %d' CHANNEL security 0 CONTAINER security 0 COT security 0 CUSTOMER security 0 FLAVOR security 0 PARENT security 0 PRODUCT security 1 SIZE security 0 STATE security 0
<pattern> Specifies a wildcard pattern that displays the dimensions that match the pattern and whether the dimensions have security applied. Use an asterisk (*) in a name as a wildcard that indicates that any character can occupy that position or any of the remaining positions in the name. The output displays the dimension name and then a 0 if the dimension does not have security applied, and displays a 1 if the dimension does have security applied. In this example, the c* wildcard pattern is used to return the following results:
EXHIBIT SECURITY c* CHANNEL 0 CONTAINER 0 COT 0 CUSTOMER 0 EXHIBIT SECURITY p* PARENT 0 PRODUCT 1
November 2011
279
Examples
... This example displays a list of procedures in the JUICE database: USE JUICE EXHIBIT PROCEDURE FROM JUICE ... The output of this command would be: CUSTOMER MBJUICE PRODUCT ... This example displays a list of reports in the DEMOMH database: USE DEMOMH EXHIBIT REPORT FROM DEMOMH ... The output of this command would be: EXAMPLE REGIONVAR REPVAR REPVAR2 TRENDVAR
280
November 2011
The latest time period specified by a SET LATEST command. Selected variables. Dimension names, the selected members, and the top member of each dimension.
Example
... This example displays the structure of the JUICE database:
USE JUICE EXHIBIT STRUCTURE ... The output of this command would be: USE SET JUICE LONG DEFAULT NONE Mon 31 Oct 1996 'Container' DOWN VARIABLES TOTAL CHANNEL
VARIABLES TIME
ACROSS
...DIM CHANNEL SEL CHANNEL #3 ...DIM CUSTOMER SEL CUSTOMER #1 ...DIM PRODUCT SEL PRODUCT #1
7 Eleven - Nashua, NH
Displays the top member for each dimension in the format: Dimension \t Top Member
Parameter TOPS Description Lists the dimension's top member, which normally is the result. If the dimension has no result member, Application Server displays the first member from the highest output level. If the dimension has no outputs and no result, the first input member is displayed. Note: This command produces the same result as EXHIBIT DIMENSION <dimension> TOP. FORMAT <formatstring> Formats the output according to the specified <formatstring>. You can embed other text and punctuation in the format string, and must specify a "%s" for every token in the output string. Note: If SET SHORT is in operation, the short names include an underscore. If SET LONG is in operation, the underscore is removed from the name. POS Displays the position of the top member within the dimension in the format: Dimension \t Hash Number \t Top Member
November 2011
281
Examples
... This example displays and selects the top members of all dimensions in the JUICE database: USE JUICE EXHIBIT TOPS ... The output of this command would be: CHANNEL CUSTOMER PRODUCT TOTAL CHANNEL TOTAL CUSTOMER TOTAL PRODUCT
... This example displays and selects the top members of all dimensions in the JUICE database, and ... formats the output using the string "%s '%s'": USE JUICE EXHIBIT TOPS FORMAT "%s '%s'" ... The output of this command would be: CHANNEL 'TOTAL CHANNEL' CUSTOMER 'TOTAL CUSTOMER' PRODUCT 'TOTAL PRODUCT'
Example
... This example displays the number of commands executed in the current session: EXHIBIT TRANSACTION ... The output of this command would be: 15
282
November 2011
Example
... This example displays details of all the users in MASTERDB: EXHIBIT USER FULL ... The output of this command would be: ADMIN 1 17:29:58 2000 Supervisor Logged in 2000/04/03 07:55:19 JUICE Exclusive WKADMIN 10000 8192 TEST,MANAGE Supervisor WKINIT 10000 Enabled 2000/04/02 15:28:10 4096 TBDB 0 2000 1 2000 1 1 2000/04/02 TBDB 0 INITIAL
... This example displays details of the ADMIN user: EXHIBIT USER ADMIN FULL ... The output of this command would be: ADMIN 1 17:29:58 2000 Supervisor Logged in 2000/04/03 07:55:19 JUICE Exclusive WKADMIN 10000 8192 TEST,MANAGE 2000/04/02 TBDB 0
JUST BELOW
BELOW
<virtual_variable>
6.70.52 EXHIBIT VARIABLE [<variable> [<value>]] [BOTH] [SORT [REVERSE [LONG]] [MDXNAME] [RANGE <integer> - <integer>] ]
Parameter VARIABLE Description Displays the names of all variables, virtual variables, and attributes.
November 2011
283
MDXNAME
RANGE
CONVERT BEFORE | AFTER Returns information about the SET VARIABLES CONVERT settings. It is only relevant for virtual measures. For example, EXHIBIT VARIABLE <variable> CONVERT gives the result: VARIABLE= <variable> CONVERT= BEFORE.
6.70.54 EXHIBIT VARIABLE FROM { <report> | <logic> | <virtual_variable> } [RECURSE] [EXCLUDE] [SORT [REVERSE]]
Parameter FROM <report> <logic> <virtual_variable> RECURSE Description Displays variables from the specified report or logic set or virtual variable. Displays variables from the specified report. Displays variables from the specified logic set. Displays variables from the specified virtual variable. Displays the variables referenced in the logic, report, or virtual variable. If a virtual variable is used in the specified logic, report, or virtual variable, then RECURSE also displays the variables that compose that virtual variable. Sorts the variables in alphabetical order from a to z. Reverses the sort order of variables so they are listed from z to a. Displays the specified variables, and omits hidden variables.
284
November 2011
Example
... This displays details of all variables in the JUICE database that are similar to the SALES variable: USE JUICE EXHIBIT VARIABLE LIKE SALES ... The output of this command would be: Costs Margin Quota Sales Units Variance ... This example displays details of the SALES variable: USE JUICE EXHIBIT VARIABLE SALES ... The output of this command would be: VARIABLE=SALES PERIODICITY=MON LABEL=Sales BYTES=4 NOCONSOLIDATE=YES DIMENSIONS=CHANNEL, CUSTOMER, PRODUCT NOBS=18 RANGE=Jan 96 - Jun 97 WIDTH=15 DECIMALLOCALE=No DECIMALS=2 POINTLOCALE=Yes POINT=.
November 2011
285
Example
... This example lists all variables and attributes in the DEMOMH database: USE DEMOMH EXHIBIT VARIABLES ... The output of this command would be: Cost of goods Margin Margin % Price Sales Standard Cost Units ... This example creates an Excludevar doc and exhibits all attributes and virtual variables, and ... any variables not included in the Excludevar:
286
November 2011
USE JUICE DOCUMENT EXCLUDEVAR Costs Units Margin EXHIBIT VARIABLES EXCLUDE ... The output of this command would be: Container Class of Trade Flavor Margin Parent Quota Sales Size State Variance
Note: You cannot use the EXCLUDE keyword when using EXHIBIT for a single virtual variable. ... This example lists the virtual variables in the JUICE database: USE JUICE EXHIBIT VVARIABLE ... The output of this command would be: Margin Variance ... This displays the long and short names of the MARGIN virtual variable in the JUICE database: USE JUICE EXHIBIT VVARIABLE MARGIN BOTH ... The output of this command would be: MARGIN Margin
... This example creates an Excludevar doc and exhibits all attributes and virtual variables, and ... any variables not included in the Excludevar:
November 2011
287
6.70.58 EXHIBIT VVARIABLE [<vvarname>] { [options] [LOGIC] [EXCLUDE] | COMPILE] | FORMAT '<%s text>'}
Displays virtual variable properties.
Parameter <vvarname> <options> LOGIC EXCLUDE FORMAT <text %s> Description Specifies the virtual variable. If you do not specify a virtual variable, all virtual variables in the database are listed. Specifies the usual options available with measures and variables. Displays the virtual variable name followed by the formula for the virtual variable. Displays a list of all virtual variable properties, and excludes any virtual variables listed in the Excludevar document, if one exists. Generates a command line for virtual variables based on the text string. For example, you can use the following command to recompile hidden logic sets used by virtual variables: EXHIBIT VVARIABLE FORMAT "Compile Logic '% % %s' " COMPILE Generates a command line to recompile the hidden virtual logic in virtual variables. This keyword always uses the short name of the virtual variable regardless of any SET SHORT/LONG setting.
Example
... This displays the details of the virtual variables in the JUICE database, including the formulas: USE JUICE EXHIBIT VVARIABLE LOGIC ... The output of this command would be: Margin Sales - Costs Variance Sales - Quota
Rules
Hierarchies are numbered by the order in which they were defined in the CONSTRUCT command. The first HIERARCHY statement creates a hierarchy whose number is 1. The second HIERARCHY statement creates a hierarchy numbered 2. If a dimension does not have multiple hierarchies, Application Server considers it to have one hierarchy. A dimension's default hierarchy is the one defined in the first HIERARCHY statement of the CONSTRUCT command. You can set a different hierarchy with the SET command.
288
November 2011
6.71 EXIT
Use
EXIT temporarily suspends an Application Server session. When you enter EXIT, Application Server executes a procedure named EXIT (located in the database) before exiting. When you enter EXIT CLEAR, Application Server executes procedures named EXIT and EXITCLEAR (if found in the database) before exiting. During an EXIT CLEAR, any across/downs, set periods, periodicities, variable, and dimension selections are removed. Note: When MAXLOGINS>1, a new Work database is always created when you log in or switch to a user. Any previous Work database is not used on a restart or a SWITCH command, so the current Work database is considered discardable.
Syntax
EXIT [KEEP] [CLEAR] Parameter EXIT Logged in with MAXLOGIN>1 SWITCH WORKDB used in session SWITCH WORKDB not used in session EXIT KEEP Logged in with MAXLOGIN>1 SWITCH WORKDB used in session SWITCH WORKDB not used in session EXIT CLEAR Logged in with MAXLOGIN>1 SWITCH WORKDB used in session SWITCH WORKDB not used in session EXIT KEEP CLEAR Logged in with MAXLOGIN>1 SWITCH WORKDB used in session Keeps the previous Work databases and clears the current Work database. Logged in with MAXLOGIN=1 Keeps the previous Work databases and clears the current Work database. Clears the previous Work databases and the current Work database. Clears the current Work database. Logged in with MAXLOGIN=1 Clears the previous Work databases and the current Work database. Clears the current Work database. Keeps the previous Work databases and clears the current Work database. Clears the current Work database. Logged in with MAXLOGIN=1 Keeps the previous Work databases and the current Work database. Keeps the current Work database. Clears the previous Work databases and the current Work database. Clears the current Work database. Logged in with MAXLOGIN=1 Clears the previous Work databases and the current Work database. Keeps the current Work database. Description
November 2011
289
Example
...This returns you to the host operating system. When you log in to Application Server again, data ... in the temporary workspace from previous login will be in the same state as when you exited. EXIT ...This example returns you to the host operating system. Application Server deletes all the ...data from your temporary workspace. EXIT CLEAR
6.72 EXP( )
Use
EXP returns the value of e(2.71828...) raised to the specified power.
Syntax
CALCULATE <result> = EXP(<power>) Parameter <result> <power> Description Name of the result variable. Power of e.
6.73 EXTEND
Syntax
EXTEND <database> <blocks>
Use
EXTEND increases the size of a database.
Parameter <database> <blocks> Description Name of the database to be extended. Number of blocks to add to the database. Note: Application Server does not preallocate blocks; it uses them as needed. This means that it does not set aside a fixed number of blocks of disk space when you specify a database. This block value is the size that the database is not allowed to exceed. You should check the availability of disk space when you specify a block size and monitor availability when using the database. For example, you could specify a database of a certain size, slowly fill that database, and run out of disk space before you reach your specified maximum.
EXTEND - Rules
You can only extend a database that you have attached as Update Exclusive. When you enter an EXTEND command for a partitioned database, Application Server compares the new size with the partition information in MASTERDB. If you extend the database to a size that is larger than the size of the partitions, you get an error message. You can then add partitions using the CHANGE DATABASE command.
290
November 2011
Example 1: EXTEND
...This example increases the size of the database BUDGET by 200 blocks: EXTEND budget 200
Example 2: EXTEND
...This example detaches a database to increase the number of database partitions. Because the new ... database partitions exceed the database's BLOCKS specification, Application Server uses the ... database and then extends it so that the database size equals the increased partition sizes. DETACH Accnt CHANGE DATABASE Accnt ADD 2 PARTITIONS SIZES 40K, 20K ...The output of this command would be: Warning: The Number of Blocks Specified in the PARTITION SIZES (120000) for Database ACCNT is Larger than the BLOCKS specified. Database: ACCNT Maxaccess: UPDATE Disposition: ENABLED Current State: Available Protection Key: None Last user: Last access:
Blksize: 8192 Observations 500 Maxblocks: 60000 Number Free: 59990 Database ACCNT Partition Information. Number of Partitions: Blocksize: 5 8192 Thu Feb 9 15:34:10 2000 Thu Feb 9 15:34:10 2000
Date Last Opened for Update: Date Last Closed After Update: Partition 1 2 3 4 5 USE Accnt EXTEND Accnt 60000 SHOW DATABASE Size Name 20000 ACCNT01 20000 ACCNT02 20000 ACCNT03 20000 ACCNT04 20000 ACCNT05
...The output of this command would be: USE Database: ACCNT Max. Obs: 500 Access ----------WKADMIN TBDB ACCNT UPDATE READ UPDATE Maxblocks % Available ------------- ------------2000 400 120000 Mode
November 2011
291
Syntax
EXTEND <integer> Parameter <integer> Description The number of blocks to add to MASTERDB. Note: If there is not enough disk space to add the specified number of blocks, Application Server lowers the integer value to an acceptable number of blocks.
Example
...This example increases the size of MASTERDB by 25 blocks: EXTEND 25
Syntax
FOOTNOTE . . <footnote specifications> . ENDFOOTNOTE
Example
...The following block produces the following footnote at the bottom of each page: FOOTNOTE TEXT 'Note: Consolidated figures do not include special charges.' ENDFOOTNOTE Note: Consolidated figures do not include special charges.
6.76 FOR
Use
FOR restricts the periods in a logic statement. It can appear to the right, left, or both sides of an equal (=) sign.
Syntax
FOR {<n> [ -<n>] } {LATEST [PLUS <m> | MINUS <m> ] } {LAST [PLUS <m> | MINUS <m> ] }
292
November 2011
Description A period number in the range: 1, 2, ..., LAST. Indicates the period is the last period in the selected date range. Indicates the period <m> periods after the specified period. Number of periods before or after the last or latest period. Indicates the period is the one defined as the latest period for which data is available. Indicates the period <m> periods before the specified period.
Rules
FOR always refers to the expression that precedes it. FOR can only restrict execution within a date range; it cannot expand the range. FOR to the right of an equal sign only restricts the basis for evaluating the expression. It has no effect on which result values Application Server changes. FOR to the left of an equal sign only restricts the periods into which the results of the expression to the right of the equal sign are stored. It has no effect on the periods used to evaluate the expression.
Example
...The following statement performs a projection of the average sales during the period 1 ...through latest into the future periods latest plus 1, latest plus 2, ..., last: CALCULATE Sales FOR LATEST PLUS 1 - LAST = MEAN(Sales) FOR 1 - LATEST
Syntax
FORCE <name>
November 2011
293
Syntax
FREE {USER <user>[<session>] | DATABASE <database> | * } Parameter USER <user> <session> DATABASE <database> * Description Frees specified users and their Use database. Name of the user. The session number. This frees sessions other than the first for a multiple login. Use this for users defined with a MAXLOGINS greater than 1. Frees the specified database. Name of the database. Forces all users to start a new session, even if they only logged out with an EXIT. This command would be used by a system administrator who had rolled out a new release under instructions to use this command from the installation notes. This option implies that the format of the Work database has changed.
Notes: Never use the FREE command when someone else is logged in. The effect is to clean out MASTERDB, so if someone else is logged in, errors may occur. If a user is in the Supervisor subsystem, and you enter FREE USER for that user, Application Server terminates the user's session and all work from that session will be lost.
Examples:
...This example changes the login state for the user John from On to Enabled, ...and changes the state of his Use database to AVAILABLE: SHOW USER John ...The output of this command would be: User: JOHN Use Database: RESRCH Temp Database: DB220266 Blocks: 700 Blksize 2048 Buffers: 300 Library Database: TBDB Security Level: 0 Login State: On Last Login: FREE USER John Wed Apr 8 15:17:41 2000
294
November 2011
...The output of this command would be: Database: RESRCH Maxaccess: UPDATE Disposition: ENABLED Current State: AVAILABLE Protection Key: None Last user: John Blksize: 2048 Maxblocks 700 Number Free 458 User: JOHN Use Database: RESRCH Temp Database: DB220266 Blocks: 700 Blksize 2048 Buffers: 300 Library Database: TBDB Security Level: 0 Login State: Enabled Last Login: Wed Apr 8 15:17:41 2000 Last access: Wed Apr 8 16:48:17 2000
...If your system crashes, database records in MASTERDB might indicate that a database in the ... system is in use even after the system becomes operational. This example shows the changes in ... the current state of the database FIN1 from IN USE (UPDATE) to AVAILABLE: SHOW DATABASE fin1 ...The output of this command would be: Database: FIN1 Maxaccess: UPDATE Disposition: ENABLED Current State: IN USE (UPDATE) Protection Key: None Last user: FIN1 Last access: Sun Mar 8 08:08:08 2000 Blksize: 2048 Maxblocks 200 Number Free 97 FREE DATABASE fin1 ...The output of this command would be: Database: FIN1 Maxaccess: UPDATE Disposition: ENABLED Current State: AVAILABLE Protection Key: None Last user: FIN1 Last access: Sun Mar 8 08:08:08 2000 Blksize: 2048 Maxblocks 200 Number Free 97 ...This example frees sessions other than the first for a multiple login. ...You would use this for a user defined with a MAXLOGINS greater than 1. FREE USER MANYLOG(4)
November 2011
295
Syntax
GET ENVIRONMENT <shell_variable> <control_variable> Parameter <shell_variable> Description External shell variable whose value will be used for the PAS control variable. On UNIX, the <shell_variable> name is case-sensitive but on WinX it is not (the code always upper cases the <shell variable name>. On UNIX, the shell variables are real UNIX shell variables. On WinX the shell variables are entries in the [Windows] section of lsserver.ini. Note: If the external shell variable does not exist, then the control variable is set to an empty value. You can view control variables using the SHOW CONTROL command. <control_variable> Name of the PAS control variable that will have the value of the shell variable.
Example
This is an example of using GET ENVIRONMENT on a WinX machine: System> SHOW CONTROL Control Variable ----------------------LIBRARY DATABASE SID WORKDATABASE Value -------TBDB Windows WKADMIN
System> GET ENVIRONMENT dbpath path1_cv System> SHOW CONTROL Control Variable ----------------------LIBRARY DATABASE PATH1_CV Value -------TBDB
C:\Program Files\SAP BusinessObjects\Strategy Management\InternetPub\Procs;C:\Program Files\SAP BusinessObjects\Strategy Management\ApplicationServer\home;C:\Program Files\SAP BusinessObjects\Strategy Management\ApplicationServer\data Windows WKADMIN
SID WORKDATABASE
Syntax
HEADING . . <heading specifications> . ENDHEADING
296
November 2011
Example
...The following block: HEADING TITLE 'KMS International' TITLE '2000 Profit And Loss Report' UTEXT ENDHEADING ...produces the following heading at the top of each page: KMS International 2000 Profit And Loss Report -------------------------------------------------------
Syntax
HIERARCHY <hierarchy> . LEVEL <field> [ ,..,<field> ] Parameter <hierarchy> Description Name of the hierarchy as defined in the CONSTRUCT <dimension> HIERARCHY <hierarchy> command. You can have up to eight HIERARCHY statements in a dimension. Note: The default hierarchy is the one defined in the first HIERARCHY statement. You can set a different hierarchy using the SET command. LEVEL <field> One or more field names, separated by commas. Each field represents a level of the hierarchy. The first <field> represents input members, the next <field> represents the first level of output members, and so on. Member names cannot be more than 24 alphanumeric characters.
Example
...This example shows two HIERARCHY statements in the dimension set. The first hierarchy, called ... REGIONS, contains two levels, Store and Sales_Region. The second hierarchy, called STATES, ... contains three levels, Store, State, and Geo_Region: HIERARCHY REGIONS LEVEL STORE ,SALES_REGION
November 2011
297
298
November 2011
6.82 IF-OTHERWISE
Use
IF-OTHERWISE assigns a value to a variable if a condition is either true or false.
Syntax
<variable> IF <condition> = <expression> [IF <condition> = <expression> . .] [OTHERWISE = <expression>] Parameter <variable> IF Description Name of a variable. Variable names that use special characters should be in single quotation marks (' '). Indicates a conditional block. If the condition is true, assigns the value of the expression to the variable. If the condition is false, proceeds to the next conditional block (if it exists) or to the OTHERWISE block (if it exists). If none of the conditions is true and there is no OTHERWISE block, the value of the variable is unchanged. A logical condition using any arithmetic or logical operators. An arithmetic expression. Indicates a conditional block. If all previous conditions are false, assigns the value of the expression to the variable.
Example
...This example assigns values to the variable Commission, depending on the value of Sales: Commission IF Sales GT 1000 = .2 IF Sales GT 500 = .15 IF Sales GT 250 = .125 OTHERWISE = .1
Syntax
<variable> {IN|OF} <dimension> <member> [...{IN|OF}<dimension> <member>] <variable> FROM <database> <variable> VERSION <version>
November 2011
299
Examples
...You can use commands like the following in logic sets: Sales OF Product Cars IN Region Buffalo FROM corpdb VERSION optimistic ...In some financial models you need to allocate a cost at a consolidated level of an organization to ... the input levels of the organization. For example, you can report overhead costs in a corporation ... at the corporate level, but allocate them to the lowest levels of the organization on the basis of ... their revenue as a percentage of total corporate revenue. IN and OF allow you to allocate costs in ... this way. Assume you have the following Company dimension: INPUT east, west, north, south OUTPUT northwest, southeast RESULT corporate northwest = SUM north, west southeast = SUM south, east corporate = SUM northwest, southeast ...You also have the variables Revenue and Overhead dimensioned by Company, and an ... undimensioned variable Corpoverhead.To allocate the corporate overhead, you first enter data ... values for Corpoverhead. Then enter the revenue in the input sections of the dimension. Next use ... CONSOLIDATE to consolidate the revenue. Finally, in a logic, you might have this expression: Overhead = (Revenue / Revenue IN Company Corporate)*Corpoverhead ...When you calculate the logic, Application Server takes the revenue in each member of the ... dimension, and divides that figure by the consolidated revenue in the corporate member. ... Application Server then multiplies that figure by Corpoverhead. This calculated overhead figure is ... then put in the variable Overhead as the current member.
6.84 INDEX-CASE-ENDINDEX
Use
INDEX-CASE-ENDINDEX executes logic statements for the specified dimension members.
Syntax
INDEX <dimensions> CASE <members> . . <statements> . [CASE members . . <statements>
300
November 2011
.] ENDINDEX Parameter INDEX <dimensions> CASE <members> <statements> ENDINDEX Description Indicates the start of an INDEX block. You can specify the dimensions to use when evaluating a CASE statement. One or more dimension names separated by commas. Executes the block of statements if the specified members are members of the dimensions in the INDEX statement. Name of one or more members, classes, or levels separated by commas. You can use an asterisk (*) to indicate any member name (default). A sequence of statements or commands. Indicates the end of an INDEX block.
Example
...In this example, two constants, Erg Ratio and Msr Ratio, are set to ...specific values depending on the values of their dimensions, which are Product and Company: INDEX Company, Product CASE GM, Cars Erg Ratio = 3.61 Msr Ratio = 0.85 CASE Ford, Trucks Erg Ratio = 2.55 Msr Ratio = 0.98 CASE , Erg Ratio = 3.02 Msr Ratio = 0.88 ENDINDEX ...INDEX-CASE-ENDINDEX sets Erg Ratio and Msr Ratio to specific values ...for the combinations GM, Cars and Ford, Trucks. Otherwise, their values are 3.02 and 0.88.
Syntax
INDEX USER . CASE {<user> | <group> | *}
November 2011
301
Rules
The Security procedure executes each time that you use or attach the database. If a user belongs to multiple groups, Application Server uses the first CASE statement that matches the user's name or any group the user is a member of to provide the restricted view. A user or group with the same name as the Use database is the Security procedure administrator. That user or all users in the group can edit the Security procedure. For example, if you are adding a Security procedure to the DEMO database, any user who is a member of a group named Demo or any user named Demo can edit the Security procedure. The following users have an unrestricted view of all dimensions: Any user with the same name as the database. Any group of users with the same name as the database. Any user you have omitted from all groups and from all CASE statements in a Security procedure. If you specify a CASE statement that executes a SELECT <dimension> NONE for each dimension, Application Server restricts the user or group specified in the CASE from all dimensions. If you specify CASE *, Application Server restricts all users whom you have not assigned to a group from all dimensions.
Example
...This example defines the Security procedure for the Demo database: INDEX USER CASE Eastmgr ... Specifies the view for the Eastmgr group
302
November 2011
SELECT Region Below East SELECT Type Budget SELECT Product Outputs CASE DEMO ... DEMO group users are administrators; they can edit the procedure. ... All members of group DEMO get full dimension access. ... Nothing is selected at the time a database is attached or used. CASE FINANCE ... Specifies the view for the Finance group SELECT Region South SELECT Product Inputs SELECT Type Actual CASE * ... Restricts all dimension views for all other users. SELECT Product NONE SELECT Region NONE SELECT Type NONE ENDINDEX ... This example shows how to restrict the view of an attribute. It defines ... which Customers the users in the West group can see, and as a result, ... which members of the attribute State: INDEX USER CASE West ... Specifies the view for the West group SELECT Customer where State is CA SELECT Customer plus where State is OR SELECT Customer plus where State is WA ENDINDEX
Syntax
INPUT . . <member> [ '<label>' ] .
November 2011
303
Example: INPUT
INPUT '80286' '286 Chip', '80287' '287 Chip', '80386' '386 Chip' OUTPUT ...
6.87 INT( )
Use
INT rounds to the nearest integer.
Syntax
CALCULATE <result> = INT(<variable>) Parameter <result> Description Name of the result variable.
304
November 2011
<variable>
Name of the variable whose data you want rounded to the nearest integer. Variable names that use special characters should be in single quotation marks (' ').
Example
...This example returns a value of -4: b = -4.1 CALCULATE a = INT(b)
6.88 IRR( )
Use
IRR returns a Scalar value for the internal rate of return. Application Server calculates the rate relative to the first payment.
Syntax
CALCULATE <returnrate> = IRR(<amt1>, <date1>, <amt2>, <date2>, ..., <amtn>, <daten>) Parameter <returnrate> <amtn> <daten> Description Name of the result variable with the scalar internal rate of return. Value of the <n>th payment, where <n> = 1 to total payments. Date of the <n>th payment, where <n> = 1 to total payments.
6.89 IS
Use
IS references the period of the current observation.
Syntax
DAY IS <day> MONTH IS <month> QUARTER IS <quarter> <variable> IS {RATE | EXPENSE} YEAR IS <year> Parameter DAY IS <day> MONTH IS <month> QUARTER IS <quarter> <variable> Description Indicates the period is a day. Name of a day: Sunday, Monday, ..., Saturday. Indicates the period is a month. Name of a month: January, February, ..., December. Indicates the period is a quarter. Name of a quarter: first, second, third, or fourth. Name of the variable being consolidated (used only in dimensions). Variable names that use special characters should be in single quotation marks (' '). Can be used with the following: RATE - Declares the variable as a rate variable with SET VARIABLE. EXPENSE - Declares the variable as an expense variable with SET VARIABLE. YEAR IS <year> Indicates the period is a year. A numeric year format, for example, 1999.
November 2011
305
Example
...This example sets the variable Discount to .10 in 1999 and to .07 in other years: WHEN year is 1999 Discount = .10 ELSE Discount = .07 ENDWHEN ...This expression (in a dimension) reverses the sign of the Variance for Expense variables: WHEN variable IS Expense Variance = Budget - Actual ELSE Variance = Actual - Budget ENDWHEN
6.90 JOB
Use
JOB executes the commands in a procedure or in an external file, and displays them on your screen when Application Server executes them.
Syntax
JOB <procedure> <setname>[;<database>] | <filename>[;EXTERNAL} [RESOLVE ] Parameter <setname> <procedure> <filename> <database> EXTERNAL RESOLVE Description Name of a set, such as a logic set or a dimension set. Name of a procedure. If you do not specify a name, Application Server uses the default procedure (if defined), or the last procedure you edited. Name of an external file that the SUPERVISOR DUMP command creates that contains user and database information about MASTERDB. Name of the database where the procedure is located. If you do not specify a database, Application Server uses your Use database. Indicates the procedure is a text file that is not in an Application Server database. If you specify this parameter, Application Server recompiles the procedure before executing it. This ensures that Application Server uses the current value of control variables in the set.
Remarks
If you omit the ;EXTERNAL keyword and the ;<database> parameter, Application Server searches for a set named <setname> within the Use database. If a set named <setname> is not found, Application Server searches for an external file.
Example
...This example executes the MERCHSEL procedure, which selects a ...dimension and variable and defines a time period and the across/down dimensions: JOB merchsel ...Application Server writes the following commands to the output stream: SELECT Merchandise
306
November 2011
SELECT Sales SET monthly period 90 ACROSS Variables, Time DOWN Merchandise ...This example execute the DOS/Windows file c:\myjob: JOB c:\myjob
Syntax
KEY [ BOTH ] Parameter BOTH Description Creates an index based on both dimension member names and labels.
Rules
You can add the KEY BOTH keyword to the first line of the Dimension editor for the specified dimension. You can also add KEY BOTH using the PREFACE keyword in the CONSTRUCT command. You can remove the indexes created during a KEY BOTH by removing the keyword from the Dimension editor and then recompiling the dimension.
Example
...This example shows how KEY BOTH is added to the first line in the Dimension editor. When ... Application Server compiles the dimension, it will be keyed. Selecting dimension member names ... or labels is optimized because the dimension is keyed. KEY BOTH ALLOCATE 100, 10, 1 INPUT ACME_MFG 'Acme Manufacturing' ,AZTEC_MACH_TOOL 'Aztec Machine Tools'. . .
November 2011
307
Syntax
KILL [CONNECTED [TO] <database>] [USER] <username>[(<session>)] | [PROCESS] <processid> Parameter [USER] <username> <session> Description Terminates all users connected to the specified <database>. The name of the user session to terminate. The session number. Note: You cannot terminate a non-client/server session.
Examples
...This example terminates the user ADMIN: KILL USER ADMIN This example terminates the operating system process 13567: KILL 13567
6.93 LAG( )
Use
LAG moves data to the right by the specified number of time periods.
Syntax
CALCULATE <result> = <variable> LAG <number> Parameter <result> <variable> Description Name of the result variable. Name of the variable containing data you want to move. Variable names that use special characters should be in single quotation marks (' '). Note: Virtual
variables calculated with time based functions like LAG, LEAD, MOVING, MOVING2, and PERCHG should be used with caution. These measures can be displayed with Application Server's standard and to-date time periodicities but errors will result when a time set is used in place of time.
<number> Number of time periods to move data to the right.
Example
...EXAMPLE 1: Consider the following statement: CALCULATE Tax Paid = Tax Due LAG 1 ...The results in a report that prints Tax Due and Tax Paid look like: Tax Due Tax Paid 135 ---142 135 168 142 129 168
...EXAMPLE 2: This separate example assumes the following data for a variable called Myvar: Myvar 200 300 400 500
...The following command moves Myvar data one column to the right: CALCULATE Myvar = Myvar LAG 1 ...Myvar data now appears as follows: Myvar ---200 300 400
308
November 2011
6.94 LAST( )
Use
LAST returns a value from a previous period.
Syntax
CALCULATE <result> = <variable> LAST <period> Parameter <result> <variable> <period> Description Name of the result variable. Name of the variable containing data you want to retrieve. Variable names that use special characters should be in single quotation marks (' '). The period for which you want a value: year (default), quarter, month, or week.
Example
...This example defines Growth as the value of Sales minus the value of Sales Last Year: CALCULATE Growth = Sales - Sales Last Year
6.95 LATEST
Use
LATEST returns the position of the latest month, week, day, and so on, in the fiscal year.
Syntax
LATEST <periodicity> Parameter <periodicity> Description The period you want returned: quarter, month, week, day, and so on. If you use MONTH, Application Server returns the values 1-12.
6.96 LEAD( )
Use
LEAD shifts data to the left by the specified number of periods.
Syntax
CALCULATE <result> = <variable> LEAD <number> Parameter <result> <variable> Description Name of the result variable. Name of the variable containing data you want to shift. Variable names that use special characters should be in single quotation marks (' '). Note: Virtual
variables calculated with time based functions like LAG, LEAD, MOVING, MOVING2, and PERCHG should be used with caution. These measures can be displayed with Application Server's standard and to-date time periodicities but errors will result when a time set is used in place of time.
<number> Number of time periods to shift data to the left.
Example: LEAD
...Consider the following statement: CALCULATE Tax Paid = Tax Due LEAD 1
November 2011
309
Syntax
LEVEL <level>, <level>, ..., <level> Parameter <level> Description Name of a level up to 24 alphanumeric characters. The first level always refers to input members. The second level refers to the members that the first level rolls into. The third level refers to the members that the second level rolls into, and so on. A dimension can have up to 20 levels.
Note: Referencing a level in a logic is meaningful only if that level is above the current section in the consolidation. As shown in the example, it would be meaningless to reference a zone when performing a calculation at the state level, because the zone could have numerous values for a given state.
Rules
Level statements must appear after input, output, and result statements, and before any consolidation statements.
Example
...In this example, the dimension Region contains as its input members the distributors for a ... company's product line. The distributors are grouped into zones. Zones are grouped into ...states. States form the total region. INPUT d4010, d4014, d4019, d5110, d5214, OUTPUT z40, z50, z51, z52, OUTPUT California, Texas, Washington, RESULT Total_Region LEVELS Distributor, Zone, State z40 = SUM d4010, d4014 z51 = d5110 . California = SUM z40, z51 Texas = SUM z52, z53 . Total_Region = SUM California, Texas, Washington, ...In a logic set you can use all the commands that refer to dimension ...members using the names Distributor, Zone, and State. For example: Advertising = Advertising IN Region State * Sales/Sales IN Region State
310
November 2011
...This statement allocates state advertising expenses to a given distributor based on the ratio of that ... distributor's sales to the total sales of all the distributors in the state. Similarly: SELECT Region State ...selects those members at the level of State, namely California, Texas, ...Washington, and so on.
6.98 LIST
Use
LIST displays a default report, according to the current across/down selections.
Syntax
LIST [COLUMNS <n>] [STACK] [FULL] [PASTE] [PAGE ON <dimensions>] [TITLE '<title>'] [CTITLE <column>, '<title>' [,..., <column>, '<title>']] [ <periodicity> ] [PERIOD <daterange>] [TABS] [ WIDTH] [LENGTH] Parameter COLUMNS <n> STACK FULL PASTE Description Lists the specified number of columns across the page. If more columns of data exist, they wrap to the next section. Stacks column headings over each column. Prints all rows, even if all values in a row are missing. By default, Application Server skips missing rows. Prints all values in a row when there are more values than there are columns and some of the data is missing. If the missing values fit on a physical row, you can use PASTE to show the missing values. For example, if you had 12 months of data for the variable sales, and your monitor displayed 6 columns across, Application Server would display the data as 2 rows of six columns each. If the values were missing for the first six months, PASTE would show six months of missing values, rather than skipping the first row of data entirely. PAGE ON <dimensions> Forces page breaks whenever the next member of the specified dimension(s) prints. Restricted to dimensions specified in the DOWN command. TITLE '<title>' Prints a title at the top of the listing. CTITLE <column>, '<title>' Specifies the column number and the title that will appear above that column. You can specify one or more column numbers and titles, each separated by a comma. For example: LIST monthly CTITLE 1, 'Standard', 2, 'Advanced' <periodicity> Displays the data at one of the following periodicities: yearly, ytd, ryearly, semiannually, quarterly, qtd, rquarterly, monthly, mtd, mytd, avgytd, rmonthly, lunar, bimonthly, weekly, wtd, biweekly, daily, or hourly. Limits the display to a specified date range, where <daterange> is a range of dates separated by a dash (-). For example, 00/12/3 - 00/12/31 is the period from December 3, 2000 through December 31, 2000, and 99 - 00 is all of 1990 and 2000. When your variables have been selected and the report layout is determined, you can enter the LIST command with the PERIOD keyword or LIST by itself. The results appear in the display window. The LIST command generates a simple report listing based on the selected data, layout, and defined time frame. It is a very efficient way to display the data because all the defaults are used. If no period keyword is entered, the entire time frame is displayed. Limiting the time frame might make it easier to view the data.
PERIOD <daterange>
November 2011
311
Example
...This example displays the selected variables with a monthly periodicity: LIST monthly ...This example displays the selected variables with a weekly periodicity ...for the period from June 1 to September 30, 1999: LIST weekly PERIOD 99/6 - 99/8/30 ...In this example Application Server displays the fields separated by an asterisk: LIST TABS '*'
6.99 LN( )
Use
LN returns the natural logarithm (base e) of a value or variable.
Syntax
CALCULATE <result> = LN(<variable>) Parameter <result> <variable> Description Name of the result variable. Name of the variable or arithmetic expression whose natural logarithm you want to calculate. Variable names that use special characters should be in single quotation marks (' ').
6.100 LOAD
Use
LOAD loads a database from an external dump file of any size.
Syntax
LOAD <file> Parameter <file> Description Name of an external text file, such as a file containing a database created with DUMP or SNAPSHOT. If you specified a wildcard when you dumped the database, for example DUMP file??, you will have multiple dump files. Therefore, you must use the same wildcard to load the database, for example LOAD file??.
Rules
DUMP creates a file that first erases any set or variable it contains. If you load a file into a database that is not empty, the sets or variables being loaded erase existing sets or variables with the same name.
312
November 2011
Example
...On one computer, you can dump a database to an external file named ...MARKETDB using the following statement: DUMP marketdb ...After transferring the file to another machine, you can load it into a ...newly created database using the following statement: LOAD marketdb ...This example loads the contents of the tape named "/dev/rmt/0u": LOAD TAPE /dev/rmt/0u
Syntax
LOAD <setname>[;<database>] | <filename>[;EXTERNAL} Parameter <setname> <filename> Description Name of set. Name of an external file that was created by the SUPERVISOR DUMP command that contains user and database information about MASTERDB.
Note: If you are trying to load a dump of MASTERDB that was dumped prior to version 9.3 of Application Server and contains information about partitioned Application Server databases, the dump file will be unloadable. You must edit the dump file to remove the PARTITION and NAME clauses from the ADD DATABASE commands, and then you will be able to load the pre-9.3 version of MASTERDB. For help doing this contact Customer Support.
Example
...This example loads the contents of the file MASTER: LOAD master
6.102 LOG( )
Use
LOG returns the base 10 logarithm of a value or variable.
Syntax
CALCULATE <result> = LOG(<input>) Parameter <result> <input> Description Name of the result variable. Name of the variable or arithmetic expression whose base 10 logarithm you want to calculate.
Example
...This example returns a value of 2.5623: b = 365
November 2011
313
6.103 LOGIC
Use
LOGIC starts the Application Server editor, where you can create or edit logic sets.
Syntax
LOGIC [<logic>] [;<database> | ;EXTERNAL|LOCAL] Parameter <logic> Description Name of a new or existing logic set up to 96 bytes. If you do not specify a name, Application Server uses the default logic set if you defined it, or the last logic set you edited. Name of the database where the logic set is located. If you do not specify a database name, Application Server uses your Use database. Indicates the logic set is a text file that is not in an Application Server database. If the logic set is a DOS file, its name cannot have an extension. Indicates that the logic set is a text file on the client.
Note: You can create or edit a logic with the EXTERNAL or LOCAL extension, but you must copy it into a model and compile it before it can be used in the model.
Rules
SAVE and END perform a syntax check on external logic sets and then copy the new or modified logic sets back to the external file. Application Server executes a logic set when you enter the CALCULATE command.
Example
...This example creates a logic set REVENUE: LOGIC revenue Revenue = 'Unit Price' * Volume Discounts = Revenue * ('Discount Rate' / 100) 'Net Revenue' = Revenue - Discounts 'Variable Cost' = Volume * 'Unit Var Cost'
6.104 LOOP-ENDLOOP
Use
LOOP-ENDLOOP repeatedly executes a block of statements until a condition becomes true.
Syntax
LOOP . . <statements> . EXITIF <condition> . . <statements> . ENDLOOP
314
November 2011
Description Indicates the start of a loop and executes the first block of statements until an EXITIF condition is true. Any valid sequence of statements or commands. Executes the next block of statements when the condition is true. A logical condition using any arithmetic or logical operators. Indicates the end of a loop.
6.105 MASK-ENDMASK
Use
MASK-ENDMASK is a Report command that creates a template for the report rows. All nonblank characters in the mask replace whatever normally appears in the rows that follow until an ENDMASK occurs.
Syntax
MASK [<n>] '<text>', ...[<n>] '<text>' . . <statements> . ENDMASK Parameter <n> <text> <statements> Description A positive integer indicating the number of spaces to indent text from the left margin. Text or characters you want to display. Any sequence of statements or commands.
Note: Make sure that you do not mask more columns than the number of columns of data. MASKENDMASK is independent of the number of columns displayed and formats columns even if no data is displayed.
Example
...The following block inserts vertical bars between the numbers in a report: MASK ' | | |' ROW Sales ENDMASK ...This block produces output similar to: Sales 459 | 512 | 505 |
6.106 MAX( )
Use
MAX returns the maximum value of the specified variables.
Syntax
CALCULATE <result> = MAX(<variable> [,..., <variable>]) Parameter <result> Description Name of the result variable.
November 2011
315
Example
...Consider the following statement: CALCULATE Maxcost = MAX(Costa) ...The results in a report that prints Costa and Maxcost would be: Costa Maxcost 10 3 9 1
10 10 10 10
6.107 MEAN( )
Use
MEAN returns the average of the specified variable, where any missing values are excluded and not counted in the divisor. Note: MEAN behaves like MAX in that if you specify one variable, Application Server returns the mean value of the entire time series for the variable, and uses that value in all the time periods for the result variable. If you specify more than one variable, Application Server returns the mean value of variables in each time period and uses that value in the corresponding time period for the result variable.
Syntax
CALCULATE <result> = MEAN(<variable> [<variable>,<variable>,... <variable>]) Parameter <result> <variable>, ... Description Name of the result variable. Name of the variables whose average value you want.
6.108 MEAN2()
Use
MEAN2 returns the average of the specified variable, and allows you to specify whether to include or exclude missing observations in the average, or to return a missing value if at least one observation is missing.
Syntax
CALCULATE <result> = MEAN2(<type>, <variable> [,<variable>,... <variable>]) Parameter <result> <type> Description Name of the result variable. An integer value 0, 1, or 2. 0 means if any of the observations are missing, mark all observations as missing. 1 specifies an exclusive average, where missing values are not counted in the divisor. 2 specifies an inclusive average, where missing values are counted in the divisor. Name of the variables whose average value you want.
<variable>,...
316
November 2011
6.109 MIN( )
Use
MIN returns the minimum value of the specified variables.
Syntax
CALCULATE <result> = MIN(<variable> [,..., <variable>]) Parameter <result> <variable> Description Name of the result variable. Name of the variables to search for the minimum value. Separate each <variable> with a comma. Variable names that use special characters should be in single quotation marks (' ').
Example
...This example returns values of 1, 6, -8, 72, 3: b = 1, 10, 4, 72, 3 c = 100, 6, -8, 102, 19 CALCULATE a = MIN(b, c)
6.110 MORTGAGE( )
Use
MORTGAGE returns four values: the series of principal payments, the series of interest payments, the total of interest and principal payments, and the remaining balance. Note: MORTGAGE is a user-defined function that calculates more than one output variable. Application Server writes it as a logic set and stores it in the database TBDB. You can enter the following statement to look at the database:
type mortgage;tbdb
Syntax
MORTGAGE (<amount>, <annual_rate>, <term>, <start>, <first_pay>, <balloon>, <principal>=, <interest>=, <payments>=, <balance>=) Parameter <amount> <annual_rate> <term> <start> <first_pay> <balloon> <principal> <interest> <payments> <balance> Description Scalar amount of the mortgage. Scalar annual interest rate. Scalar length of the mortgage in years. Starting date of the mortgage. Date of the first payment. Scalar amount of any balloon payment, or 0 if there is no balloon payment. Name of the output variable for the series of principal payments. Name of the output variable for the series of interest payments. Name of the output variable for the series with the total of interest and principal payments. Name of the output variable for the series of remaining balances on the mortgage.
November 2011
317
6.111 MOVING( )
Use
MOVING returns a moving average for a previously defined data range. MOVING returns a missing value if any of the observations are missing.
Syntax
CALCULATE <result> = MOVING(<variable>, <number>) Parameter <result> <variable> Description Name of the result variable. Name of the variable whose moving average you want. Variable names that use special characters should be in single quotation marks (' '). Note: Virtual
variables calculated with time based functions like LAG, LEAD, MOVING, MOVING2, and PERCHG should be used with caution. These measures can be displayed with Application Server's standard and to-date time periodicities but errors will result when a time set is used in place of time.
<number> Number of time periods to average.
6.112 MOVING2()
Use
MOVING2 returns a moving average for a previously defined data range and allows you to specify whether to include or exclude missing observations in the average, or to return a missing value if at least one observation is missing.
Syntax
CALCULATE <result> = MOVING2(<variable>, <type> [,<number>]) Parameter <result> <variable> Description Name of the result variable. Name of the variable whose moving average you want. Variable names that use special characters should be in single quotation marks (' '). Note: Virtual
variables calculated with time based functions like LAG, LEAD, MOVING, MOVING2, and PERCHG should be used with caution. These measures can be displayed with Application Server's standard and to-date time periodicities but errors will result when a time set is used in place of time.
<type> An integer value 0, 1, or 2. 0 means if any of the observations are missing, mark all observations as missing. 1 specifies an exclusive average, where missing values are not counted in the divisor. 2 specifies an inclusive average, where missing values are counted in the divisor. Number of time periods to average for every periodicity. If you do not specify a <number>, the number of periods over which the moving average is calculated is taken as a predefined default value that is different for each periodicity. For example, if your periodicity is MONTHLY the default value is 12. The default list of period numbers is as follows: BIENNIAL DefaultValue=2 YEARLY DefaultValue=2 RYEARLY DefaultValue=2 YTD DefaultValue=2 AVGYTD DefaultValue=2 SEMIANNUAL DefaultValue=2 QUARTERLY DefaultValue=4 RQUARTERLY: DefaultValue=4
<number>
318
November 2011
QTD DefaultValue=4 AVGQTD DefaultValue=4 BIMONTHLY DefaultValue=6 MONTHLY DefaultValue=12 RMONTHLY DefaultValue=12 MTD DefaultValue=12 AVGMTD DefaultValue=12 MYTD DefaultValue=12 LUNAR DefaultValue=13 LTD DefaultValue=13 PBIWEEKLY DefaultValue=2 BIWEEKLY DefaultValue=2 WKTD DefaultValue=4 WEEKLY DefaultValue=4 BSDAILY DefaultValue=7 DAILY DefaultValue=7 HOURLY DefaultValue=24 QHOURLY: DefaultValue=4 Overriding the defaults By defining control variables, you can customize the number of periods averaged for each periodicity. When you omit the <number>, the MOVING2 function will use the number of periods defined by the control variables rather than use the defaults for the periodicity. The control variables are in the form of: MOVING_<periodicity> where <periodicity> matches the names shown in the default list. For example, if your periodicity is MONTHLY, and you issue the following command: SET CONTROL MOVING_MONTHLY 4 it will average 4 months of data when measures are listed monthly instead of the default 12 periods The SET CONTROL commands should be added to an AUTOUSE procedure so they are executed every time the model is used.
Example
...This example calculates a moving average for the first four periods (Jan 00 - Apr 00) of the variable ... Cogs and puts the average in the Apr 00 entry of the variable x. The May 00 entry ...of x contains the average of Cogs for Feb 00 to May 00. CALC x = MOVING(cogs, 4)
6.113 NCASES( )
Use
NCASES returns the maximum number of observations (based on the periodicity) for the period of the logic set being calculated.
Syntax
CALCULATE <result> = NCASES() Parameter <result> Description Name of the result variable.
November 2011
319
6.114 NDAYS( )
Use
NDAYS returns the number of days in the current period.
Syntax
CALCULATE <result> = NDAYS( ) Parameter <result> Description Name of the result variable.
6.115 NEWPAGE
Use
NEWPAGE is a Report command that starts a new report page.
Syntax
NEWPAGE
6.116 NOCALC-ENDNOCALC
Use
NOCALC-ENDNOCALC is a Report command that defines a group of rows that should not have calculated columns.
Syntax
NOCALC . . <row specifications> . ENDNOCALC
Example
...Assume the columns in your report are in the following order: PRODUCTS TV Apr 00 Sales May 00
ORDER 0, 1, 2, 'Pct' = c2 % c1 ENDSET ROW Sales NOCALC ROW Expenses ENDNOCALC ...The report would look like this:
320
November 2011
PRODUCTS TV Apr 00 May 00 Pct Sales Expenses 15,721 15,355 98 7,859 7,439 ---
6.117 NPV( )
Use
NPV returns a scalar net present value of a series of payments discounted at a given rate.
Syntax
CALCULATE <presentvalue> = NPV(<rate>, <base_date>, <amt1>, <date1>, ..., <amtn>, <daten>) Parameter <presentvalue> <rate> <base_date> <amtn> <daten> Description Name of the result variable that contains the net present value as a scalar value. Name of the scalar or time-series variable containing the discount rate. Date that Application Server bases its calculations on. Value of the <n>th payment, where <n> = 1 to total payments. Date of the <n>th payment, where <n> = 1 to total payments.
6.118 NROWS( )
Use
NROWS is a Report function that returns the number of rows in the last down dimension used for a report. Note that you can only use this function in reports, not in normal CALCULATE commands.
Syntax
CALCULATE <result> = NROWS() Parameter <result> Description Name of the result variable.
Example
...This example displays all the rows in the last down dimension, with a blank line between each row: scalar i DO i = 1, NROWS() ROW [ i ] SKIP ENDDO
6.119 OBS( )
Use
OBS returns the number of the individual observation being calculated at any given step of a logic set. For example, if the periodicity of a logic set is weekly, and the time period is for one year, OBS returns a value of 1 when the first week is calculated, a value of 2 when the second week is calculated, and so on, up to a value of 52 when the last week is calculated. Note: The maximum number of observations is equal to the value returned by NCASES.
November 2011
321
Syntax
CALCULATE <result> = OBS() Parameter <result> Description Name of the result variable.
6.120 ON
Use
ON executes a specified procedure when either an error or a cancel condition occurs.
Syntax
ON {ERROR | BREAK} <action> | CLEAR Parameter ERROR BREAK <action> CLEAR Description Executes the specified action if an error occurs. Executes the specified action if a cancel condition occurs. Application Server command or the name of a procedure to be executed if an error or cancel condition occurs. The parameter must be enclosed in quotes. Stops execution of the specified action when an error or break key condition occurs.
Note: You should test an error procedure before including it in an ON ERROR command to make sure it does not contain any errors. An error procedure that contains errors could result in an endless loop.
6.121 ORDER
Use
ORDER changes the order in which Application Server displays dimension members.
Syntax
ORDER <dimension> [ALPHABETIC | LABELS] [ASCENDING] [ HIERARCHY [ALLHIERARCHIES] [ ALPHABETIC | LABELS ] ] [ON [ASCENDING] <expression>] [TOP | BOTTOM {<n> | NSELECTED | ALLMEMBERS } [CONCENTRATE | REMAINDER [CONCENTRATE <options> ] ] [<member criteria>] ] [<members>] [SELECT] [ACROSSDOWN] Parameter <dimension> ALPHABETIC LABELS ASCENDING HIERARCHY Description Name of the dimension to order. If you do not specify options after the dimension, Application Server restores the dimension to its default order. Orders members alphabetically. Orders members alphabetically based on their labels. Displays members in ascending order: input members first, followed by output members, and then result members. (This applies to dimensions with multiple hierarchies) Orders members by the default hierarchy set for the dimension.
322
November 2011
Note: You can set a hierarchy using the SET command. If you do not set a hierarchy, Application Server uses the default hierarchy (the one defined in the first HIERARCHY statement of the CONSTRUCT command). ALLHIERARCHIES ALPHABETIC LABELS ASCENDING ON ASCENDING <expression> TOP | BOTTOM For multiple hierarchies, where members are present in more than one hierarchy, displays all members of all hierarchies wherever they occur. Orders members of the default hierarchy alphabetically. Orders members of the default hierarchy alphabetically based on their labels. Displays members in ascending order: input members first, followed by output members, and then result members. Orders members from the member with the largest numeric value to the member with the smallest numeric value according to the specified expression. Orders members from the member with the smallest numeric value to the member with the largest numeric value according to the specified expression. An arithmetic expression. Orders the top or bottom selected members of the dimension, based on a number, or the selected members, or all members. Any output from a LIST command will list the specified items in top or bottom order. Orders just the top or bottom <n> selected members of the dimension. Any output from a LIST command will list n items in top or bottom order. Determines n from the number of currently selected members. For example, if ten members of the Product dimension are currently selected, then: ORDER PRODUCT ON SALES TOP NSELECTED SELECT will give a top 10. Determines n from all members in the dimension. For example, if Product has 50 members, then: ORDER PRODUCT ON SALES TOP ALLMEMBERS SELECT will give a top 50. CONCENTRATE is only valid if it is used in conjunction with, and immediately follows, TOP | BOTTOM n on the command line. The <options> parameter can be one or more of the following list: [OtherName | COUNT | ALLVARIABLES | SUPPRESS {NONE | BOTH | MISSING | ZEROS}]* OtherName -a quoted member name to contain the subtotal of all members omitted from TOP | BOTTOM n. The default name is 'All Other'. Note: If the specified OtherName already exists in the dimension, a unique name is created by appending '$' characters to the end of the name. COUNT - generates a count of the number of members included in the OtherName member. The count displays in parentheses () at the end of the long name of the OtherName member, and it is written to a control variable called COUNT8020. ALLVARIABLES - the remainder subtotal is computed for all selected variables, not just those in the ORDER ON clause. SUPPRESS - excludes some combination of missing or zero data from the remainder total and count. By default, missing data is not suppressed. <member criteria> Currently supports the keyword EVERYMEMBER, which uses all members of the ORDER dimension (rather than the selected members) to evaluate the TOP | BOTTOM <n>. Names of one or more members separated by commas. Any members not specified follow in their default order. Automatically selects just the members being ordered. Use this keyword if you have attributes selected and included in your across/down list, or if the dimension that you are ordering is an attribute dimension. ACROSSDOWN indicates that the data contained in the models
<n> NSELECTED
ALLMEMBERS
CONCENTRATE
[CONCENTRATE <options>]
November 2011
323
Default order
The default order for LIST and DISPLAY is the order in which members occur in the dimension.
Notes:
The statement "ORDER <dimension> ON var TOP <n> SELECT" only operates on the currently selected members of <dimension>. For example: you have a dimension REGION with 16 members. If only seven members of REGION are selected, "ORDER REGION ON SALES TOP 10 SELECT" will only order the seven selected members. However, if the entire 16 members of the dimension are selected, this command will select the 10 members of REGION with the highest SALES value and arrange them in descending order. When you order a dimension on a variable, your view needs to be narrowed down to a single column of information. You need to make sure that you have only one member of the dimensions that you are not ordering selected. In addition, you should order on a single time period. You can add a period and a periodicity to your ORDER statement. For example:
SET PERIOD 99 SET LATEST JULY 99 ORDER Product ON Sales YTD
or
ORDER Product ON Sales MONTHLY PERIOD JULY 99
Example
...This example orders a dimension and selects the ordered items at the same time. When you use ... subsequent time conversions, for example, LIST YTD, selection has an ...important impact on efficiency: ORDER CHANNEL DIRECT, WHOLESALE SELECT ...This example orders the top 50 selected Customer members ...based on sales. Application Server only lists the top 50 in the output. ORDER CUSTOMER ON SALES TOP 50 ...A variable Sales is dimensioned by a dimension Store. To see ...sales displayed from largest to smallest sales figures, enter the following: ORDER Store ON Sales ...To see sales displayed alphabetically, enter the following: ORDER Store ALPHABETIC ...This example orders and selects the top 10 product members based on sales and lists the top 10 in ... the output. The time values used for each product are the LAST time period in the rows that result. ... The rows that result are:the selected members if only one member was selected ...(of the other dimensions not in the across/down list) the result members if all members were ... selected the first selected member if some, but not all, members ...were selected. ORDER PRODUCT ON SALES TOP 10 SELECT ...The dimension in this example contains multiple hiearchies. This example orders the specified ...dimension by all hierarchies, and selects all members of all hierarchies in the dimension:
324
November 2011
ORDER MHDIM HIERARCHY ALLHIERARCHIES SELECT MHDIM ALL ACROSS TIME,VAR DOWN MHDIM SEL SALES LIST ...The output displays all members of all hierarchies, wherever they occur. For example, ONE occurs ... in ODD, LOW, and THREELETTERS, and EIGHT occurs in EVEN, HIGH, and FIVELETTERS: Jan 99 SALES TOTAL MHDIM ODD ONE THREE FIVE SEVEN NINE EVEN TWO FOUR SIX EIGHT TEN TOTAL HIGHLOW LOW ONE TWO THREE FOUR FIVE HIGH SIX SEVEN EIGHT NINE TEN TOTAL LETTERS THREELETTERS ONE TWO SIX 55.00 25.00 1.00 3.00 5.00 7.00 9.00 30.00 2.00 4.00 6.00 8.00 10.00 55.00 15.00 1.00 2.00 3.00 4.00 5.00 40.00 6.00 7.00 8.00 9.00 10.00 55.00 19.00 1.00 2.00 6.00
November 2011
325
Syntax
SET . . ORDER <columns> . ENDSET
Note: The first ORDER statement must appear within the SET-ENDSET block.
Parameter <columns> Description One or more column numbers, ranges of columns, or expressions, separated by commas. The following rules apply to this field: Ranges can be in sequential or reverse sequential order. Application Server numbers the columns in a report sequentially starting from 0. Column 0 contains the name of the row. Column 1 is the first column that appears in the default order, column 2 is the second, and so on. Any column number can be repeated, and any column number or numbers can be omitted. Tip: Use SHOW ACROSS DETAIL to display the order of currently selected columns. Expressions evaluate for each row statement in the report. The left side of the equation is a scalar quantity. The right side of the equation is an expression. The right side of the equation can also include references to columns with the notation ci, where i refers to the ith column of the report. An equation entirely enclosed in parentheses evaluates, but does not print; use the left side in an expression that you want to print. To use labels as column headings, place the labels, enclosed in double quotation marks (" "), after the name on the left side of the equal sign. Any label may be applied to a column by placing the label after the calculated column name and before the equals sign. For example, ORDER 0-3,PCT '% of Sales' = c1 % c2.
Rules
Application Server normally calculates the column calculations specified with ORDER for every printed row. You can suppress these calculations for certain rows by enclosing the rows in NOCALC-ENDNOCALC statements. You can include the SHORT keyword in an ORDER statement to specify that short names should appear instead of labels for column 0. You can either substitute 0 with the SHORT keyword, or if
326
November 2011
you want to display both the short names and labels, include both SHORT and 0 in the ORDER statement.
Example
...Assume the columns in your report are in the following order: PRODUCTS TV Jan 00 Sales Expenses ...This block: SET ORDER 1-3, 0, Pct = c4 % c5, 5-4 ENDSET ...produces the following report: PRODUCT TV Jan 00 12,200 6,308 Feb 00 13,500 6,100 Mar 00 14,409 7,147 Sales Pct May 00 Apr 00 98 15,721 15,355 7,859 7,439 12,200 6,308 Feb 00 13,500 6,100 Mar 00 14,409 7,147 Apr 00 15,355 7,439 May 00 15,721 7,859
Expenses 95
6.123 OUTPUT
Use
OUTPUT sends all output that normally appears on your screen (except errors) to a specified destination. When you use OUTPUT with a document or database, the default is for Application Server to overwrite the file.
Syntax
OUTPUT {TERMINAL} {[LOCAL] PRINTER} {GRAPHICS <device>} {<document> [;<database> | ;EXTERNAL] [APPEND]} {OFF} Parameter TERMINAL PRINTER LOCAL PRINTER GRAPHICS <device> <document> <database> EXTERNAL APPEND OFF Description Displays output on your screen. Sends output to your default system printer. Send your output to the client computer printer. Sends output to a graphic device such as a terminal, plotter, printer, or graphics adapter card, supported by Application Server. Name of the graphic device on your system. Name of an Application Server document to which you sent your output. Name of the database where the document is located. If you do not specify a database, Application Server uses your Use database. Indicates the document is a text file that is not in an Application Server database. If the document is a DOS file, its name cannot have an extension. Overrides the default and adds the output to the end of the document. Turns off the previous OUTPUT command and sends all subsequent output to your terminal.
November 2011
327
Example
...This example prints BUDGETREPORT: OUTPUT PRINTER DISPLAY budgetreport OUTPUT OFF
Syntax
OUTPUT(<number>)[...<hierarchy> HIERARCHY] . . <member> [ '<label>' ] . Parameter <number> Description Number of the hierarchy that the output members belong to. The first OUTPUT(1) statement is the first output level in the first hierarchy. The next OUTPUT(1) statement is a higher output level that is part of the same hierarchy. The first OUTPUT(2) statement is the first output level in the second hierarchy, and so on. Note: If the dimension has only one hierarchy, Application Server identifies all output levels as OUTPUT(1). If the dimension has multiple hierarchies, the first top you define appears in the RESULT statement in the dimension set. Any other tops appear as the final output statements for their hierarchies. <hierarchy> Name of the hierarchy as defined in the CONSTRUCT <dimension> HIERARCHY <hierarchy> statement. A hierarchy name appears only when you define multiple hierarchies for the dimension. Name of the output member, up to 96 bytes (including periods (.) and underscores (_)). The parameter <member> must begin with a letter. To include a space or a special character in a member name, enclose the name in single quotation marks (' '). The OUTPUT section can contain multiple members. '<label>' A text string to assign to the output member, enclosed in single quotation marks. A label is a long description of the output member name. A label can be up to 250 characters long, but is recommended to not exceed 30 characters. Note: The members that you define in an OUTPUT statement are called output members. Member names and labels are sometimes referred to as short names and long names. When displaying data, use SET SHORT | LONG to display the member names or labels. The <label>' option is equivalent to using the LABEL keyword in a CONSTRUCT command.
<member>
Rules
You must use unique member names. You do not have to use unique member labels, but they are recommended. A dimension need not have output members. You can enter data at the output level, if applicable.
328
November 2011
An OUTPUT statement appears directly after the INPUT statement and before any HIERARCHY, RESULT, or consolidation statements. You specify the OUTPUT statement one or more times, depending on the consolidation groupings. Each OUTPUT statement is followed by a list of member names and, optionally, labels. Except for the last line, <name> '<label>' statements are separated by a comma.
Example
...This example shows cities at the input level that are consolidated into states, the output level. INPUT LA 'Los_Angeles', San_Francisco, Las_Vegas, Seattle, Yakima OUTPUT CA 'California', Nevada, Washington CA = SUM LA, San_Francisco Nevada = SUM Las_Vegas Washington = SUM Seattle, Yakima CA = SUM LA, San_Francisco Washington = SUM Seattle, Yakima
Syntax
PARHEADING . . <heading specifications> . ENDPARHEADING
Example
...If you enter: ACROSS Time DOWN Country, Product, Variables ...the default PARHEADING would list the complete country and product name before the table of data. ... For example, Country US, Product TV, and so on. ...The following block displays only the product and country names, for example, US TV: PARHEADING TEXT <Country>, <Product> ENDPARHEADING
November 2011
329
Syntax
PEEK [ARRAYSIZE <n>] [CREATED] [LOGIC <logic>] [NONUMBER] [NOHEADERS] [ONLY <integer>] [SKIP <integer>] [TABS '<character>'] Parameter ARRAYSIZE <n> Description Specifies a number between 1 and 32,768 for the size of the array you want to fetch from the RDBMS during the peek process. If you do not specify an array size, rows are fetched in batches of 100. Note: Some drivers do not support array fetching, such as the Microsoft ODBC driver for MS Access. In those cases, the array size will have a value of 1, and Link will only run single row fetches. Note: If you do not specify the ARRAYSIZE keyword on the command line or you do not add an ARRAYSIZE=n parameter in the [linkid] section of the LSDAL.INI file, the default array size value is 100. If you add the ARRAYSIZE parameter to LSDAL.INI, that value will be used instead of the default value. If you use the ARRAYSIZE keyword on the PEEK command, the PEEK ARRAYSIZE command will override all default values and ARRAYSIZE parameter settings in LSDAL.INI. Tip: The best arraysize may be different on different systems and networks, so you should experiment with arraysize numbers until you find the optimal value. ONLY <integer> SKIP CREATED LOGIC logic TABS character NONUMBER NOHEADERS Displays only the specified number of records (rows). Note: ONLY is unnecessary, but its inclusion does not cause an error. Number of records (rows). Skips over the specified number of records (rows) before displaying data. Displays data that Application Server defined using CREATE. Executes a specified logic set as Application Server examines the external data. Name of a logic set. Displays data using tabs between fields. Indicates the character to be used between fields. Does not display line numbers. Does not display column headers.
Example
...This example displays records 101-103 in the external data source: PEEK SKIP 100 ONLY 3
6.127 PERCHG( )
Use
PERCHG returns the percentage of change between the current period and the same period a specified interval (for example, a year or month ago).
Syntax
CALCULATE <result> = PERCHG(<variable> [, period]) Parameter <result> Description Name of the result variable.
330
November 2011
<variable>
Name of the variable to evaluate. Variable names that use special characters should be in single quotation marks (' '). Note: Virtual variables calculated with time based functions like LAG, LEAD, MOVING, MOVING2, and PERCHG should be used with caution. These measures can be displayed with Application Server's standard and to-date time periodicities but errors will result when a time set is used in place of time. Period in which to evaluate: year (default), quarter, month, or week.
period
Example: PERCHG
...This example returns the percentage of change in Sales ...between the present period and the same period one year ago: CALCULATE pctchange = PERCHG(Sales)
6.128 PERIODSAVAILABLE()
Use
PERIODSAVAILABLE returns the number of periods available using the current SET PERIOD start date.
Syntax
CALCULATE <result> = PERIODSAVAILABLE(<variable> ,<when>) Parameter <result> <variable> <when> Description Name of the result variable. Name of the variable to evaluate in double quotes. Number from 0 to 4 as follows: when0 returns the number of periods available to the latest data available for the variable from the SET PERIOD start date
when1 returns the number of periods available to the LATEST period from the SET PERION start date when2 returns the number of periods available to the SET PERIOD start date from the start of the fiscal year when3 returns the number of periods available to the end of the fiscal year from the SET PERIOD start date when4 returns the number of periods available to the number of periods per year for this variable
Syntax
PREFACE | '123' | RANK [NLEVEL <n>] [<col>]
November 2011
331
6.130 PRINT
Use
PRINT sends a listing of one or more sets to a printer.
Syntax
PRINT [<settype>] <setnames> [LOCAL] Parameter <settype> Description Type of set: dimension, document, logic, procedure, report, synonym, or time. If you do not specify a set type, Application Server uses the first set found with the specified name.
332
November 2011
<setnames> LOCAL
One or more set names that you want to send to the printer, separated by commas. Sends the printout to the client machine's printer.
Example
...This example sends the dimension Country to the printer: PRINT dimension Country ...This example sends the dimensions Country, Type, and Product to the printer: PRINT dimension Country, Type, Product
6.131 PROCEDURE
Use
PROCEDURE starts the Procedure editor, where you can create or edit procedures.
Syntax
PROCEDURE <procedure> [;<database> | ;EXTERNAL|LOCAL] Parameter <procedure> Description Name of a new or existing procedure. If you do not specify a name, Application Server uses the default procedure if you defined it, or the last procedure you edited. Name of the database where the procedure is located. If you do not specify a database, Application Server uses your Use database. Indicates the procedure is a text file that is not in an Application Server database. If the procedure is a DOS file, its name cannot have an extension. The text file is a client file.
Notes: You cannot use command separators in the Procedure editor. If you create a procedure in an attached database while running in CHECKPOINT FREEZE, you cannot obtain a listing of that procedure by entering EXHIBIT PROCEDURE FROM <database> or DIR DATA <database> PROCEDURE until you perform a CHECKPOINT UPDATE.
6.132 PURGE
Use
PURGE deletes all backup copies of sets in your Use database or in a specified database. Application Server creates backup copies of all sets that have been edited or removed since the last PURGE or EXIT CLEAR. You can recover a set as it was before you last edited it when you have backup copies. If a database becomes nearly full, some commands that require temporary space in the database might not have enough space to execute. Purging the database frees space. Note: If you enter PURGE, you cannot recover versions of sets edited before PURGE.
Syntax
PURGE [<database>] Parameter <database> Description Name of the database to purge.
November 2011
333
Example: PURGE
...This example shows that PURGE has removed the backup (recoverable) version of the report ... WEEKLY. The Size field indicates the number of blocks the report occupies. DIRECTORY reports FULL ...The output of this command would be: RecoverSize REPORTS WEEKLY MONTHLY QUARTERLY PURGE finance DIRECTORY reports FULL ...The output of this command would be: RecoverSize REPORTS WEEKLY MONTHLY QUARTERLY 2 2 Thu Sep 5 15:20:16 2000 Wed Sep 4 11:00:50 2000 2 Wed Aug 28 16:07:48 2000 Last Updated R 2 2 Thu Sep 5 15:20:16 2000 Wed Sep 4 11:00:50 2000 2 Wed Aug 28 16:07:48 2000 Last Updated
6.133 QUIT
Use
QUIT exits from Application Server without saving any new data. It discards the values of all temporary variables and restores the database to the state it was in when Application Server last updated it. Usually, this state is the point after the last command Application Server completed without an error.
Syntax
QUIT
Example: QUIT
...This example shows what happens when you try to enter EXIT CLEAR ...without specifying whether you want to save the data in your temporary variables: EXIT CLEAR ...Application Server issues this message: Either Must SAVE DATA and then EXIT CLEAR or, EXIT, or QUIT. ...If you now enter: QUIT ...You return to the host operating system; temporary variables are not saved.
334
November 2011
6.134 RANDOM( )
Use
RANDOM returns a random number greater than or equal to 0 and less than or equal to 1. You can use RANDOM to generate test data for a variable.
Syntax
CALCULATE <result> = RANDOM([<number>]) <expression> Parameter <result> <number> <expression> Description Name of the result variable. Optional constant number between 0 and 1. Application Server generates the same random numbers for the same values of <number>. Any mathematical expression. For example, RANDOM(0.5) * 100.
Example
...This example creates random data for a test variable, testcogs. The input levels of dimensions are ... selected, the variable is selected, and then the random data is generated with the FULL keyword so ...that data is not consolidated. CREATE testcogs LIKE cogs SET PERIOD 2000 SELECT Product input SELECT Region input SELECT Type input SELECT testcogs ACROSS time DOWN variables CALCULATE testcogs=random(.6)*1000 FULL LIST monthly PERIOD jan 00 - may 00 ...The output of this command would be: Jan 00 Feb 00 Mar 00 Apr 00 May 00 TESTCOGS 831 969 687 395 945
6.135 RANK( )
Use
RANK returns the order of dimension members established by ORDER. For dimension members, there is always a default order (1, 2, 3, ...) that provides a default value for rank, even if you have not entered ORDER.
Syntax
CALCULATE <result> = RANK(<dimension>) Parameter <result> <dimension> Description Name of the result variable. Name of the dimension that Application Server has ordered with ORDER.
November 2011
335
Example
...This example orders the members of the dimension Merchandise based on the decreasing values of ... Sales. The ordering is then preserved in the variable Sales_Rank. ORDER Merchandise ON Sales CALCULATE Sales_Rank = RANK(Merchandise) ...You can now use Sales_Rank in a comparison with last year's sales rankings.
If TIME is DOWN, and TIME is the slowest changing field, this is the worst case you can have. It doesn't matter whether you use the FASTMODE keyword in this case. This format forces Application Server to perform excessive reading, rereading, uncompressing, recompressing, rewriting, buffer scanning, and buffer reorganization and the series start to get scattered around blocks.
Syntax
READ [ADD | SUBTRACT] [ARRAYSIZE <n>] [ERRORS <file>] [FASTMODE [n] [FLUSH]] [LOGIC <logic>] [NOFASTMODE] [NOFLUSH] [ONLY <integer>] [SAVE <integer>] [SKIP <integer>] [SORTED] [STOP <integer>] [UPDATE] [ZEROISNULL] Parameter ADD SUBTRACT Description Adds the external values to the existing values. The default replaces existing values with those read in. Subtracts the external values from the existing values. The default replaces existing values with those read in.
336
November 2011
ARRAYSIZE <n>
Specifies a number between 1 and 32,768 for the size of the array you want to fetch from the RDBMS during the read process. If you do not specify an array size, rows are read in batches of 100. Note: Some drivers do not support array fetching, such as the Microsoft ODBC driver for MS Access. In those cases, the array size will have a value of 1, and Link will only run single row fetches. Note: If you do not specify the ARRAYSIZE keyword on the command line or you do not add an ARRAYSIZE=n parameter in the [linkid] section of the LSDAL.INI file, the default array size value is 100. If you add the ARRAYSIZE parameter to LSDAL.INI, that value will be used instead of the default value. If you use the ARRAYSIZE keyword on the READ command, the READ ARRAYSIZE command will override all default values and ARRAYSIZE parameter settings in LSDAL.INI. Tip: The best arraysize may be different on different systems and networks, so you should experiment with arraysize numbers until you find the optimal value.
Copies records that are not read to a specified file. Use ERRORS only when the ACCESS subsystem is EXTERNAL. Name of the file. Allocates a large in-memory buffer, holding up to <n> time series in memory, to optimize performance of I/O during the READ. By default, if you do not specify FASTMODE, then FASTMODE 100000 is used. <n> is determined by n is determined by: minimum((product of number of selected members from each dimension in the ACROSS and DOWN) + 10, 100000) Notes: Make sure you have a SET MEMORY with a suitable value. The FASTMODE buffer allocates 8 bytes per time period. So for example, if you have monthly data and SET PERIOD for 12 months, and <n> is 100000, it will allocate at least 19200000 bytes just for the FASTMODE buffer, plus any other memory that is used for other reasons. If you have a small SET MEMORY setting, the command will fail. You must either set a larger SET MEMORY value or set a smaller FASTMODE or use NOFASTMODE to turn this feature off. For small databases, the FASTMODE keyword does not make any difference. If you know that the external source contains many fewer series than <n>, you may want to set a smaller value of <n> to use less memory or use NOFASTMODE to turn this feature off. If you know that the external source has a very large number of records, you may gain performance improvements by specifying a larger value of <n>, say 1 million. However, note that the operating system is unlikely to allocate Application Server very large amounts of memory and in practice a 32 bit process won't be allowed to allocate more than say 1GB of memory. Use NOFASTMODE and NOFLUSH keywords to turn this functionality off.
FLUSH LOGIC
Flushes Application Server's buffer cache (the cache of database pages set by SET BUFFERS) when it fills. Executes the specified logic set as Application Server reads each record. In this way, you can modify values read before updating variables. Logic statements operate on one record of the table at a time. Data outside the record (for example, in variables) is not available for use in these calculations. Note: A logic which calculates the missing values to zero does not execute when used with the READ command. Use the CALCULATE command in these cases.
Name of the logic set. Turns off the FASTMODE functionality. Turns off the FLUSH functionality. Limits the data read to the specified number of records. Note: READ ONLY is the default. ONLY is unnecessary, but its inclusion does not cause an error.
November 2011
337
Example
...Read all data in the external data source: READ ...Read the data and adds the values read into existing variables, stopping if there are any errors: READ ADD STOP 1 ...Copy records that are not read to the file ACCTERR: READ ERRORS accterr Construct dimensions, compile them, create variables, and then reads in data from DRINKS.DBF. ... The .DBF extension is assumed. The data is used to create the dimensions ...Product, Channel, and Region, and the variables Actsales and Budsales. ACCESS dbase USE drinks CONSTRUCT product level product COMPILE dim product CONSTRUCT channel level channel COMPILE dim channel END CREATE var actsales by product, channel CREATE var budsales by product, channel SELECT var SET PERIOD Jan 94 - Jan 96 ACROSS variables DOWN product, channel, time ACCESS dbase USE drinks READ END
338
November 2011
SELECT drinks input ACROSS var DOWN Time, Drinks ACCESS LSLINK CONNECT dbase SELECT * FROM Drinks PEEK ONLY 5 LSS CREATE size = size SELECT * FROM Drinks ...Read data into the variable READ END ...This shows the data that was loaded into the attribute variables: PKG TYPE HIER ATT COLA BOTTLE32_OZ. 8_OZ.
SPRITZ CAN
Syntax
RECONSTRUCT <dimension>
Note: You must compile a dimension after you have reconstructed it.
Parameter <dimension> Description Name of a compiled dimension.
Example
...To reorder the output members of the PRODUCT dimension, enter the following statements: ACCESS EXTERNAL RECONSTRUCT Product END COMPILE dimension Product
6.138 RECOVER
Syntax
RECOVER [<settype>] <name>
Use
RECOVER restores the previous version of a set from the current session. RECOVER returns the set to the condition it was in when you entered Application Server after an EXIT CLEAR or QUIT, or to the initial version if you created the set in the current session.
November 2011
339
Application Server Command Reference REMOVE Note: If you enter PURGE, you cannot recover versions of sets edited before PURGE.
Parameter <settype> Description Type of set: dimension, document, logic, procedure, report, synonym, or time. If you do not specify a set type, Application Server uses the first set it finds with the specified name. Name of the set to recover.
<name>
Note: RECOVER does not recover the compiled form of a dimension; a database reorganization is not forced. You must enter COMPILE to force the database reorganization.
Example: RECOVER
...This example recovers the dimension BUDGET: RECOVER dimension budget
6.139 REMOVE
Use
REMOVE deletes sets, variables, database versions, formats, or data.
Syntax
REMOVE {<settype> <setname> [,..., <setname>] [SURE] } { ADIMENSION <attribname>} { ATTRIBUTE <attribname>} { CONSOLIDATED <variable> [,..., <variable> ] [ UPDATE <n> ] [BEFORE <date> ] [ AFTER <date> [ NOTRUNCATE ] ] [ SURE ] } { CUSTOM [<database>.][<owner>.]<dimension>.<setname> [,[<database>.][<owner>.]<dimension>.<setname> ] } { DATA <variable> [,..., <variable> ] [ UPDATE <n> ] [BEFORE <date> ] [ AFTER <date> [ NOTRUNCATE ] ] [ SURE ] } { FORMAT <variable> [,..., <variable>] } { ROLLUPS} { SELECTED <variable> [,..., <variable> ] [ UPDATE <n> ] [BEFORE <date> ] [ AFTER <date> [ NOTRUNCATE ] ] [ SURE ] } { VARIABLE <variable> [,..., <variable> ] [FROM remotedb ] [TEMPORARY] } { VERSION <version> [,..., <version>] } Parameter <settype> <setname> Description Type of set: dimension, document, logic, procedure, report, synonym, or time. Removes one or more set names of the specified set type, separated by commas. You can use an asterisk (*) in the name as a wildcard that indicates that any character can occupy that position or any of the remaining positions in the name. Applies to dimension sets only. Forces removal of the compiled dimension set. Removes the compiled attribute that results from compiling the attribute
SURE
ATTRIBUTE <attribname> Removes an attribute set that describes the attribute. CONSOLIDATED <variable> Removes all output level data for the specified variable, including input data loaded at an output level. Input level data is untouched. You can use an asterisk (*) in the name as a wildcard that indicates that any character can occupy that position or any of the remaining positions in the name. UPDATE <n> Forces Application Server to update the database after removing data for <n> time series. This helps minimize the space required for processing when removing data. Removes data for the variable(s) before the specified date.
BEFORE <date>
340
November 2011
AFTER <date>
Removes data for the variable(s) after the specified date. Note: If BEFORE and AFTER are used together, a slice of data in the middle of the timeseries is removed. For example, if you use the command REMOVE DATA BEFORE 8/2006 AFTER 6/2006, you remove data for 7/2006. If you use the command REMOVE DATA BEFORE 6/2006 AFTER 8/2006, you remove all data except for 7/2006.
NOTRUNCATE
Updates the index to the data without actually removing the data. Similar to the REMOVE DATA AFTER date command, data specified after the AFTER date will no longer appear or be available. While the REMOVE DATA AFTER command actually removes the data, REMOVE DATA AFTER NOTRUNCATE does not remove the data, making the data removal process much quicker. The index is modified to amend the time span corresponding to the series. When you have a lot of data removal, this keyword improves performance without any visual differences from REMOVE DATA AFTER. For example, if you use REMOVE DATA AFTER 6/2006 NOTRUNCATE, data for 7/2006 and onward will no longer appear or be available. Notes: If BEFORE and AFTER are used together, you cannot use the NOTRUNCATE keyword with AFTER.
SURE
Removes data for the listed variable. SURE is required when using an asterisk (*) in a name. If you do not use SURE, the system produces an error unless you enter CHECKPOINT FREEZE. Removes a saved User-Defined Hierarchy and the compiled dimension set that was saved during a SAVE CUSTOM command. At a minimum, specify the dimension containing the User-Defined Hierarchy, and the procedure set name of the User-Defined Hierarchy that was created during a SAVE CUSTOM command. Notes: You can remove more than one User-Defined Hierarchy at a time by specifying each one separated by a comma. To remove a User-Defined Hierarchy, you must be either the administrator, or the owner of the User-Defined Hierarchy.
CUSTOM
<database> <owner>
Name of the database containing the User-Defined Hierarchy to be deleted. If you omit the database name, the current USE database is used. Name of the Application Server user who is responsible for the User-Defined Hierarchy. This name was specified during the SAVE CUSTOM command when the User-Defined Hierarchy was created. If you omit the owner name, the current Application Server user name is used. Name of the dimension whose User-Defined Hierarchy you want to remove. Name of the procedure set where the User-Defined Hierarchy was saved during the SAVE CUSTOM command. Removes data for the specified variable(s). Application Server updates the database after it has modified all the relevant time series. You can use an asterisk (*) in the name to indicate that any character can occupy that position or any of the remaining positions in the name. You must use SURE when specifying an asterisk (*). Forces Application Server to update the database after removing data for <n> time series. This helps minimize the space required for processing when removing data. Removes data for the variable(s) before the specified date. Removes data for the variable(s) after the specified date. Note: If BEFORE and AFTER are used together, a slice of data in the middle of the timeseries is removed. For example, if you use the command REMOVE DATA BEFORE 8/2006 AFTER 6/2006, you remove data for 7/2006. If you use the command REMOVE DATA BEFORE 6/2006 AFTER 8/2006, you remove all data except for 7/2006.
UPDATE <n>
NOTRUNCATE
Updates the index to the data without actually removing the data. Similar to the REMOVE DATA AFTER date command, data specified after the AFTER date will
November 2011
341
FORMAT <variable>
VARIABLE <variable>
342
November 2011
Example: REMOVE
...This example removes the logic sets FY00MODEL and FY00BUDGET: REMOVE logic fy00model, fy00budget ...This example removes data earlier than 2000 for the variable Expenses: REMOVE DATA Expenses BEFORE 2000 ...This example removes all dimension set data. The SURE keyword ...indicates you are sure you want to do this. REMOVE DATA * SURE ...This example removes an attribute using the following three commands: REMOVE ATTRIBUTE data REMOVE ADIMENSION data REMOVE VARIABLE data ...This example removes all sales data for channel c2 before February 2000: SELECT CHANNEL c2 SELECT VARIABLE sales REMOVE SELECTED sales BEFORE feb00
Syntax
REMOVE ACCESS <key> {USER <user> | DATABASE <database>} Parameter ACCESS <key> USER <user> Description The access key to remove. The name of the user account from which the access key should be removed. The user will no longer be able to update any databases that have <key> set as an update access key, and the user will no longer be able to read from any databases that have <key> set as a read access key. The name of the database from which the access key should be removed. If <key> is an update access key, all users will be able to update the database; if <key> is a read access key, all users will be able to read from the database. The database must be marked as available in MASTERDB, and all users must be detached.
DATABASE <database>
Remarks
Before removing an access key, you must ensure that all users are detached from the database.
Example
...This example adds a read access key to the Juice database and to the user named Test1. It then ...removes the access key from the Test1 user, so the Test1 user cannot read from the Juice database. ...Create the Test1 user. SUPERVISOR CREATE USER Test1 USEDB Juice ...Add the access key to the Juice database.
November 2011
343
Syntax
REMOVE DATABASE <database> Parameter DATABASE <database> Description The name of the database to delete.
Syntax
REMOVE GROUP <group> Parameter GROUP <group> Description The name of the group to remove. Use an asterisk (*) to remove all groups.
Syntax
REMOVE PROTECTION DATABASE <database> <key>
344
November 2011
Description The name of the database from which the protection key should be removed. The name of the protection key to remove.
Remarks
By removing a protection key, you enable users to copy or move the database.
Before removing a protection key, you must ensure that all users are detached from the database.
Syntax
REMOVE USER <user> [FROM <group>] Parameter USER <user> Description One or more user names separated by a comma. If you specify FROM <group>, the user is removed from the security group specified. If you omit FROM <group>, the user is logged out, and the user record is completely removed from MASTERDB. The name of the group from which users are removed. An asterisk (*) removes the users from all groups.
FROM <group>
Example
...The first part of this example creates two users named Test1 and Test2, and adds them to a security ... group named TestGroup. The second part of the example removes the user Test1 from TestGroup ... and removes the user Test2 from MASTERDB. ...Create the users and add them to the security group. SUPERVISOR CREATE USER Test1 SUPERVISOR CREATE USER Test2 SUPERVISOR CREATE GROUP TestGroup SUPERVISOR ADD USER Test1, Test2 TO TestGroup ...Remove the user Test1 from TestGroup SUPERVISOR REMOVE USER Test1 FROM TestGroup ...Remove the user Test2 from MASTERDB SUPERVISOR REMOVE USER Test2
6.145 RENAME
Use
RENAME changes the name of a specified set or variable.
November 2011
345
Application Server Command Reference REPEAT-UNTIL Note: If you rename variables in a Hybrid OLAP model, you must make the corresponding name changes in the underlying relational database tables.
Syntax
RENAME {<settype> | VARIABLE} <oldname> <newname> Parameter <settype> VARIABLE Description Type of set: document, logic, procedure, report, synonym, or time. Note: You cannot rename a dimension set. Changes the name of a stored variable. Note: Virtual variables cannot be renamed. Instead, delete the virtual variable and recreate it with the new name. <oldname> <newname> Current name of the set or variable. Variable names that use special characters should be in single quotation marks (' '). New name of the set or variable. Variable names that use special characters should be in single quotation marks (' ').
Example
...This example changes the name of the logic set REVENUE to BUDREVENUE: RENAME logic revenue budrevenue
6.146 REPEAT-UNTIL
Use
REPEAT-UNTIL repeatedly executes a block of statements until a specified condition becomes true.
Syntax
REPEAT . . <statements> . UNTIL <condition> Parameter REPEAT <statements> UNTIL <condition> Description Indicates the start of a loop. Any sequence of statements or commands. Indicates the end of a loop, where <condition> is a valid logical condition. If the condition is true, exits from the loop. If the condition is false, executes the statements in the loop.
6.147 REPORT
Use
REPORT starts the Report editor, where you can create or edit reports.
Syntax
REPORT [<report>] [;<database> | ;EXTERNAL|LOCAL] Parameter <report> Description Name of a new or existing report up to 96 bytes. If you do not specify a name, Application Server uses the default report if you have defined it, or the last report you edited.
346
November 2011
Name of the database where the report is located. If you do not specify a database, Application Server uses your Use database. Indicates the report is a text file that is not in an Application Server database. If the report is a DOS file, its name cannot have an extension. Indicates that the report is a client text file.
Notes: You can create or edit a report with the EXTERNAL or LOCAL extension, but you must copy it into a model and compile it before it can be used in the model. Use the CTRL-ENTER key combination to force lines of more than 256 characters to be recognized.
Remarks
You can use the following commands within the Report editor: COLHEADINGENDCOLHEADING FOOTNOTE-ENDFOOTNOTE HEADING-ENDHEADING MASK-ENDMASK NEWPAGE NOCALC-ENDNOCALC NROWS ORDER PARHEADINGENDPARHEADING PREFACE ROWS SET-ENDSET SKIP SUBTOTAL-ENDSUBTOTAL SUBTOTAL INCLUDE SUMMARY-ENDSUMMARY TABS TEXT TITLE UDASH UDATA UNAME UTEXT
November 2011
347
Example 1
...This is an example of a report using NLEVELTOTAL: SET across time, var down customer, product, channel columns once tabs Style leveltotal indent 0, 0, 5, 5 decimal 0 ORDER 0,1 , "%one" if NLevel() EQ 0 = c1/value(NLevelTotal(0),1)*100 if NLevel() EQ 1 = c1/value(NLevelTotal(1),1)*100 if NLevel() EQ 2 =c1/value(NLevelTotal(2),1)*100 otherwise = c1/Value(NLevelTotal(3),1)*100 SUPPRESS formfeed, heading, missing ENDSET parheading when nlevel() eq 1 text <nlevelname elsewhen nlevel() eq 2
348
November 2011
text ' ', <nlevelname> endwhen endparheading rows all summary temp nltot = nleveltotal() row nltot <nlevelname> endsummary
Example 2
...This is an example of a report using NLEVELPRINTED and NLEVELOTHER: SET Style leveltotal MISSING ' ' ... TABS ... WIDTH 5,15,8,4 DECIMAL 2 COLUMNS ONCE ORDER 0,1, "%" if NLevel()EQ 0 =c1/value(NLevelTotal(0),1)*100 if NLevel()EQ 1 =c1/value(NLevelTotal(1),1)*100 if NLevel()EQ 2 =c1/value(NLevelTotal(2),1)*100 otherwise = c1/Value(NLevelTotal(3),1)*100, 2, "%2" if NLevel()EQ 0=c2/value(NLevelTotal(0),2)*100 if NLevel()EQ 1 =c2/value(NLevelTotal(1),2)*100 if NLevel()EQ 2 =c2/value(NLevelTotal(2),2)*100 otherwise = c2/Value(NLevelTotal(3),2)*100 ... SUPPRESS formfeed,heading,missing,parheading SUPPRESS formfeed,heading,missing INDENT 2,4,6,3 '#' ENDSET Heading skip 1 ... Text c "<HEADING>" Text "&LatestDate - &DateString" .... Text "</HEADING>" EndHeading COLHEADING ... Text "<COLHEADING>" Text " ... ","&Member1 ","% Total ","&Member2 ","% Total"
Text "</COLHEADING>"
November 2011
349
ENDPARHEADING rows all summary temp nltot = nleveltotal() row nltot <nlevelname> row nlevelprinted() <printedcount> row nlevelother() <othercount> endsummary
Syntax
RESTORE CUSTOM <dimension> <owner>.<setname> [APPEND] Parameter <dimension> Description Name of the dimension or attribute whose saved User-Defined Hierarchies you want to restore for this session. By default, the current USE database is used. You cannot restore a User-Defined Hierarchy that was created in another database. Application Server user responsible for the User-Defined Hierarchy you want to restore. If you omit the owner, the current Application Server user name is used. Name of the procedure set the User-Defined Hierarchy was saved to when it was created and saved with the SAVE CUSTOM command. Restores all the User-Defined Hierarchies in the procedure set that had been appended with the SAVE CUSTOM <dimension> <setname> APPEND command. Note: You can restore up to the number of User-Defined Hierarchies limitation set in the CUSTOM N statement of the dimension.
Notes:
To restore a User-Defined Hierarchy, you must be either the administrator or the owner. If you restore the User-Defined Hierarchies for a dimension, it removes any of the dimension's User-Defined Hierarchies that have not been saved.
Syntax
RESULT <name> [ '<label>' ]
350
November 2011
Description Name of the result member, up to 96 bytes (including periods and underscores). Name must begin with a letter. To include a space in a name, replace the space with an underscore (_), or enclose the name in single quotation marks (' '). Result names tend to have a prefix TOTAL_, for example, TOTAL_PRODUCTS. Specifies a text string to assign to the result member, enclosed in single quotation marks (' '). The <label> option is equivalent to the LABEL keyword in a CONSTRUCT command.
'<label>'
Remarks
Use SET SHORT|LONG to determine whether member names or labels are displayed. You must not place the rollup rules immediately after the result member if you have not specified a label for the result member. This is because Application Server will be unable to determine whether the first token in the rollup rules is intended for use as a label or as a rollup rule. To avoid this problem, do one of the following: Specify a label for the result member Place a CLASS or a LEVEL statement between the RESULT statement and the rollup rules.
Example
INPUT BOSTON ,NEW_YORK ,ATLANTA ,ORLANDO ,HOUSTON ,CHICAGO ,LOS_ANGELES ,SEATTLE OUTPUT NORTHEAST ,SOUTHEAST ,MIDWEST ,WEST RESULT TOTAL_REGION NORTHEAST= SUM BOSTON, NEW_YORK SOUTHEAST= SUM ATLANTA, ORLANDO MIDWEST= SUM HOUSTON, CHICAGO WEST= SUM LOS_ANGELES, SEATTLE TOTAL_REGION = SUM NORTHEAST, SOUTHEAST, MIDWEST, WEST
6.150 RETURN
Use
RETURN stops the current process.
November 2011
351
Syntax
RETURN
6.151 ROLLUP
Syntax
ROLLUP [<variable> | <dimension1>, <dimension2>, ..., <dimension_n>]
Editor Syntax
[ ADD {<number> [,, <number>] | <dimension> {Input|Output} [,, <dimension> {INPUT|OUTPUT }] | EVERYBODY } ] [ REMOVE {<number> [,, <number>] | <dimension> {Input|Output} [,, <dimension> {INPUT|OUTPUT}] | EVERYBODY } ] [ SHOW [COUNT] ]
[ CHANGE {<number> [,, <number>] | <dimension> { INPUT|OUTPUT } [,, <dimension> { INPUT|OUTPUT } ] } { {UPDATE [OVERWRITE | NOOVERWRITE] [CONSOLIDATE <dimension> [,...,<dimension>] ] } | {DYNAMIC | STATIC} | {CONSOLIDATE} | {PRECONSOLIDATED | UNCONSOLIDATED} } ]
END | QUIT
Use
When you enter ROLLUP <variable>, Application Server creates a table based on the dimensions associated with that variable and all other variables with the same dimensions. You can view the table using the SHOW or SHOW COUNT command in the Rollup editor. You can remove, change, or add quadrants in the table. When you specify a dimension list with the ROLLUP command, all current and future variables dimensioned by the names in the list are affected by the subsequent Rollup editor commands. The ROLLUP command starts the Rollup editor, which allows you to do any of the following: Display the quadrants and their rollup instructions and their percentage that they are already consolidated. See the ROLLUP SHOW syntax. Specify the member combinations (quadrants) to use in a fast or smart consolidation. A smart or fast consolidation follows a strictly additive rule, where it gets each series from the database for a particular variable and adds it to its parent. Only simple additions and subtractions are used to roll up child series into their parents. See the ROLLUP ADD sytnax. Remove time-series combinations that Application Server does not need for reporting and analysis. By specifying the unnecessary combinations that you do not want to be consolidated, it reduces the size of the database and increases calculation speeds. See the ROLLUP REMOVE syntax. Perform a normal consolidation, which executes the consolidation statements defined in the dimension. You might want to perform a normal consolidation when data is loaded at the output level for certain combinations. Specify that certain member combinations will be consolidated on the fly on an as needed basis. The combinations would be consolidated whenever any commands are issued that require data
352
November 2011
about the combinations. The aggregations are not saved in the database from session to session. See the ROLLUP CHANGE <numbers> DYNAMIC syntax. Specify that certain data is loaded at the output level for certain combinations See the ROLLUP CHANGE <number> UPDATE CONSOLIDATE syntax. Note: The number of potential time-series combinations for a variable is calculated by multiplying together the total number of members for each dimension that the variable is dimensioned by. If your dimension includes an ALLOCATE statement you must use the total allocated not the actual number contained in the dimension. The maximum is 18,446,744,060,000,000,000 (1.8446744 e19) combinations. If you exceed the combination limit, you could redesign the model by either removing the variable and recreating it with fewer dimensions, reducing the number of levels in a dimension, or changing levels into attributes.
Parameter <variable> Description Name of a variable whose dimension combinations you want to include or exclude. Variable names that use special characters should be in single quotation marks (' '). A list of dimensions whose combinations you want to include or exclude. Editor Syntax ADD {<number> [,, <number>] | <dimension> { INPUT|OUTPUT } [,, <dimension> { INPUT|OUTPUT }] | EVERYBODY } ADD <number> <dimension> Adds the specified combinations. One or more numbers, or ranges of numbers, separated by commas. Each number represents a particular combination of input and output members. Specifies the name of the dimension to be affected by the CHANGE command. Note: The list used to qualify the member combinations can contain all or some of the dimensions for the specified variable. Dimensions not specified in the list automatically have both input and output members included as part of the overall combination definition. Input Output EVERYBODY Specifies that the dimensions input level will be affected by the CHANGE command. You can specify the Input keyword or simply the letter I. Specifies that the dimensions output level will be affected by the CHANGE command. You can specify the Output keyword or simply the letter O. Adds all combinations.
REMOVE {<number> [,, <number>] | <dimension> { INPUT|OUTPUT } [,, <dimension> { INPUT|OUTPUT }] | EVERYBODY }
REMOVE Removes (does not consolidate) the combinations that are not relevant. When you exclude the combinations for a specific variable, the combinations for all other variables with the same dimension structure are excluded. One or more numbers, or ranges of numbers, separated by commas. Each number represents a particular quadrant. Specifies the name of the dimension to be affected by the CHANGE command. Note: The list used to qualify the member combinations can contain all or some of the dimensions for the specified variable. Dimensions not specified in the list automatically have both input and output members included as part of the overall combination definition. Input Output EVERYBODY Specifies that the dimensions input level will be affected by the CHANGE command. You can specify the Input keyword or simply the letter I. Specifies that the dimensions output level will be affected by the CHANGE command. You can specify the Output keyword or simply the letter O. Removes all combinations (default).
<number> <dimension>
November 2011
353
& means that there's data input at output levels, but existing series will not be overwritten during consolidation. This identifies that a NOOVERWRITE keyword was issue. ! means that the quadrant is marked with the DYNAMIC keyword and will be consolidated on the fly. $ means that the quadrant is marked as PRECONSOLIDATED so it will not be consolidated during a fast consolidation. CHANGE syntax Use the CHANGE syntax to do either of the following: Specify that particular quadrants have input data at the output level and that those quadrants will be consolidated from the output level. For example, you might have channel sales transactions without knowing whether the sales are from direct sales or distributor sales. Note: Typically, a dimension's input level contains the loaded, raw data. During a consolidation, the input level quadrants are consolidated into the output levels. Specify that particular quadrants will be consolidated on the fly whenever the combinations are needed in the execution of another command. For example, a LIST, DISPLAY, or CALCULATE command that uses the combination would cause the combination to be consolidated on the fly. This temporary consolidation is not saved in the database from session to session.
CHANGE
{<number> [,, <number>] | <dimension> {INPUT|OUTPUT} [, , <dimension> { INPUT|OUTPUT }]} { { UPDATE [OVERWRITE | NOOVERWRITE] [CONSOLIDATE <dimension> [,...,<dimension>] ] } |
{DYNAMIC | STATIC} | {CONSOLIDATE} | {PRECONSOLIDATED | UNCONSOLIDATED} } <number> One or more numbers, or ranges of numbers, separated by commas. Each number represents a particular combination of input and output members whose status will be modified by the CHANGE statement. Specifies the name of the dimension to be affected by the CHANGE command. Note: The list used to qualify the member combinations can contain all or some of the dimensions for the specified variable. Dimensions not specified in the list automatically have both input and output members included as part of the overall combination definition. INPUT OUTPUT UPDATE Specifies that the dimensions input level will be affected by the CHANGE command. You can specify the Input keyword or simply the letter I. Specifies that the dimensions output level will be affected by the CHANGE command. You can specify the Output keyword or simply the letter O. Turns on an UPDATE status for the quadrant, signifying that this is the quadrant into which data is read in for the variable(s). Note: After an UPDATE statement is issued, Application Server indicates the changed quadrant with an asterisk (*) when you execute a SHOW statement in the Rollup editor.
<dimension>
354
November 2011
OVERWRITE NOOVERWRITE
Specifies that you want to overwrite existing consolidated series during the consolidation. Specifies that you do not want to overwrite existing consolidated series during the consolidation. This would preserve existing consolidated data even if it was not additive in a pure additive sense. Note: After a NOOVERWRITE statement is issued, Application Server indicates the changed quadrant with an ampersand (&) when you execute a SHOW statement in the Rollup editor.
CONSOLIDATE <dimensions> [,...<dimension>] Specifies that Application Server loads data at the output level for a dimension and that the output level is not the topmost output level in that dimension. Informs Application Server that more consolidation is required. <dimension> is one or more dimension names that have data loaded at an intermediate (not highest) output level, implying that more consolidation is necessary. Separate dimension names with commas. When specified with NOOVERWRITE, the CONSOLIDATE keyword will apply the NOOVERWRITE for loaded, read-only series only in output series that have been created by either ACCESS READ or CALCULATE DATA. The CONSOLIDATE keyword will not preserve any output series created by the CALCULATE command without the DATA keyword or series created in a prior consolidation. DYNAMIC Specifies that the quadrants will be consolidated on the fly whenever the combinations are needed in the execution of another command. For example, a LIST, DISPLAY, or CALCULATE command that uses the combination would cause the combination to be consolidated on the fly. This temporary consolidation is not saved in the database from session to session. Note: After a DYNAMIC statement is issued, Application Server indicates the changed quadrant with an exclamation point (!) when you issue a SHOW statement. STATIC Specifies that the quadrant, which was previously marked as Dynamic and consolidated on the fly, will now be available for the default consolidation method. Note: After changing a combination back to static, you should perform a fast consolidate to preconsolidate that combination. Otherwise, subsequent LISTs or DISPLAYs or a DataView will not display any data for the combination. CONSOLIDATE Turns off the UPDATE status for the specified quadrant. Use CONSOLIDATE when the quadrant no longer has input data read in. Data for that quadrant is consolidated in the normal manner. Note: After an UPDATE CONSOLIDATE, Application Server indicates the changed quadrant with an asterisk (*) when you execute a SHOW statement in the Rollup editor. PRECONSOLIDATED Specifies that everything in this quadrant is completely consolidated, so this quadrant can be ignored completely during a fast consolidation. No series need be consolidated into this quadrant. During a fast consolidate, this quadrant is skipped, and this speeds up consolidation. Note: After a PRECONSOLIDATED statement is issued, Application Server indicates the changed quadrant with a dollar sign ($) when you issue a SHOW statement. UNCONSOLIDATED Specifies that some series in this quadrant need to be consolidated during a fast consolidation. If the quadrant is also set to OVERWRITE, then existing series will be overwritten. Exits from the Rollup editor and saves changes. Exits from the Rollup editor without saving changes.
Example
...Assume the Region, Product, and Manufacturer dimensions have the following levels:
November 2011
355
OWNERSHIP NAME
...Sales data exists at the Country level in the Region dimension, but is not provided at the lower ... levels. The ROLLUP SHOW statement reveals that quadrant 4 contains loaded data. ROLLUP Sales ADD EVERYBODY SHOW # 1 2 3 4 5 6 7 8 MANUFACTURER Input Output Input Input Output Output Input Output PRODUCT Input Input Output Input Output Input Output Output REGION Input Input Input Output Input Output Output Output % 0.0 0.0 0.0 100.0 0.0 0.0 0.0 0.0
...CHANGE 4 UPDATE changes the status of quadrant 4 to ensure proper consolidation of the data ... loaded at the output level of Region.Because the data is not loaded at the Result level of Region, ...CONSOLIDATE REGION indicates that further consolidation .is required CHANGE 4 UPDATE CONSOLIDATE REGION Changing the Following: # MANUFACTURER 4* Input PRODUCT Input REGION Output
Asterisk Indicates Data Is Entered For These Input/Output Combinations 1 Combination(s) Changed SHOW # 1 2 3 4* 5 6 7 8 MANUFACTURER Input Output+ Input Input Output Output+ Input Output+ PRODUCT Input Input Output+ Input Output+ Input Output+ Output REGION Input Input Input Output+ Input Output Output Output % 0.0 0.0 0.0 100.0 0.0 0.0 0.0 0.0
...Assume that data is now provided at the lowest level, City, for the Region dimension. You would
356
November 2011
... have to enter another CHANGE statement to indicate that Application Server should consolidate ...the variables in the normal manner: ROLLUP Sales CHANGE 4 CONSOLIDATE ...Alternatively you could use REMOVE and ADD commands to set the consolidation back to normal: ROLLUP Sales REMOVE EVERYBODY ADD EVERYBODY ...In the following example, data is entered at the output level for Product and Region, implying that ...quadrant 7 must be changed. The Product dimension has data entered at the Result level. Because ... it is the highest output level, it does not require further consolidation. Region has data entered at ... the State output level and this requires further consolidation. You would enter: ROLLUP SALES REMOVE EVERYBODY ADD EVERYBODY SHOW # 1 2 3 4 5 6 7 8 MANUFACTURER Input Output Input Input Output Output Input Output PRODUCT Input Input Output Input Output Input Output Output REGION Input Input Input Output Input Output Output Output % 0.0 0.0 0.0 0.0 0.0 0.0 100.0 0.0
CHANGE 7 UPDATE CONSOLIDATE REGION Changing the Following: # MANUFACTURER PRODUCT REGION 7* Input Output Output Asterisk Indicates Data Is Entered For These Input/Output Combinations 1 Combination(s) Changed SHOW # 1 2 3 4 5 6 7* MANUFACTURER Input Output+ Input Input Output Output Input PRODUCT Input Input Output+ Input Output+ Input Output REGION Input Input Input Output+ Input Output+ Output+ % 0.0 0.0 0.0 0.0 0.0 0.0 100.0
November 2011
357
Asterisk Indicates Data Is Entered For These Input/Output Combinations A Plus Sign(+) Indicates the Dimension to be Consolidated ...In the example above, if data is entered at an output level of the ...Product dimension instead of the Result, the CHANGE command would be: ROLLUP SALES CHANGE 7 UPDATE CONSOLIDATE PRODUCT, REGION
6.152 ROUND( )
Use
ROUND rounds numbers to the nearest thousand, million, billion, or trillion. You specify the number of decimal places to round.
Syntax
CALCULATE <result> = ROUND(<variable>, <number>) Parameter <result> <variable> <number> Description Name of the result variable. Name of the variable to round. Variable names that use special characters should be in single quotation marks (' '). Number of decimal places to round. For example, three rounds up to the nearest thousand and six rounds up to the nearest million.
Example
...This example rounds up the value of Projected_Sales to the nearest thousand: CALCULATE Projected_Sales = ROUND(Sales, 3)
6.153 ROWS(Report)
Use
ROWS is a Report command that defines the data that appears across report rows. Follow ROWS with a list of expressions, and, optionally, labels associated with each expression. Either the expression or the label prints in the left-most column of that row. ROWS refers to the last down dimension specified, either in a SET-ENDSET block or in an across/down list. The expressions can include variable names.
Syntax
ROWS {ALL} {[<expression>]} {<expression> ['<text>'] [, ...,<expression> ['<text>'] ]} {CLASS <name>} Parameter ALL [<expression>] Description All members of the last down dimension. Labels in the left-hand column of the row are member names. Member of the last down dimension in position expression. You must use square brackets ([ ]). On keyboards without square brackets keys, use vertical bars (| |).
358
November 2011
<expression> <text>
Name of a member of the last down dimension or any arithmetic expression involving members. Optional label that precedes the specified results of the expression. If you do not supply text, Application Server prints the expression text in the left-most report column. Text can also include dimension names, enclosed in angle brackets (<>). Prints all rows that belong to a specific class. The name of the class.
CLASS <name>
Example: ROWS
...In this example, the last down dimension is Variables. The report prints a row with the label Sales in ... the left-most column followed by the values of the variable Sales, and then another row with the .. label Expenses in the left-most column.followed by the values of the variable Expenses for each ... other dimension combination. ROWS Sales, Expenses ...In this example, the last down dimension is Variables. The report prints the label Profit in the left... most column of each row, followed by the results of the expression Sales - Expenses. ROWS Sales - Expenses Profit ...In this example, the last down dimension is Product. The report prints the product dimension ... member name (Cars, Trucks, Ambulances) in the left-most column of successive rows, followed by ... the data for that dimension member. ROWS Cars, Trucks, Ambulances ...In this example, the last down dimension is Time. The report prints the selected ...time periods in the left-most column of successive rows, followed by the data for that time period. ROWS ALL ...This example prints all the rows in the last down dimension, with a blank line between each row: SCALAR i DO i=1, NROWS() ROW [i] SKIP ENDDO ...This example would produce totals of MID_PRICE and LUXURY members of the dimension CARS: SUBTOTAL SUBTOTAL ROW CLASS MID_PRICE ENDSUBTOTAL MID_PRICE_TOTAL SUBTOTAL ROW CLASS LUXURY ENDSUBTOTAL LUXURY_TOTAL ENDSUBTOTAL GRAND_TOTAL
November 2011
359
Use
SAVE is an Access External command that saves your current description statements in a procedure, providing you with a default set of descriptions that you can edit to match an external file format.
Parameter <procedure> Description Name of the procedure.
Syntax
SAVE CONTROL <procedure> [SYMBOLIC] [OVERWRITE] Parameter <procedure> SYMBOLIC OVERWRITE Description Name of the procedure. Saves the dimension members of a SELECT command by their member names. Overwrites a procedure with the same name.
Example
...This example saves the control variable Logset: SAVE CONTROL Logset
Syntax
SAVE CUSTOM <dimension> {<setname> | <owner>.<setname>} [OMIT <user_defined_hierarchy>] [OVERWRITE] [PRIVATE | PUBLIC ] [ CHANGE <user_defined_hierarchy> = { SELECTED | <expression> } ] [APPEND <user_defined_hierarchy> | DELETE <user_defined_hierarchy> ] Parameter <dimension> <setname> <owner>.<setname> Description Name of the dimension or attribute whose User-Defined Hierarchies you want to save. Name of the procedure set in which to save the User-Defined Hierarchy information. Specifies the Application Server user who is responsible for the User-Defined Hierarchy and the procedure set in which to save the User-Defined Hierarchy.
360
November 2011
Use SAVE CUSTOM <dimension> <owner>.<setname> to save a User-Defined Hierarchy and its related compiled dimension sets to CGLIB so they can be reproduced again during a RESTORE command. <owner> is the Application Server user who created the User-Defined Hierarchy. If you omit the owner name, it is saved to the current user name. <setname> is the name of the procedure set in which to save the User-Defined hierarchy. The User-Defined Hierarchy is saved to the current USE database. OVERWRITE Overwrites a procedure with the same name. Note: Only the administrator or owner can overwrite the User-Defined Hierarchy. OMIT <user_defined_hierarchy> Indicates one User-Defined Hierarchy that will be omitted from the save. <user_defined_hierarchy> is the name of the User-Defined Hierarchy to omit. PRIVATE Saves the User-Defined Hierarchy in CGLIB with no permissions to any other user but the user who created it. This User-Defined Hierarchy is private and available only to the user who created it. Saves the User-Defined Hierarchy in CGLIB with READ permissions for all users. Users can access and use public User-Defined Hierarchies. Saves any changes to a User-Defined Hierarchy definition that occurred during a CREATE <dimension> REPLACE <user_defined_hierarchy> command, and updates the procedure that defines this User-Defined Hierarchy. This way, all User-Defined Hierarchies that embed this User-Defined Hierarchy in their definition will be updated. Saves only selected members to this User-Defined Hierarchy. <member> ["<label>"] [+ <member> | - <member>] [+ <member> | - <member>] or <user_defined_hierarchy> [+ <user_defined_hierarchy> | <user_defined_hierarchy>] <member> <label> Members to add or remove from the User-Defined Hierarchy. You can add and subtract members using the plus (+) and minus (-) signs. Optional label for a User-Defined Hierarchy member. Must be in double quotation marks (" "). Use up to 250 characters.
PUBLIC CHANGE
SELECTED <expression>
<user_defined_hierarchy> Name of an existing User-Defined Hierarchy to add or remove from the UserDefined Hierarchy. You can add and subtract User-Defined Hierarchies using the plus (+) and minus (-) signs. APPEND <user_defined_hierarchy> [,<user_defined_hierarchy>] Adds User-Defined Hierarchies to saved procedure sets. <user_defined_hierarchy> is the name of the User-Defined Hierarchy you want to add. For example, in the command SAVE CUSTOM Product prod_udh_set PUBLIC APPEND myproducts, the User-Defined Hierarchy myproducts will be added to the procedure set prod_udh_set for the Product dimension. If the procedure set does not exist yet, it will be created. Note: You can append up to the number of User-Defined Hierarchies that were specified in the CUSTOM <n> statement in the dimension set. DELETE <user_defined_hierarchy> [,<user_defined_hierarchy>] Deletes User-Defined Hierarchies from saved procedure sets that were appended using the SAVE CUSTOM APPEND command. <user_defined_hierarchy> is the name of the User-Defined Hierarchy you want to delete. For example, in the command SAVE CUSTOM Product prod_udh_set PUBLIC DELETE myproducts, the User-Defined Hierarchy myproducts will be deleted from the procedure set prod_udh_set for the Product dimension. Notes:
November 2011
361
Application Server Command Reference SAVE DATA When you use SAVE CUSTOM with PUBLIC or PRIVATE, the User-Defined Hierarchy is saved to the procedure set and the compiled dimension changes are saved too. When you execute a RESTORE command in the next session, the compiled dimension changes are copied from CGLIB and the User-Defined Hierarchies are restored. This avoids having to recreate the User-Defined Hierarchies in every new session, and the User-Defined Hierarchies can be quickly retrieved when you restore them. When you use SAVE CUSTOM without the PUBLIC or PRIVATE keywords, the User-Defined Hierarchies are saved to the procedure set so they can be recreated for the next session when you execute the procedure set. The User-Defined Hierarchies are available only to the user who created them. Only the administrator or owner can save a User-Defined Hierarchy using the OVERWRITE keyword.
Example
...This example creates a User-Defined Hierarchy for the Region dimension called My_Reg and then ... saves all the Region dimension's User-Defined Hierarchies to a procedure called My_Reg_grp: CREATE Region My_Reg=MA+NH SAVE CUSTOM Region My_Reg_grp ...The procedure set would look like this: TYPE MY_REG_GRP Begin Create REGION MY_REG = +MA +NH End
Syntax
SAVE DATA [<variables>] Parameter <variables> Description One or more temporary variable names separated by commas (,). If you do not specify a variable name, Application Server saves all temporary variables. Variable names that use special characters should be in single quotation marks (' ').
362
November 2011
Syntax
SAVE [<dimension>] STATUS <procedure> [OVERWRITE] [SYMBOLIC] [SCRIPT] [ORDER] [EARLIEST] [LATEST] [USE] Parameter <dimension> <procedure> OVERWRITE SYMBOLIC Description Specify this parameter to save just the selection status for the specified dimension. The name of the procedure you want Application Server to create. Overwrites a procedure with the same name as <procedure>. Specify the SYMBOLIC keyword to saves the selected dimension members using their member names. If you omit this keyword, Application Server saves the selected members using their numeric position, for example, #1, #2, #3, and so on. Note: If you use SYMBOLIC in conjunction with the SCRIPT keyword, numeric member name references in the SELECT command are replaced in the SAVE STATUS procedure with the short member names. SCRIPT Saves the last SELECT command, rather than the list of members currently selected. If the dimension(s) changes, this option guarantees the same result, whereas members would be different. Note: If you use SCRIPT in conjunction with the SYMBOLIC keyword, numeric member name references in the SELECT command are replaced in the SAVE STATUS procedure with the short member names. ORDER Stores the last ORDER command for each dimension, if any. This option is only effective if the last SELECT command for that dimension was not SELECT <dimension> WHERE. Stores the earliest date in the defined procedure set. Normally, this is stored in the set in a comment format that is, preceded by an ellipsis (...). For example: ... Set Earliest 01 Jan 1999 LATEST Stores the latest date in the defined procedure set. Normally, this is stored in the set in a comment format that is, preceded by an ellipsis (...). For example: ... Set Latest 30 Jun 2000 USE Adds a line to the procedure to use the current Use database.
EARLIEST
Example
...This example shows what happens for a given status situation: STATUS Across List: TIME Down List: MERCHANDISE 2 VARIABLES SAVE STATUS Setup TYPE PROCEDURE Setup FOOTWEAR, SPORTSWEAR 1 SALES # Selected
November 2011
363
6.159 SD( )
Use
SD returns the standard deviation of the specified variables.
Syntax
CALCULATE <result> = SD(<input> [,..., <input> ]) Parameter <result> <input> Description Name of the result variable. One or more variable names for which you want to calculate the standard deviation.
Syntax
SELECT <dimension>[;<database>] [PLUS | MINUS] { <members> } { USING <variable> [PERIOD <period>] } { [EQ | IS | NE | ISNT] <members> } { ABOVE <member> | BELOW <member> } { ONLY { ABOVE <member> | BELOW <member> } } { JUST { ABOVE <member> | BELOW <member> } } { ONLY JUST { ABOVE <member> | BELOW <member> } [SECURITY] } { DRILL ABOVE <member> | DRILL BELOW <member> } { AFTER <member> | BEFORE <member> } { WHERE [<attribute>] [<expression>] [<member> ] [ACROSSDOWN] } { INPUT | OUTPUT | RESULT | CUSTOMGROUPS} { NONE } { <user_defined_hierarchy> } { BELOW <user_defined_hierarchy> } { LEVEL <level> [ MINUS CUSTOMGROUPS] | [ WHERE [<attribute>] [<expression>] [<member>] ] } Parameter <dimension> Description Name of the dimension whose members you want to select. To select dimension members from a database other than the Use database, suffix the dimension name with ;<database>, where database is the name of an attached database. For example, SEL Product;Juice By default the SELECT <dimension> command looks for the dimension only in the current model. You can select a dimension from an attached dimensional model. Separate the dimension and database name with a semi-colon (;). Adds the specified members to those already selected. Removes the specified members from those already selected.
;<database>
PLUS MINUS
364
November 2011
Note: If you do not use the PLUS or MINUS keywords, Application Server only selects those members that meet the selection criteria specified in the expression. <members> Name of one or more dimension members, levels, classes, or User-Defined Hierarchies, separated by commas, for example, SELECT <dimension> #1,#10. You can also use an asterisk (*) in a name as a wildcard that indicates that any character can occupy that position or any of the remaining positions in the name. You can also specify a range; for example, SELECT <dimension> #1-30 would select the first thirty members. Examines all series of the measure and selects those members of the relevant dimension for which the series is not empty. When you are using a Security procedure to limit access, then SELECT dimension USING will only return members that you have access to. One of the following periods: yty The latest period back to the equivalent period one year ago. yrago The latest period one year ago. current The period set with a SET LATEST command. previous The previous period. latest The period set with a SET LATEST command. EQ | IS NE | ISNT ABOVE Selects all specified members. Selects all members other than those specified. Selects the specified member and all the members in the path above it. If the dimension contains multiple hierarchies, <member> is a member in the currently set hierarchy. SELECT ABOVE selects the specified member and all the members in the same hierarchy above it. <member> JUST ABOVE ONLY ABOVE ONLY JUST ABOVE Name of the member. Selects the specified member and the member in the path directly above it. Selects all members in the path above the specified member, but not including the specified member. Selects only the member in the path directly above the specified member.
USING <variable>
PERIOD <period>
BELOW
Selects the specified member and all members in the path below it. If the dimension contains multiple hierarchies, <member> is a member in the currently set hierarchy. SELECT BELOW selects the specified member and all the members in the same hierarchy below it.
Selects the specified member and the members directly below it. Selects all members in the path below the specified member, but not including the specified member. Selects only the members in the path directly below the specified member.
SECURITY
Filters the selection to only those items that have security applied in a Security procedure.
November 2011
365
WHERE <expression>
Selects all members of the currently selected dimension (and the default member of other dimensions) for which the specified expression is true for any period. The parameter <expression> is a logic expression. Note: You cannot select dimensions using a WHERE clause. Instead, use BEFORE, AFTER, ABOVE and BELOW, and so on. For example, if you have a dimension called TEST, instead of entering: SELECT TEST WHERE TEST GE '00:15' enter: SELECT TEST AFTER '20:15'
ACROSSDOWN
Use this keyword if you have attributes selected and included in your across/down list, or if the dimension that you are selecting is an attribute dimension. ACROSSDOWN indicates that the data contained in the models attributes needs to be considered during the SELECT. Otherwise, the attributes result member will be used, even if the result is not selected. If your dimensional model (or the current view) does not contain attributes, this keyword is ignored. Selects the dimension's input members. If the dimension contains multiple hierarchies, INPUT lists only the input members that are part of the currently set hierarchy. Selects the dimension's output members. If a dimension contains multiple hierarchies, OUTPUT lists only the output members that are part of the currently set hierarchy. Selects the dimension's result member. Selects the dimension's User-Defined Hierarchies.
INPUT
OUTPUT
RESULT CUSTOMGROUPS
366
November 2011
NONE
Used in an INDEX USER-CASE *-ENDINDEX construct in a procedure as a default CASE to prohibit the view of a dimension from all the users without an assigned view. Name of the attribute you want to select.
<attribute>
<user_defined_hierarchy> Name of the User-Defined Hierarchy you want to select based on the CREATE <dimension> <user_defined_hierarchy> command. BELOW <user_defined_hierarchy> Used for selecting the members below the User-Defined Hierarchy as well as the User-Defined Hierarchy itself. Use this to show the total User-Defined Hierarchy value and the members that make up the total. LEVEL Specifies a dimension level, as in: SELECT Product LEVEL Product_Name where Product_Name is a dimension level of the dimension Product. <level> Name or number of the dimension level. MINUS CUSTOMGROUPS Selects members at a given level and excludes User-Defined Hierarchies.
Syntax
SELECT <attribute>[;<database>] [PLUS | MINUS] { <members> } { USING <variable> [PERIOD <period>] } { [EQ | IS | NE | ISNT] <members> } { [ONLY] ABOVE <member> | BELOW <member> } { [JUST] ABOVE <member> | BELOW <member> } { [ONLY JUST] ABOVE <member> | BELOW <member> } { DRILL ABOVE <member> | DRILL BELOW <member> } { AFTER <member> | BEFORE <member> } { WHERE [<dimension>] [<expression>] [<member> ] [ACROSSDOWN] } { INPUT | OUTPUT | RESULT } { NONE } { <user_defined_hierarchy> } { BELOW <user_defined_hierarchy> } { LEVEL <attlevelname> WHERE [<dimension>] [<expression>] [<member>] } Parameter <attribute> Description Name of the attribute whose members you want to select. To select attribute members from a database other than the Use database, suffix the attribute name with ;<database>, where database is the name of an attached database. For example, SEL Flavor;Juice. By default the SELECT <attribute> command looks for the attribute only in the current model. You can select an attribute from an attached dimensional model. Separate the attribute and database name with a semi-colon (;). Adds the specified members to those already selected. Removes the specified members from those already selected. Note: If you do not use the PLUS or MINUS keywords, Application Server only selects those members that meet the selection criteria specified in the expression. <member> Member of the attribute you want to select. Separate multiple members with commas. You can also use an asterisk (*) in a name as a wildcard that indicates
;<database>
PLUS MINUS
November 2011
367
BELOW
Selects the specified member and all members in the path below it. If the attribute contains multiple hierarchies, <member> is a member in the currently set hierarchy. SELECT BELOW selects the specified member and all the members in the same hierarchy below it.
Selects the specified member and the members directly below it. Selects all members in the path below the specified member, but not including the specified member. Selects only the members in the path directly below the specified member.
DRILL ABOVE
Selects the members across all paths directly above the specified member, but not including the specified member. If the attribute contains multiple hierarchies, member is a member in the currently set hierarchy. DRILL ABOVE selects the members above the specified member in the currently set hierarchy, but not including the specified member.
Selects the members directly below the specified member regardless of hierarchy, but not including the specified member. Selects all input members after the specified member, based on their order in the attribute definition.
368
November 2011
BEFORE
Selects all input members before the specified member, based on their order in the attribute definition.
WHERE <expression>
Selects all members of the currently selected attribute (and the default member of other attribute) for which the specified expression is true for any period. The parameter <expression> is a conditional expression such as IS or GT. Note: You cannot select attributes using a WHERE clause. Instead, use BEFORE, AFTER, ABOVE and BELOW, and so on. For example, if you have a attribute called Flavor, instead of entering: SELECT Flavor WHERE Flavor GE '00:15' enter: SELECT Flavor AFTER '20:15'
ACROSSDOWN
Use this keyword if you have attributes selected and included in your across/down list, or if the dimension that you are selecting is an attribute dimension. ACROSSDOWN indicates that the data contained in the models attributes needs to be considered during the SELECT. Otherwise, the attributes result member will be used, even if the result is not selected. If your dimensional model (or the current view) does not contain attributes, this keyword is ignored. Selects the attribute's input members. If the dimension contains multiple hierarchies, INPUT lists only the input members that are part of the currently set hierarchy. Selects the attribute's output members. If a dimension contains multiple hierarchies, OUTPUT lists only the output members that are part of the currently set hierarchy. Selects the attribute's result member. Used in an INDEX USER-CASE *-ENDINDEX construct in a procedure as a default CASE to prohibit the view of an attribute from all the users without an assigned view. Name of the attribute you want to select.
INPUT
OUTPUT
RESULT NONE
<attribute>
<user_defined_hierarchy> Name of the User-Defined Hierarchy you want to select based on the CREATE <dimension> <user_defined_hierarchy> command. BELOW <user_defined_hierarchy> Used for selecting the members below the User-Defined Hierarchy as well as the User-Defined Hierarchy itself. Use this to show the total User-Defined Hierarchy value and the members that make up the total. LEVEL Specifies an attribute level, as in: SELECT Flavor LEVEL Ades where Ades is an attribute level of the attribute Flavor. <attlevelname> Name of the attribute level.
do not enter:
November 2011
369
Syntax
SELECT MEASURES {VIRTUAL | NONVIRTUAL} { EXCLUDE } { [ONLY] [JUST] BELOW <virtual_variable> [VIRTUAL | NONVIRTUAL] } { [ PLUS | MINUS ] <variables> [VIRTUAL | NONVIRTUAL] [EXCLUDE] } { [ PLUS | MINUS ] [BY <dimensions> | UNDIMENSIONED] [<periodicity>] [VIRTUAL | NONVIRTUAL] [EXCLUDE] } { [ PLUS | MINUS ] FROM {<report> | <logic> | <virtual_variable> } [RECURSE] [TEMPORARY | PERMANENT] [SORT [REVERSE] ] [VIRTUAL | NONVIRTUAL] [EXCLUDE] } { [INPUT | OUTPUT] [<periodicity>] [VIRTUAL | NONVIRTUAL] [EXCLUDE] } Parameter MEASURES Description Selects only non-attribute variables in your Use database. Note: In all cases, if you select measures without a PLUS or MINUS keyword, Application Server always deselects any previously selected variables and then selects according to the new SELECT command. VIRTUAL NONVIRTUAL EXCLUDE ONLY BELOW Selects virtual measures. This keyword can be used with other SELECT MEASURE keywords. Selects non virtual measures. This keyword can be used with other SELECT MEASURE keywords. Selects the specified variables, but omits hidden variables. Selects all the variables that make up this virtual variable. If a virtual variable is used in the specified virtual variable, then the variables that make up that virtual variable are also selected. The specified virtual variable is not selected. Selects the specified virtual variable and all the variables that compose the specified virtual variable. If a virtual variable is used in the specified virtual variable, then the virtual variable is selected, but the variables that make up that virtual variable are not selected. Selects the specified virtual variable and all the variables that make up this virtual variable. If a virtual variable is used in the specified virtual variable, then the variables that make up that virtual variable are also selected. Selects all the variables that compose the specified virtual variable. If a virtual variable is used in the specified virtual variable, then the virtual variable is selected, but the variables that make up that virtual variable are not selected. The specified virtual variable is not selected. Specifies the virtual variable whose variables and virtual variable hierarchies you want to select. Selects the specified variables in addition to those currently selected. Removes the specified variables from those currently selected. One or more variable names or labels separated by commas. You can use the following qualifiers: OF, IN, FROM, and VERSION. VERSION can be abbreviated to one character. You can use the qualifier, yrago. You can follow a variable name with an alternate name, enclosed in double quotation marks (" "), to use instead of the default name.
JUST BELOW
BELOW
370
November 2011
BY <dimensions>
Indicates the variable is dimensioned by the specified dimensions, where <dimensions> is one or more dimension names separated by commas. Note: You must specify all the dimensions the variable is dimensioned by. Selects all undimensioned variables. Selects only those variables with one of the following periodicities: constant, yearly, semiannually, quarterly, monthly, lunar, bimonthly, biweekly, weekly, daily, or hourly. Selects variables from the specified report or logic set or virtual variable. Selects variables from the specified report. Selects variables from the specified logic set. Selects variables from the specified virtual variable. Selects the variables referenced in the logic, report, or virtual variable. If a virtual variable is used in the specified logic, report, or virtual variable, then RECURSE also selects the variables that compose that virtual variable. Sorts the variables in alphabetical order from a to z. Reverses the sort order of variables so they are listed from z to a. Selects temporary variables in the specified report or logic set. Selects permanent variables in the specified report or logic set. Selects input variables in the specified report or logic set. Selects output variables in the specified report or logic set.
UNDIMENSIONED <periodicity>
Syntax
SELECT { VARIABLES [VIRTUAL | NONVIRTUAL] [EXCLUDE] } { VARIABLE [ONLY] [JUST] BELOW <virtual_variable> [VIRTUAL | NONVIRTUAL] } {VIRTUAL | NONVIRTUAL} {UNDIMENSIONED} { [PLUS | MINUS] <variables> [VIRTUAL | NONVIRTUAL] [EXCLUDE] } { [PLUS | MINUS] [BY <dimensions> | UNDIMENSIONED] [<periodicity>] [VIRTUAL | NONVIRTUAL] [EXCLUDE] } { [PLUS | MINUS] FROM {<report> | <logic> | <virtual_variable> } [RECURSE] [TEMPORARY | PERMANENT] [SORT [REVERSE] ] [VIRTUAL | NONVIRTUAL] [EXCLUDE] } { [INPUT | OUTPUT] [<periodicity>] [VIRTUAL | NONVIRTUAL] [EXCLUDE] } { [<variable> [,<variable>]] [,COUNT OF <variable>] [,DISTINCT COUNT BY <dimension> [,<dimension>] OF <variable>] [VIRTUAL | NONVIRTUAL] [EXCLUDE] } { <variable> FROM <database> [VIRTUAL | NONVIRTUAL] [EXCLUDE] } Parameter VARIABLES Description Selects all variables in your Use database. Note: In all cases, if you select variables without a PLUS or MINUS keyword, Application Server always deselects any previously selected variables and then selects according to the new SELECT command. <variables> VIRTUAL Selects one or more variable names or labels separated by commas. You can use the following qualifiers: OF, IN, FROM, and VERSION. Selects virtual measures. This keyword can be used with other SELECT keywords.
November 2011
371
JUST BELOW
BELOW
372
November 2011
Note: This feature is available for simple variables, but not virtual variables. DISTINCT COUNT BY <dimension> [,<dimension>] OF <variable> Provides a distinct count of the number of individual time series for that dimension. Notes: You can perform a DISTINCT COUNT BY only on simple variables, not virtual variables. You can create up to 255 different DISTINCT COUNT OF transient measures for any one measure. VARIABLE <variable> FROM <database> By default, the SELECT VARIABLE command looks for the variable only in the USE database. You can select a variable from an attached database with the following command: SELECT VARIABLE <variable> FROM <database> EXCLUDE Selects the specified variables, but omits hidden variables.
Example: SELECT
...This example selects the members Footwear and Sportswear from the dimension Merchandise: SELECT Merchandise Footwear, Sportswear ...This example selects all members of the dimension Merchandise: SELECT Merchandise ...This example selects all merchandise areas where yearly sales are less than 100,000 in any period: SELECT Merchandise WHERE Sales LT 100000 ...Select all products whose profit margin is greater than 0.4 in any period: SELECT Merchandise PLUS WHERE Margin GT 0.4 ...This example selects all merchandise other than footwear: SELECT Merchandise NE Footwear ...This example selects the products bought by the customers of ...salesperson JUAN_PEREZ based on Sales. Entering USING Sales ...is more efficient and faster than entering WHERE Sales NE MISSING. SELECT Customer BELOW Juan_Perez SELECT Product USING Sales ...This example selects the My_products User-Defined Hierarchy: SELECT Product My_products ...This example selects the members of the My_products User-Defined Hierarchy, ...as well as the User-Defined Hierarchy itself: SELECT Product BELOW My_products ...This example selects products colored blue: SELECT Product WHERE Color IS Blue ...This example selects a dimension from an attached database DEMOMH: SELECT DIMENSION PRODUCT;DEMOMH ...This example selects members 1 and 10. SELECT dimension #1,#10 ...This example selects the first thirty members.
November 2011
373
374
November 2011
ACROSS TIME DOWN COLOR, VARIABLES LIST ...The output of this command would be: Jan Feb Red Sales Count of Sales White Sales Count of Sales Blue Sales Count of Sales ...This example selects SALES from the attached database DEMOMH: SELECT SALES FROM DEMOMH Mar
Syntax
SELECT VERSION <version> Parameter <version> Description Name of a version you want to select. The default version name is DEFAULT.
6.165 SET
Use
SET defines the default set for an Application Server session. A default set is the set automatically accessed when you enter commands but do not specify a set name. For example, assume use the command SET LOGIC CASHFLOW to make CASHFLOW the default logic set. If you enter the command LOGIC, Application Server automatically displays CASHFLOW in the Logic Editor; if you enter the command CALCULATE, Application Server automatically calculates CASHFLOW. If you do not define a default set with the SET command, the Application Server editors display the last accessed logic set, report, or procedure when you do not specify one.
November 2011
375
Syntax
SET {LOGIC <setname>} {PROCEDURE <setname>} {REPORT <setname>} {SYNONYM <setname>} {TIME <setname>} {DIMENSION <setname> [HIERARCHY {<hierarchy> | DEFAULT} ]} Parameter <setname> <hierarchy> Description Name of the default set. Name of a hierarchy to set for the dimension. Application Server uses the currently set hierarchy instead of the default hierarchy in these situations: When you use the SELECT command with ABOVE, BELOW, DRILL ABOVE, or DRILL BELOW, Application Server bases the selection on the currently set hierarchy. When you use the EXHIBIT command with a HIERARCHY statement, Application Server displays information for the dimension's currently set hierarchy. Notes: The hierarchy defined in the first HIERARCHY statement of the CONSTRUCT command is the default hierarchy. When you set a hierarchy, its dimension does not automatically become the default dimension unless you enter a separate SET DIMENSION command. DEFAULT Unsets the dimension's hierarchy. The default hierarchy is in effect.
Example
...This example defines the logic set CALC_ALL as the default and accesses it: SET LOGIC calc_all LOGIC ...This example defines Regions as the set hierarchy in the STORE dimension: SET DIMENSION Store HIERARCHY Regions
Syntax
SET BUFFERS <integer> Parameter <integer> Description Number of buffers between 50 and 64,000.
Note: If you set buffers too low or too high, you can slow Application Server response time.
Example
...This example sets the number of buffers to 1000: SET BUFFERS 1000
376
November 2011
Syntax
SET CELLS <integer> Parameter <integer> Description Number of cells to display. The default is no limit.
Syntax
SET CHARSET { INPUT | OUTPUT | EXTIN | EXTOUT } { ASCII | SHIFTJIS | JEUC | SCEUC | KEUC | UTF8 [BOM {ON | OFF} ] | SESSION | ISO2022 | ISO88591 | ISO88592 | ISO88593 | ISO88594 | ISO88595 | ISO88596 | ISO88597 | ISO88598 | ISO88599 | WINDOWS1250 | WINDOWS1251 | WINDOWS1252 | WINDOWS1253 | WINDOWS1254 | WINDOWS1255 | WINDOWS1256 | WINDOWS1257 } Parameter INPUT OUTPUT EXTIN EXTOUT ASCII SHIFTJIS JEUC SCEUC KEUC UTF8 BOM ON BOM OFF Description Identifies the CHARSET of the input. Identifies the CHARSET of the output to IDQL or the output sent to Interactive Publisher. Identifies the CHARSET of the input from an external file. Identifies the CHARSET of the output to an external file. Format of charset. Format of charset. Format of charset. Format of charset. Format of charset. Sets a UTF8 character set. Adds a byte order mark (BOM) at the beginning of UTF8 output files when using the EXTOUT UTF8 BOM ON. Turns off the display of the byte order mark at the beginning of UTF8 output files when using EXTOUT UTF8 BOM OFF. The default setting is off and the byte order mark is not displayed. Rolls back the CHARSET setting changed during the session. Sets an ISO character set. You cannot set this value on an existing database. Sets a Windows character set. You cannot set this value on an existing database.
Example 1
SET CHARSET INPUT UTF8 Tells Application Server that the input is encoded by UTF8.
November 2011
377
Application Server Command Reference SET CONTROL SET CHARSET OUTPUT SCEUC Tells Application Server that the output should be encoded by SCEUC SET CHARSET EXTIN SHIFTJIS Tells Application Server that the input from an external file is encoded by SHIFTJIS SET CHARSET EXTOUT KEUC Tells Application Server that the output to an external file should be encoded by KEUC SET CHARSET EXTOUT UTF8 BOM ON Tells Application Server that the output from an external file is encoded by UTF8 and contains a byte order mark at the beginning of the file.
Example 2
At the beginning, CHARSET OUTPUT is UTF8 and CHARSET SESSION is UTF8. Send a command: SET CHARSET OUTPUT KEUC (charset output changes to KEUC) SET CHARSET OUTPUT SESSION ( charset output rolls back to UTF8)
Syntax
SET CONTROL [$]<variable> { [']<value>['] | CLOCK | ELAPSED | MILLISEC | DELTA } Parameter <variable> $ Description Name of the control variable. Specifies that if this control variable is undefined when it is executed, treat it as null rather than producing an error. Note: By default, if you have a procedure that executes a standard SET CONTROL for a variable that does not yet exist, you will get an error message. If you need to run a procedure with undefined control variables, but you want the undefined control variables treated as null rather than as error-producing, you must add a dollar sign ($) as the first character of those control variable name. If Application Server detects an undefined control variable that begins with a $, that variable will be treated as null and will not cause an error. If Application Server detects an undefined control variable that begins with any character other than $, that will cause an error as appropriate. <value> CLOCK ELAPSED MILLISEC DELTA Value of the control variable. Stores the current date and time in the control variable. Stores the elapsed time (in seconds) since the last SET CONTROL CLOCK or SET CONTROL ELAPSED command. Stores the elapsed time (in milliseconds) since midnight (00:00:00), January 1, 1970. Stores the elapsed time in milliseconds since the last SET CONTROL MILLISEC or SET CONTROL DELTA command.
Example
...This example sets and uses the control variable Logset:
378
November 2011
SET CONTROL Logset Mylogic LOGIC &Logset ...This example assigns a date range to a control variable ...Week1, and then uses it to modify a listing: SET CONTROL Week1 'Jan 1 1999 Jan 7 1999' LIST PERIOD &Week1
Syntax
SET DATE <format> Parameter <format> Description A combination of Y (year), M (month), or D (day). The default format is YMD.
Example
...The date 7 August 2006 is ambiguous when represented as two-digit numbers separated by slashes: ... 07/08/06. This statement resolves the ambiguity: SET DATE dmy ...The date 02/03/00 can be interpreted as February 3, 2000, or as 2 March 2000. The following ... statement ensures that it is interpreted as February 3, 2000: SET DATE mdy
Syntax
SET DEFAULT [ AFTER <c> | OFF ] [ AUTO [OFF] ] [ BEFORE <c> | OFF ] [ COMMA <c> | , | . | OFF | LOCALE] [ CURRENCY <c> | $ | OFF ] [ DECIMALS <n> | LOCALE] [ FIX CURRENCY |NEGATIVE | DECIMAL ] [ FLOAT CURRENCY | NEGATIVE | DECIMAL ] [ MISSING <string> | BLANK | DEFAULT ] [ NEGATIVE <prefix> [ <suffix> ] | DEFAULT ] [ PAD [OFF] ] [ POINT <c> | . | , | LOCALE] [ REVERSE [OFF] ] [ SCALE <n> | OFF ] [ WIDTH <n> ] [ ZERO <string> | BLANK | DEFAULT | OFF ]
November 2011
379
380
November 2011
Reverses the position of currency and negative symbols. The default is the currency symbol followed by the negative symbol, for example, $-2.00. Returns the currency and negative symbols to the previous positions. Scaling factor; divides the number to be displayed by 10 to the power <n>. For example, scale 2 divides the number by ten to the second power, rounding down halves. That means that when you use scale 2, 2.505 is rounded to 2 decimal places to 2.50, not 2.51. Removes any previously set scaling factor. Number specifying the field width. The maximum width that you can set for a text variable is 50. Note: A text variables value can contain up to 255 characters. If a text variables value contains more characters than the width specified in WIDTH <n>, Application Server truncates the variables values to a width of <n>.
A string of up to seven characters to use for true zero values. Inserts a blank for true zero values. Inserts a dash (-) for true zero values. Removes any previous setting and displays a 0 for true zero values.
Remarks
SET DEFAULT specifies the default global formatting settings for all variables. However, if you use SET VARIABLES to change a formatting option for a variable, that variable will no longer use the default global formatting settings specified by SET DEFAULT. To compare the default global formatting settings with the current formatting settings for a variable, use the SHOW DEFAULT and EXHIBIT VARIABLE varname commands. If you use SET VARIABLES to change the formatting for a variable, you must use the REMOVEFORMATvariable command if you want to reset the variable so that it uses the global formatting settings.
November 2011
381
Syntax
SET DEFAULT <periodicity> ['<dateformat>'] Parameter <periodicity> ['<dateformat>'] Description Any one of the valid periodicities included in the list below. For example, bimonthly, quarterly, and so on. Any reserved letters, and any text you want to appear in the date format. The reserved letters are preceded by a percent sign (%), and are as follows: y (year), f (fiscal year), m (month), d (day), h (hour, 12-hour clock), t (hour, 24hour clock), s (am or pm), S (AM or PM), mi (minute), n (period number), and w (weekday name). The lowercase letters y, f, m, d, h, t, mi, and w indicate the starting year, month, day, and so on. The uppercase letters Y, F, M, D, H, T, MI, and W indicate the ending year, month, day, and so on. Periodicity avgytd bimonthly biweekly daily hourly lunar monthly mtd mytd qtd quarterly rmonthly rquarterly ryearly semiannual weekly wtd yearly ytd Tips: Default output 2000 Avg Jan-Feb 00 01 Jan 00 12am 30 Jan 28 Jan 00 Jan 00 Mtd Jan 00 Ytd Jan-Mar Qtd Jan-Mar 00 Jan-Mar 00 1999 %Y %3m-%3M %2Y %2D %3M %2Y %2D %3M %2Y %Y Ytd Jan-Jun 00 07 Jan 00 07 Jan 00 2000 %Y 2000 Ytd Default date format %Y Avg %3m-%3M %2y %2d %3m %2y %h%s %d %m %2D %3M %2Y %3M %2Y Mtd %3M %2Y Ytd %3m-%3M Qtd %3m-%3M %2Y %3m-%3M %2Y
31/01/00 %D/%2MM/%2Y
To display the month in alphabetic character format, use a single M. For example, %2D %3M %2Y gives 31 Jan 00. To display the month in numeric format, use MM. For example, %2D %2MM %2Y gives 31 01 00. To specify a single digit day or month, use %D or %MM without a number preceding the letters. For example, %D-%3M-%2Y gives 1-Jan-00. To display a 2-digit year, use %2Y. For example, %D/%2MM/%2Y gives 31/01/00. To display a 4-digit year, use %Y without a number preceding the Y. For example, %Y gives 2000. To display the full weekday name, use %W. To abbreviate the weekday name, use a number with W. For example, %3w %2d %3m %2y gives Tue 01 Nov 00.
382
November 2011
Syntax
SET DENSE {ON | OFF} Parameter ON OFF Description Confirms the CREATE variable DENSE command and creates the variable as dense. Ignores the DENSE keyword on any proceeding CREATE variable DENSE commands.
November 2011
383
Syntax
SET DETAIL { ALL | NONE | [ACROSS], [DIMENSION], [LONG], [CHILDREN], [DOWN], [LEVEL], [PARENTS], [ROWS], [SHORT], [SECURITY], [TYPE] } [DELIMITER { X'<nn>' | '<printable char>' | ' \<escaped char>' ] Parameter ALL Description Displays all detail information for the selections. Using ALL is the same as specifying all these options: SECURITY, ACROSS, DIMENSION, LONG, DOWN, CHILDREN, PARENTS, LEVEL, SHORT, ROWS, TYPE. Turns off all options. Specifies a delimiter other than a vertical bar ( | ) to display between values. If you do not use the DELIMITER keyword, the vertical bar will be used. Any hex number in the form <nn> where <nn> is {0,1,2,3,4,5,6,7,8,9,0,A,B,C,D,E,F}. For example, SET DETAIL ALL DELIMITER X'09' ... hex 09 is horizontal tab Any printable character. For example, SET DETAIL ALL DELIMITER '-'' Any one of these escape characters: \f Formfeed \n New line \r Carriage return \t Horizontal tab \v Vertical tab \' Single quotation mark \" Double quotation mark \\ Backslash ACROSS DIMENSION CHILDREN DOWN LEVEL Limits the detail information to the currently selected across dimensions. Displays the member's dimension. Displays the number of immediate children for each member. Limits the detail information to the currently selected down dimensions. Displays a number that represents the level in which this member exists. 1 represents the input level, 2, represents the first output level, 3 represents the next output level, and so on. Displays the long name (member label) of the member. Displays a 0 or 1 that represents whether this member is an orphan or has a parent. 0 means that the member is an orphan and 1 means that it has parents. Shows data for the last down dimension members. Displays the short name (member name) of the member. Reflects the security definitions of the dimension when displaying the output rather than that of the base dimension. For example, if a user has access to the lowest level of a dimension, the SET DETAIL command used with the SECURITY and PARENTS keyword would show that the member has 0 parents. If you don't specify SECURITY in the SET DETAIL keyword list or if you don't use the ALL keyword, then the results do not reflect security definitions. TYPE Displays a 0, 1, 2, 3, 4, or 5 that represents whether the member is an input member (0), output member (1), result member (2), User-Defined Hierarchy (3), class (4), or a Concentrate member (5). Note: A Concentrate member is the "All Others" member in applications such as Ranking.
384
November 2011
Syntax
You can specify one or more of the following options on the same line. Do not separate the options with commas.
SET [ACROSS <across>] [AFTER <c> | OFF ] [ALWAYS [NLEVEL <n>] <member> [, <member>...] [AUTO [ OFF ] ] [COLUMNS <n>] [COLUMNS ONCE ] [COMMA '<c>' | , | . | OFF] [CURRENCY '<c>' | , | . | OFF] [DECIMALS <list>] [DOWN <down>] [FIX CURRENCY | NEGATIVE | DECIMAL] [FLOAT CURRENCY | NEGATIVE | DECIMAL] [INDENT <n>[<n>,...<n>] ["<char>"]] [MISSING '<string>' | BLANK | DEFAULT] [NAMES <width>] [NEGATIVE '<prefix>' [ <suffix> ] ' | DEFAULT] [ORDER <columns> | COLTOTAL ['<colheading>'] ] [PAD [OFF]] [POINT '<c>' | . | , ] [PREFACE <inputid> <resultid> <outputid> | RANK [NLEVEL <n>] [<column>]] [PREFIX [ALWAYS <nn>] [REVERSE [ OFF ] ] [SCALE <n> | OFF] [SORT [NLEVEL <n> ] [COLTOTAL {<n> | LAST}] [ASCENDING | BOTTOM | LAST | TOP <n> | VALUE <n>] <column>] [STACK] [STYLE {LEVELTOTAL|TABLE} ] [SUPPRESS [WHERE <expression>] MISSING | ZERO | BOTH | FORMFEED | COLHEADING | PARHEADING ] [TABS] [TABS SINGLE]
November 2011
385
COMMA '<c>' COMMA , COMMA . COMMA OFF CURRENCY '<c>' CURRENCY $ CURRENCY OFF DECIMALS <list>
INDENT <n>[<n>,...<n>]["<char>"] Indicates the number of characters to indent for each down dimension specified, and, optionally, a character "<char>" (for example, ">"), to use for the indenting. The last indent is used for any subsequent dimension in the report. MISSING '<string>' A string of characters to insert for missing values. BLANK Inserts a blank for missing values.
386
November 2011
DEFAULT Inserts a dash (-) for missing values. NAMES <width> NEGATIVE Makes row names the specified number of characters wide, where <width> is the number of characters. You can use the following options: <prefix> A character to appear before a negative number. If you specify a prefix without a suffix, enclose it in single quotation marks (' '). For example, NEGATIVE (. <suffix> A character to appear after a negative number. Enclose the suffix in a set of single quotation marks (' '). For example, NEGATIVE ( ) displays negative numbers as ( 2,123 ) instead of as -2,123. DEFAULT Inserts a negative sign (-) before a negative number. [NEVER [NLEVEL <n>] <member> [<member>...] | WHERE <attributename> IS | ISNT | EQ | NE <membername> For a specified level, never shows the items defined, irrespective of any cut-off criteria. By default, the definitions are applied to the last down dimension rows. You can use the short or long label as the member name. ORDER <columns> Displays columns across a page in the specified order, where <columns> is one or more column numbers or expressions, separated by commas. See the REPORT ORDER command. Displays column subtotals with the default 'Total' heading or a specified heading. Specifies the column heading to use, enclosed in single quotes. If you do not specify a column heading, then 'Total' is used by default. Pads numbers with leading zeroes. Removes any padding. A character to use for the decimal point. Uses a period as the decimal point. Uses a comma as the decimal point. You can use the following options: {<inputid> <resultid> <outputid>} Adds a number, letter, or character next to each report row in column 1, where <inputid> is the identifier for the input level, resultid is the identifier for the result level, and <outputid> is the identifier for the output level. The number identifies the dimension level that this member is a part of. For example, PREFACE 132 places a 1 next to an input member, a 2 next to an output member, and a 3 next to a result member. PREFACE abc places letters next to the rows. RANK [NLEVEL <n>] [<column>] Specifies the nested level to use. The optional parameter <column> specifies the column to rank on. If you do not specify a value for <column>, the SORT column is used by default. You can use the RANK keyword to display the sorted position within the level, in either the SORT column or any other non-calculated column. The PREFACE RANK flag is followed by a single space. PREFIX REVERSE OFF SCALE <n> ALWAYS <nn> Prefixes items displayed as a result of an ALWAYS specification. Reverses the position of currency and negative symbols. The default is the currency symbol followed by the negative symbol, for example, $-2.00. Returns the currency and negative symbols to the previous positions. Scaling factor; divides the number to be displayed by 10 to the power <n>. For example, scale 2 divides the number by ten to the second power, rounding down halves. When you use scale 2, the value 2.505 is rounded to two decimal places, giving 2.50, not 2.51. Removes any previously set scaling factor.
SCALE OFF
November 2011
387
COLTOTAL {<n> | LAST } Sorts the rows of a report by the <n>th COLTOTAL column or by the last column total. ASCENDING Sorts the rows in ascending order. BOTTOM <n> Bottom <n> cut-off criteria. LAST Sorts on the last column in the report. NLEVEL <n> Sorts the rows within a specific nested level. To sort all levels, include a SORT NLEVEL <n> line for each level. TOP <n> Top <n> cut-off criteria. VALUE <n> Cumulative value cut-off (top or bottom, depending on the specified sort order). <column> One or more column numbers separated by commas, indicating the column to sort. Notes: NA values appear by default at the bottom of report output, and at the top of report output when ASCENDING is used. If you calculate a column based on a row position using ROW[<n>] after executing a SORT command, ROW[<n>] always refers to the <n>th sorted row. To refer to the <n>th unsorted row, use the syntax ROW[-<n>] instead. STACK STYLE LEVELTOTAL Displays labels for each column, corresponding to the Across dimension. Specifies the style of columns and rows. Specifies that a rolled up total should be generated for all down dimensions except the last. Also specifies the execution of the PARHEADINGENDPARHEADING and SUMMARY-ENDSUMMARY blocks for every level change, allowing the display of total rows for each level. Displays the down dimensions in separate columns with the member names repeated on every row. Suppresses form feeds. It can also suppress rows based on missing values or zero values. The options are: WHERE <expression> selectively suppresses or displays rows. The parameter <expression> is a logic expression. The example below will suppress all rows that have no value in columns 1, 2, and 3. The operators AND and OR can be used along with EQ, LT, GT, etc. Set suppress where c1 eq missing or c2 eq missing or c3 eq missing endset rows all MISSING Suppresses rows that contain only missing values. ZERO Suppresses rows that contain only zeros. BOTH Suppresses rows that contain zeros and missing values. FORMFEED Suppresses the form feed at the top of a report, so that several reports can appear on one page. COLHEADING Suppresses column headings defined in a COLHEADINGENDCOLHEADING block. If you do not define a column heading block, SUPPRESS COLHEADING suppresses the default column headings, which are the selected members of the Across list. PARHEADING Suppresses paragraph (partition) headings defined in a PARHEADING-ENDPARHEADING block. If you do not define a paragraph heading block, SUPPRESS PARHEADING suppresses the default paragraph headings, which are the selected members of the Down list. TABS Inserts a tab character between columns, so that applications can use the output.
TABLE SUPPRESS
388
November 2011
TABS SINGLE
If you do not override the tab character in the DISPLAY command, two tab characters are inserted in front of the long name. TABS SINGLE suppresses one of these tab characters, so that the long name is preceded by a single tab character. Truncates column headers to the column width. Specifies the width of the underlining triggered by UDATA. Specifies the width of the numeric columns. Each column can be up to 50 characters wide. One or more integers separated by commas. Application Server displays an integer and an asterisk (*) before the width to indicate that the width will repeat that number of times. For example, 2*6 means two columns that are six characters wide. Groups of widths that repeat, for example, 9, 8, 9, 8, ..., can be enclosed in parentheses and preceded by a repetition count, as in 5(9, 8). You can also use DEFAULT instead of a numeric width. Note: A text variables value can contain up to 255 characters. If a text variables value contains more characters than the width specified here, Application Server truncates the variables values to a width of <n>.
You can use the following options: Up to seven characters to use for true zero values. Inserts a blank for true zero values. Inserts a 0 for true zero values. Removes any previously set true zero values.
Example 1
...This example suppresses rows with zero values, prints the column headers once, and indents the ... rows by two spaces. Column widths are set to 10, 10, 10, 10, 5, 8, and 8. SET SUPPRESS ZERO COLUMNS ONCE INDENT 2 WIDTHS 4*10, 5, 2*8 ENDSET ...This example sorts the last down dimension, and nested levels 1 and 2, based on column 1 values: SET STYLE LEVELTOTAL SORT 1 SORT NLEVEL 1 1 SORT NLEVEL 2 1 ENDSET ...This example displays the top ten products sold in each region in the latest sales period: SET ACROSS Time DOWN Variables, Region, Product SORT LAST ENDSET
November 2011
389
Example 2
...This example, taken from a report called BASIC, prefaces each row with a number identifying ... whether the member is an input(1), output(2), or result(3). The numbers are useful for interpreting ...drill-down levels. REPORT basic SET TABS PREFACE 132 ENDSET ROWS ALL DISPLAY basic ...The output of this command would be: TYPE Actual VARIABLES Sales Processor Chips Jan 00 Feb 00 Mar 00 Apr 00 2 2 2 3 1 1 1 1 1 1 1 1 1 1 1 1 West Central South Total Region New York Boston Chicago Washington Denver Cleveland St. Louis San Francisco Seattle Los Angeles Las Vegas Dallas
Example 3
...This example, from a report called EXAMPLE, displays a report with default column headings: SET COMMA ','
390
November 2011
DECIMAL 0,1 ORDER 0, 1, 'mchg' = (c1-c2)%c2, 'ychg'=(c3-c4)%c4 TABS NAME 20 ENDSET ROWS ALL DISPLAY EXAMPLE ...The output of this command would be: 286 Chip Jan 96 MCHG YCHG Cost of Sales Sales $3,288,567 $1.7 $4.2 $12.0 $3.1
$4,473,321
...From a report called EXAMPLE, display a report that suppresses the default column headings: SET COMMA ',' DECIMAL 0,1 ORDER 0, 1, 'mchg' = (c1-c2)%c2, 'ychg'=(c3-c4)%c4 TABS NAME 20 SUPPRESS COLHEADING ENDSET ROWS ALL DISPLAY EXAMPLE ...The output of this command would be: Cost of Sales Sales $3,288,567 $1.7 $4.2 $12.0 $3.1
$4,473,321
Syntax
SET ENVIRONMENT <environment-variable-name> <value> Parameter <value> Description The name of the environment variable to set. The value to set it to, including: DBHOME The DBHOME variables define a directory in which Application Server creates new files by default. DBPATH The DBPATH variables defines a colon-separated list of directories that Application Server searches for existing files. Application Server searches the current directory and the DBHOME directory (if specified) first.
<environment-variable-name>
November 2011
391
Syntax
SET FISCAL { CALENDAR [<month>] } { USER [<pattern>] [ANCHOR | CLOSE <dayofweek>] [<monthbegin>] [QUARTER <quarterpattern> ] [<startmonth>] [<startday>] } { [<startmonth>] [<startday>] USER STARTING <datebegin> ENDING <dateend>, ..., <dateend> }
USER
Parameter <pattern> Description Specifies how weeks roll into months or periods. Valid choices are 445, 454, 544, and 13. If no <pattern> is given, the option specified for <monthbegin> will determine how weeks roll into months. 445 - Indicates that month one has four weeks, month two has four weeks, and month three has five weeks. 454 - Indicates that month one has four weeks, month two has five weeks, and month three has four weeks. 544 - Indicates that month one has five weeks, month two has four weeks, and month three has four weeks. These patterns repeat for each quarter. 13 - Indicates that there are thirteen four-week or lunar periods per year. The way in which periods roll into quarters is set with the QUARTER <qtrpattern> keyword explained below.
392
November 2011
Note: A 445, 454, or 544 month pattern always begins in January. You need to allow for this if you specify a fiscal year start month that is not on a calendar year quarter break. For example, if your fiscal year begins in March and you want March to begin a 544 pattern, you have to set a 445 pattern instead as follows: SET FISCAL USER 445 FIRST March
ANCHOR
Specifies that the first day of the fiscal year will be the first day of the starting month and the last day of the fiscal year will be the last day of the ending month. If ANCHOR is omitted, <monthbegin> will determine the first and last days of the fiscal year. Specifies a day of the week before which the year must close. The actual close day is determined by the <startday> value. CLOSE can only be used with the <pattern> (445,13, and so on) options; it is not valid with the <monthbegin> (FIRST, LAST, MOST) option. This option is useful when your company calendar must end a number of days prior to the day your parent company ends its fiscal year. For example, SET FISCAL USER 445 CLOSE Thursday defines a fiscal year that starts in January and ends on the Saturday that precedes the last Thursday in December.
CLOSE <dayofweek>
<monthbegin>
When used in conjunction with <monthpattern>, determines the start day of the first period of the year. When used in conjunction with ANCHOR, determines the start day of months 2 through 12 or 13. Valid choices are: The first day of the first week must fall in the calendar month. FIRST is the default if <monthbegin> is not specified. The last day of the first week must fall in the calendar month. The year often begins in the previous calendar year. The first week of the month that has most of its days fall in the calendar month determines the first day of the month. If four or more days in a week fall in the calendar month, then the week is included in that month; if less than four days fall in the calendar month, then the week is part of the previous month. Note: If you specify a <monthpattern> for a USER calendar then you can use either ANCHOR or <monthbegin> but not both. If you do not specify a <monthpattern> then ANCHOR and <monthbegin> can be used together. To state this is a different way, ANCHOR is used to set the begin and end of the fiscal year and <monthpattern> or <monthbegin> are used to set the start and end of all other months.
QUARTER <qtrpattern>
This option is valid only with the <monthpattern> option of 13. Specifies how lunar periods roll into quarters. Valid choices are 3343, 3334, 3433, and 4333. If no <qtrpattern> is specified, the default pattern is 3343. Specifies the calendar month that starts the fiscal year. The default is January. Specifies the start day for weeks. The default is Sunday.
<startmonth> <startday>
November 2011
393
<datebegin>
Remarks
To maintain compatibility with earlier versions, three additional calendar types, described below, exist in Application Server. Each one has a corresponding setting in the calendars defined above.
CONSUMER RETAIL THIRTEEN A synonym; the same as specifying USER 445 LAST. A synonym; the same as specifying USER LAST. A synonym; the same as specifying USER 13 LAST.
394
November 2011
...This example creates a 13 period fiscal year where the periods start on Wednesday and the last period of the year must end before the last Saturday of the year (the close date): SET FISCAL USER 13 CLOSE SATURDAY WEDNESDAY ...The procedure below defines a custom calendar that begins on the first Monday in February. Weeks roll into months and months roll into quarters following a non-standard pattern of 454-454-454-445 BEGIN SET FISCAL February USER STARTING 02/05/96 ENDING ... fiscal year 96 03/03/96, 04/07/96, 05/05/96, 06/02/96, 07/07/96, 08/04/96, 09/01/96, 10/06/96, 11/03/96, 12/01/96, 12/29/96, 02/02/97, ... fiscal year 97 03/02/97, 04/06/97, 05/04/97, 06/01/97, 07/06/97, 08/03/97, 08/31/97, 10/05/97, 11/02/97, 11/30/97, 12/28/97, 02/01/98, ... fiscal year 98 03/01/98, 04/05/98, 05/03/98, 05/31/98, 07/05/98, 08/02/98, 08/30/98, 10/04/98, 11/01/98, 11/29/98, 12/27/98, 01/31/99 END
Syntax
SET IGNOREMISSING MEMBERS [ON | OFF] Parameter ON OFF Description Default value. Instructs Server to issue a warning message listing the missing dimensional members, and to complete the SELECT or ORDER command. Instructs Server to report missing dimensional members as an error and fail the SELECT or ORDER command.
Syntax
SET INDENTATION <n> Parameter <n> Description Specifies the number of blanks to indent, where <n> is an integer between 1 and 10. When you issue an ORDER <last_down_dimension> HIERARCHY command and a SET INDENTATION command and then you issue a LIST command or display a report, each level of the dimension is indented by the specified number of characters.
November 2011
395
Syntax
SET LABEL <name> [DEFAULT | SYNONYM <synonym>] Parameter <name> DEFAULT SYNONYM <synonym> Description The name of the dimension or variable to which the labels are to be applied. Switches back to the standard Application Server long and short names for the specified dimension or variable. The name of an Application Server synonym set containing alternative long and short names for the specified dimension or variable. Note: The synonym set cannot contain labels that begin with an asterisk and then a blank space. Labels can begin with other characters though. For example, you cannot use a label * units or * East but you can specify the label ~ units or ~ East.
Note: The syntax for the Hybrid OLAP SET LABEL (Schema) command is different.
Syntax
SET {LATEST | EARLIEST} {[<periodicity>] <date> | FROM <variable> [IN <dimension> <member> [,..., IN <dimension> <member>] ] } DEFAULT Parameter LATEST EARLIEST <periodicity> <date> FROM <variable> Description Sets the specified date as the latest date for available data. Sets the specified date as the earliest date for available data. Sets the data at one of the following periodicities: yearly, semiannually, quarterly, monthly, lunar, bimonthly, weekly, biweekly, daily, or hourly. A date to use as the earliest or latest date for available data. Sets the earliest or latest date based on the variable's earliest or latest date.
IN <dimension> <member> Sets the date based on the variable's earliest or latest date within the specified dimension or member. Dimension member names that use special characters should be in single quotation marks (' '). DEFAULT Removes the latest/earliest setting from the database.
Example
...This example sets the earliest available monthly data at January ...1999 and the latest available monthly data at June 1999: SET EARLIEST month 99/01 SET LATEST month 99/06 ...This example sets the latest date based on the latest date found when scanning Sales data for the ... East region and actual data from the Type dimension: SET LATEST FROM Sales IN Region East IN Type Actual
396
November 2011
Syntax
SET MEMORY <integer> Parameter <integer> Description Number between 0 and 999,999,999.
Note: You can control the default amount of available memory with the DEFAULTMEMORY environment variable. This specifies (in kilobytes only) the amount of memory you want to use per session by default. For best performance, both MEMORY and DEFAULTMEMORY should be set to somewhat less than the real memory available on your computer.
November 2011
397
Syntax
SET MESSAGE NUMBER|NONUMBER Parameter NUMBER NONUMBER Description Specifies that numbers should be displayed. Switches off the display of the message numbers.
Syntax
SET PERIOD {<daterange> [HOUR <hourrange> ] } {<period> } {DEFAULT} Parameter <daterange> Description Range of dates in the form <yy[/mm[/dd]]> - <yy[/mm[/dd]]>. For example, 08/12/10 - 08/12/31 is the period from December 10, 2008 through December 31, 2008, and 08-00 is all of 2008 and 2009. Defines a range of hours in the form <hh:qq> - <hh:qq>, where: <hh> Hour in a 24-hour clock: 0 through 23.
HOUR <hourrange>
398
November 2011
<qq> Quarter-hour: 00, 15, 30 or 45. <period> One of the following periods: yty The latest period back to the equivalent period one year ago. yrago The latest period one year ago. current The period set with a SET LATEST command. previous The previous period. latest The period set with a SET LATEST command. DEFAULT Removes any period set with a previous SET PERIOD. Application Server uses either the period set for your variables or the period set in a statement with the PERIOD keyword. The PERIOD keyword overrides all other settings.
Syntax
SET ONERROR { CONTINUE | CLEAR } Parameter CONTINUE CLEAR Description Continues running the procedure until it is complete, even if errors occur. Stops the procedure if any errors occur when running the procedure.
November 2011
399
Syntax
SET { <periodicity> | CONSTANT } Parameter <periodicity> Description Applies one of the following periodicities: yearly, ytd, ryearly, semiannually, quarterly, qtd, rquarterly, monthly, mtd, mytd, avgytd, rmonthly, lunar, bimonthly, weekly, wtd, biweekly, daily, hourly. Allows you to load data into a database that contains both constant and periodic measures. Note: Use the SET CONSTANT command prior to loading data into a variable defined as constant if the model contains both periodic and constant measures. It is only necessary if you first load into periodic measures and a periodicity has been explicitly or implicitly set for the first load.
CONSTANT
Syntax
SET PRINTER [WIDTH <width>] [LENGTH <length>] [UPPER] Parameter WIDTH <width> LENGTH <length> UPPER Description Defines the maximum number of characters that can print on a line, where <width> is the maximum number of characters. Defines the number of lines that can print on a page, where <length> is the maximum number of lines. Sets the printer to print only uppercase, alphabetic characters. Application Server translates all lowercase characters into uppercase.
400
November 2011
Syntax
SET PROGRESS {ON|OFF} Parameter ON OFF Description Turns on the progress meter displays. Suppresses the progress meter displays.
Syntax
SET REASSURANCE {ON | OFF} Parameter ON OFF Description Turns on reassurance messages (default). Turns off reassurance messages. When running an application, you should turn off the reassurance messages to avoid interference with the format of the output.
Example
...This example shows the effect of entering SET REASSURANCE OFF. Application Server no longer ... provides a Variables Selected message. SELECT BY Merchandise ...The output of this command would be: 9 Variables Selected SET REASSURANCE OFF SELECT BY Merchandise, Version ...(no message appears)
Syntax
SET REREAD ON|OFF Parameter ON|OFF Description Turns the reread function on and off.
November 2011
401
Syntax
SET QUERY [VARIABLE] [<LinkId>] [<Cube>] <Query Variable> <Query Value> Parameter LINKID <LinkId> Description Enter a specific LinkId if the Application Server database contains imported information from more than one Query and you want Query Variable information for just one Query Cube. If the Application Server database contains only imported information from a single Query, you do not need to supply a specific LinkId. CUBE <cube> Enter a specific cube if the Application Server database contains imported information from more than one Query and you want Query Variable information for just one Query Cube. If the Application Server database contains only imported information from a single Query, you do not need to supply a specific cube. <Query Variable> If a Query Variable is mandatory and has no default value, an application must supply a value for it before it asks the Connector for a view of data. Since Query
Variable names must be in the ODBO format with enclosing [ ] and Query Variable names often begin with a numeric character, the Query Variable name should be enclosed in Quotes.
Syntax
SET SELECT {NAME | LABEL} Parameter NAME LABEL Description Specifies that the SELECT command should look for short names only. Specifies that the SELECT command should look for both short and long names. This is the default value.
Syntax
SET SHARE INTERVAL <n> Parameter <n> Description Number of seconds between contention checks.
402
November 2011
Syntax
SET {SHORT | LONG} Parameter SHORT LONG Description Indicates that Application Server displays variable and dimension member names in lists and reports. Indicates that Application Server displays variable and dimension member labels in lists and reports (default). If you do not define labels for variables or members, Application Server does not display their names.
Note: If you use the Access subsystem to import or export data, you must use variable and member names. If you have previously entered SET LONG, you must enter SET SHORT.
Example
...Application Server displays variable names, rather than labels, in lists and reports: SET SHORT DISPLAY
Syntax
SET SPARSE {ON | OFF} Parameter ON OFF Description Confirms the CREATE variable SPARSE command and creates the variable as spasre. Ignores the SPARSE keyword on any proceeding CREATE variable SPARSE commands.
Example
...This example would suppress the creation of sparse variables while loading DUMPFILE:
November 2011
403
Syntax
SET VARIABLES <variables> { FROM <linkid> PREFIX <prefixname> } { NOFROM } { LABELS '<labels>' } { DESCRIPTION <description> } { UNITS | NOUNITS } { RATE | NORATE } { EXPENSE | NOEXPENSE } { [INCLUSIVE | EXCLUSIVE [ZEROS] ] [FIRST | LAST | AVERAGE | SUM | WEIGHTED <weighted_variable> | MIN | MAX] } { CONSOLIDATE | NOCONSOLIDATE } { CONVERT {BEFORE | AFTER } } { [ AFTER <c> | OFF ] [ AUTO [OFF] ] [ BEFORE <c> | OFF ] [ COMMA <c> | , | . | OFF | LOCALE] [ CURRENCY <c> | $ | OFF ] [ DECIMALS <n> | LOCALE] [ FIX CURRENCY | NEGATIVE | DECIMAL ] [ FLOAT CURRENCY | NEGATIVE | DECIMAL] [ MISSING <string> | BLANK | DEFAULT ] [ NEGATIVE <prefix> [ <suffix> ]] | DEFAULT ] [ PAD [OFF] ] [ POINT <c> | . | , | LOCALE] [ REVERSE [OFF] ] [ SCALE <n> | OFF ] [ WIDTH <n> ] [ ZERO <string> | - BLANK | DEFAULT | OFF] } Parameter <variables> Description Names of one or more variables separated by commas. You can use an asterisk (*) instead of a name to indicate all variables. Variable names that use special characters should be in single quotation marks (' '). (Applies to Hybrid OLAP models.) Specifies a link identifier (<linkid>). Makes the selected variable a drillthru variable. Use the SET VAR variable_name NOFROM syntax to return the variable to a normal Application Server variable. (Applies to Hybrid OLAP models.) Specifies a prefix string. (Applies to Hybrid OLAP models.) Returns the selected drillthru variable to a normal Application Server variable Defines the labels you want associated with the variables, where <labels> is one or more labels of up to 255 characters, enclosed in single quotation marks (' ') and separated by commas. Labels correspond to variables based on their order in the list; that is, the first label is applied to the first variable, the second label is applied to the second variable, and so on. Notes:
FROM <linkid>
404
November 2011
If you create labels for variables, the first 24 characters of each label must be unique. Empty single quotation marks (' ') remove any previously set label. You cannot create a label that begins with an asterisk and then a blank space. You can use other characters though. For example, you cannot specify * units but you can specify the label # units. DESCRIPTION <description> Defines the descriptions to associate with the variables, where <description> is the text that describes the variable. Empty single quotation marks (' ') remove any previously set description. Application Server displays the descriptions in the output from a SHOW VARIABLE command. UNITS | NOUNITS Specify UNITS to indicate that Application Server should round a variable's values to the nearest integer when it uses the variable at a periodicity other than its original one. You can turn off the UNITS option with the NOUNITS keyword. NOUNITS is the default. Specify RATE to define the variables as rate variables. Application Server averages the variables over time, but does not consolidate them at the output level of dimensions. A rate variable is often used with percent or price variables. You can turn off the RATE option with the NORATE keyword. NORATE is the default setting.
RATE | NORATE
EXPENSE | NOEXPENSE Specify EXPENSE to define the variables as expenses. You can develop a conditional logic set to test on this attribute and then treat the variable differently for variance calculation. You can turn off the EXPENSE option with the NOEXPENSE keyword. NOEXPENSE is the default setting. INCLUSIVE | EXCLUSIVE [ZEROS] INCLUSIVE means that missing values are included in the conversion. EXCLUSIVE means that missing values are excluded from the conversion. ZEROS treats zeros as missing values. Use this to treat data from BW properly by excluding zero values from the conversion. AVERAGE Uses the average value of the variable in the time series when Application Server consolidates the variable over time (the default for rate variables). An INCLUSIVE AVERAGE variable will count a missing time period as zero. An EXCLUSIVE AVERAGE variable will ignore missing values when calculating the average value for the variable. Uses the sum of the values in the time series when Application Server consolidates the variable over time (the default for all variables, except rate and text). Uses the weighted average of the variable. For example, price might be weighted by units sold. The quarterly price for monthly data is the sum of price multiplied by the number of units sold during the months, divided by the sum of the units sold for those same three months. Uses the minimum value of the variable in the time series when Application Server consolidates the variable over time. For example if you view a monthly measure quarterly and the measure is MIN, you see the smallest monthly value as the quarterly value. Uses the maximum value of the variable in the time series when Application Server consolidates the variable over time.
SUM
WEIGHTED <weighted_variable>
MIN
MAX
CONSOLIDATE | NOCONSOLIDATE Specifies CONSOLIDATE to indicate that Application Server should consolidate the variable. Specify NOCONSOLIDATE to indicate that Application Server should not consolidate variables when you enter a CONSOLIDATE or CALCULATE command. This function is useful when you have already consolidated the data, or when you are calculating variables based on already consolidated data. CONSOLIDATE is the default setting. CONVERT BEFORE | AFTER Specifies whether the calculation of output members in the time set occurs BEFORE or AFTER the calculation of virtual measures. AFTER is the default behavior for a virtual measure.
November 2011
405
406
November 2011
Sets the decimal point to the character defined in the locale settings in the Windows Control Panel. Reverses the position of currency and negative symbols. The default is the currency symbol followed by the negative symbol, for example, $-2.00. Returns the currency and negative symbols to the previous positions. Scaling factor; divides the number to be displayed by 10 to the power <n>. For example, scale 2 divides the number by ten to the second power, rounding down halves. That means that when you use scale 2, 2.505 is rounded to 2 decimal places to 2.50, not 2.51. Removes any previously set scaling factor. Number specifying the field width. The maximum width that you can set for a text variable is 50. Note: A text variables value can contain up to 255 characters. If a text variables value contains more characters than the width specified in WIDTH <n>, Application Server truncates the variables values to a width of <n>.
Up to seven characters to use for true zero values. Inserts a blank for true zero values. Inserts a dash (-) for true zero values. Removes any previously set true zero values.
Remarks
The SET DEFAULT command specifies the default global formatting settings for all variables. However, if you use SET VARIABLES to change a formatting option for a variable, that variable will no longer use the default global formatting settings specified by SET DEFAULT. To compare the default global formatting settings with the current formatting settings for a variable, use the SHOW DEFAULT and EXHIBIT VARIABLE varname commands. If you use SET VARIABLES to change the formatting for a variable, you must use the REMOVEFORMATvariable command if you want to reset the variable so that it uses the global formatting settings.
November 2011
407
The following two examples show the different outputs generated with the keywords CONVERT BEFORE and CONVERT AFTER, using a time set that calculates quarterly, and a virtual measure (vv1) that equals v1/v2.
SET VARIABLE <variable> CONVERT BEFORE gives this result:
VV1 10.00 10.00 10.00 10.00 VV1 10.00 10.00 10.00 30.00
180.00 18.00
6.197 SHOW
Use
SHOW displays information about the current Application Server session. Specify SHOW before each keyword in the syntax above. For example, you can use SHOW ACROSS and SHOW DOWN but you cannot use SHOW ACROSS DOWN.
Syntax
SHOW {ACROSS [ DETAIL | SPAN ] [TABS] [NOHEADER] [NONUMBER] [FORMAT <format> ] } {DOWN [ DETAIL | SPAN ] [TABS] [NOHEADER] [NONUMBER] [FORMAT <format> ] } {ATTRIBUTE} {CALENDAR <year>} {CONTROL [<pattern> ]} {CORRECTIONS [FULL]} {CUSTOM [ALL | FULL | TABS] [ [<database>.][<owner>.]<dimension>.<setname>] {DATABASE [<database> ]} {DBSTATS} {DEFAULT} {DISORDERED <dimension>} {DUPLICATES <dimension> [REPLACE]} {ELAPSED} {FORMAT} {LABELS [<variablelist> ]} {LATEST} {EARLIEST} {ORPHANS <dimension>} {STEPCHILDREN <dimension>} {SELECTED [<dimension> ]} {SETTINGS} {<settype>}
408
November 2011
{<setname>} {SPAN [DETAIL [NOHEADER] [NONUMBERS] [TABS] [FORMAT <format>]] } {SPARSITY [<variablelist> | BY <dimensionlist> ] [EXCLUDE]} {VARIABLES <variablelist>} [EXCLUDE]} {UPDATED [NOHEADER] [TABS] [UTC [<variable>]] } {VARIABLES [ BY <dimlist>]} {VERSIONS} {[EXACTLY] WHERE [<settype>] <name> [<member>][,.. <name> [<member>]]}
Common Parameter TABS NOHEADER NONUMBER FORMAT <format> Description Delimits output with a tab. If you do not use TABS, the output is displayed with space characters between columns. Displays output with no heading line. Displays output with no line numbers. Specifies the format to display the dates. <Format> can be: myy, ymd, yymd, dmyy, dmy, mdyy, mdy, ydm, yydm, yym, my, or ym If the year is four digits (2010), the formats with yy are used. If the year is two digits (10), the formats with y are used. If the month is alphabetic (May 2010), the letter m is replaced with the word month, for example monthyy. The separator characters dash (-), slash(/), or period (.) can be used in the date; however, they must appear in the actual date format. For example, the format for 12-3-2010 would be m-d-y. You can use the string month in place of m, in which case the month will be name of the month rather than the number. For example, the format for Dec/3/10 would be Month/d/y. UTC <variable> Displays any date in the UTC format of YYYYMMDDHHMMSS. If you specify a variable, it displays the date in UTC format for a specific variable. If you do not specify a variable, it displays the dates in UTC format for all variables. YYYY is the year, MM is the month, DD is the day, HH is the hour, MM is minutes and SS is seconds. Parameter ACROSS DETAIL Description Displays current across settings. Displays members that make up each column of the across setting. Use this with ORDER in reports. When you use SHOW ACROSS DETAIL, you should minimize the number of dimension members in the down list for performance reasons. To do this, select one member from each down dimension; this does not change your across list selections. Displays current across settings and also a time span for the TIME or a time set. For a time set, the time span will show the span of any INPUTS, and for OUTPUTS will show the span corresponding to the all encompassing span that results from the union of all the spans of the INPUT descendants of each OUTPUT. The spans will take the SET LATEST into account. For DAILY data, if any span is a single day, only the start of the span will be shown (i.e. no range just a single date). The analysis of the time set to determine the input descendants of OUTPUTs in time sets is done during COMPILE TIME. DOWN DETAIL SPAN Displays the current down settings. Displays members that make up each column of the down setting. Displays current across settings and also a time span for the TIME or a time set. For a time set, the time span will show the span of any INPUTS, and for OUTPUTS will show the span corresponding to the all encompassing span that results from the union of all the spans of the INPUT descendants of each OUTPUT. The spans will take the SET LATEST into account. For DAILY data, if any span is a single day, only the start of the span will be shown (i.e. no range just a single date).
SPAN
November 2011
409
Lists all members of a dimension that require automatic multiple counting corrections together with a list of each ancestor that requires adjustment and a correction factor.
To compare with SAP BW data, if you look at the Hierarchy Structure Table for a hierarchy, you should see the same correction factors that you see in Application Server in the output from SHOW CORRECTIONS. FULL shows the correction factors and for each member that has correction factors, it displays hierarchically the ancestors of that member to illustrate where the multiple counting occurs. Note: When you compile a dimension or attribute, the system searches for multiple counting issues that arise if a dimensions members have multiple parents. During aggregation, the system corrects multiple counting issues by creating adjustments to eliminate them. The adjustments are used during a CONSOLIDATE.
CUSTOM Shows details about currently defined User-Defined Hierarchies. The default information includes the database name, owner name, dimension name, setname, whether the User-Defined Hierarchy was saved with the PUBLIC or PRIVATE keyword, and the saved ID. Displays details about all saved User-Defined Hierarchies. Displays extra columns for the creator of the User-Defined Hierarchy, the last user to update the saved User-Defined Hierarchy, the time of creation, and the last update time. Name of the database containing the User-Defined Hierarchy whose details you want to display. If you omit the database name, the current USE database is used. Note: You can use wildcards in any of the values for database, owner, dimension, and setname. For example, REMOVE CUSTOM J*.A*.Product.* If you omit any of the values, the wildcard * is implied. <owner> Name of the Application Server user who is responsible for the User-Defined Hierarchy. This name was specified during the SAVE CUSTOM command when the User-Defined Hierarchy was created. If you omit the owner name, the current Application Server user name is used. Name of the dimension whose User-Defined Hierarchy you want to review. Name of the procedure set where the User-Defined Hierarchy was saved during the SAVE CUSTOM command. Provides summary information about all attached databases. Specifies the name of a specific attached database you want to get information about.
ALL FULL
<database>
410
November 2011
DBSTATS DEFAULT
Displays statistical information about the current database and buffer setting recommendations. Displays default formatting values for column width, decimal places, currency symbol, and automatic scaling.
DISORDERED <dimension> Displays output members in <dimension> that are not in the correct order for the Rollup subsystem to use. For example, you might have declared level 3 members before level 2 members. DUPLICATES <dimension> Displays members and labels that have the same value within the <dimension>. REPLACE Specifies that any duplicate member is replaced by <longname> (<shortname>). Only the duplicates are replaced. If a member is not a duplicate, it remains as is. After you issue this command with the REPLACE keyword, you see a message notifying you to compile the dimension. You must issue a COMPILE DIMENSION <dimension> command for any dimension whose duplicate members you replaced. When this command is first used, Application Server displays the number of seconds that have elapsed since login; with each additional use, Application Server displays the number of seconds that have elapsed since the last time you entered the SHOW ELAPSED command. Displays current variable formats, as specified with SET DEFAULT or SET <variables>. Displays labels associated with all variables. Rather than display labels for all variables, you can specify a list of variables you want to display labels for. Separate each variable with a comma. You can use an asterisk (*) in a variable name to indicate that any character can occupy that position or any of the remaining positions in the name. Displays the data point you have set with SET LATEST. Displays the data point you have set with SET EARLIEST.
ELAPSED
LATEST EARLIEST
ORPHANS <dimension> Shows the input and output members that do not have a parent (do not belong to a hierarchy and are not consolidated) within the specified dimension. STEPCHILDREN <dimension> Shows the input members that have more than one parent (belong to more than one hierarchy) within the specified dimension. SELECTED [<dimension>]} Displays currently selected variables, or the selected members of a dimension. Omit the dimension parameter to display selected variables, or specify the name of a dimension to display its selected members. SETTINGS <settype> Displays system information, such as SHARE INTERVAL, process ID, and client/server information. Lists the names of all the sets of that specified type in the database, where <settype> can be either TIME, LOGIC, REPORT, PROCEDURE, DOCUMENT, or DIMENSION. Displays information about the specified set. The parameter <setname> cannot be a procedure name or a document name, but it can be one of the following: <timeset> Lists the inputs of the specified time set. <logic> Lists the dimensions and the variables referenced by this logic set. <report> Shows information about the requested rows and referenced external functions. <dimension> Lists the input members, output member, and result member. Application Server displays excluded members with parentheses around them. SPAN Shows the start and end date that will be used in the current view. When a time set is involved it will show the dates based on the intersection of the current SET PERIOD and the periods implied by the time set, taking all the LATEST and EARLIEST settings into account. Note: Where the time set implies a period range outside the SET PERIOD range, SHOW SPAN produces no output. That is, SHOW SPAN only works on the current periodicity and period.
<setname>
November 2011
411
SPARSITY
VARIABLES <variablelist> Displays information about one or specific variables in the Use database: the periodicity, the date range, and the dimensions with which they are associated. For the <variablelist> parameter, you can specify the name of one or more variable names, separated by commas. Note: If SHOW VARIABLES finds a distributed variable, an extra line is displayed before the variable details, showing the location of the variable. EXCLUDE UPDATE VARIABLES Displays information about the specified variables, but omits information about hidden variables. Displays database variables and the date and time Application Server last updated them. Displays information about the variables in the Use database: the periodicity, the date range, and the dimensions with which they are associated. SHOW VARIABLES also displays information about temporary variables created by the CREATE <variable> TEMPORARY command. Application Server stores temporary variables in the Work database. Note: If SHOW VARIABLES finds a distributed variable, an extra line is displayed before the variable details, showing the location of the variable.
412
November 2011
BY <dimlist>
Limits the number of variables shown by specifying only those with specific dimensions. To do this, enter SHOW VARIABLES BY <dimlist>, replacing <dimlist> with the names of dimensions separated by commas. Displays versions in the database. Displays the locations of the variable, procedure, logic set, dimension, or other names in the database. For example, after removing a variable from Application Server, you can use this command to display all references to that variable. Remove these references to avoid a future reference to a nonexistent variable.
VERSIONS
Syntax
SHOW
Syntax
SHOW { DATABASES [<database> [,..., <database>]] } { LOGINS [<user> [,..., <user>]] } { GROUPS [<user_defined_hierarchy>] } { USERS [<user> [,..., <user>]]} Parameter DATABASES <database> LOGINS <user> GROUPS Description Displays information about databases and their partitions. Shows information about a specific database, including partitioned information, where <database> is one or more database names separated by commas. Displays information about users currently logged in to Application Server, or those temporarily paused with EXIT. Names of one or more users separated by commas. If you do not specify a name, Application Server displays information about all users. Lists all User-Defined Hierarchies. Note: You define User-Defined Hierarchies to restrict user access to specific dimensions. <user_defined_hierarchy> Lists all users that belong to the specified User-Defined Hierarchies. USERS <user> Displays information about all users in the database. Displays information about a specific user, where <user> is one or more user names, separated by commas.
Example: SHOW
...This example shows the default variable settings: SHOW DEFAULT ...The output of this command would be: Width 12 Decimals 0 Comma , Auto
November 2011
413
SHOW VARIABLES PRODUCT: Variable Type ADVERTISING EXPENSES PRICE NU COMPANY: Variable Type REVENUE SALES NU Items NU 12 12 MO Date Range MO Jan 1997 - Dec 2000 Items NU NU 6 12 12 BM Date Range MO MO Jan 1999 - Dec 1999 Jan 1999 - Dec 1999
SHOW DIMENSION Product PRODUCT Inputs ASPIRIN PERSONAL Outputs SOAPS DEODORANTS HYGIENE Result PRODUCT LINE SHOW LOGIC Rest REST Database Variables REVENUE UNIT COST SALES VOL CONTRIB UNIT PRICE NEWCON COST GENERIC DRUGS ANTACIDS LAUNDRY ROLL ON DISHWASHING CREAM SPRAY
Referenced External Functions MARGIN_CALC SHOW SELECTED VARIABLES Inputs UNIT PRICE SALES REVENUE NET PROFIT
414
November 2011
Report BUDREP, ANNREP, REVREP SHOW EXACTLY WHERE USA USA Appears in Logic REVLOG 20: case USA 50: USA ratio = 3.50 SHOW WHERE S s S# Appears In Logic NEWLOG SORTS Appears In Logic SORTLOG . . other names beginning with s . ...This example shows the output of the DOWN DETAIL option: SHOW DOWN DETAIL ...The output of this command would be: Row DOWN Dimension Members 1 Orient, COSTS 2 Orient, SALES 3 Orient, PROFIT 4 Orient, WORKTEXT 5 Middle, COSTS 6 Middle, SALES 7 Middle, PROFIT 8 Middle, WORKTEXT 9 Occident, COSTS 10 Occident, SALES 11 Occident, PROFIT 12 Occident, WORKTEXT 13 A_35_character_name_1234567890abcde, COSTS 14 A_35_character_name_1234567890abcde, SALES 15 A_35_character_name_1234567890abcde, PROFIT 16 A_35_character_name_1234567890abcde, WORKTEXT ...This example shows the standard, read-only control variables: SHOW CONTROL ...The output of this command would be:
November 2011
415
USEDATABASE WORKDATABASE
...This example shows how to tell if a user pressed an OK or Cancel button in the Dimensional ... Selector. The Application Server command SHOW CONTROL will display two variables that the ... Dimensional Selector creates (if the user presses OK), called SELECT_ITEMS and ... SELECT_NUMBERS. The user can check for those items before invoking the Dimensional Selector: SHOW CONTROL ...clear them if they exist:
CLEAR SELECT_ITEMS CLEAR SELECT_NUMBERS ...and then check them again after the Dimensional Selector has finished. If the user cancelled, the ... control variables won't exist. If the user pressed the OK button, the control variables will exist. ...This example displays the calendar for the year 2000: SHOW CALENDAR 2000
Example
...This example lists all User-Defined Hierarchies in MASTERDB: SHOW GROUPS ...The output of this command would be: FINANCE PRODMGR SALESMGR ...This example lists all users in the Finance User-Defined Hierarchy: SHOW GROUP Finance ...The output of this command would be: ADMIN DAVE BETTE ...This example displays information for user Fin1: SHOW USERS Fin1 ...The output of this command would be: User: FIN1Use Database: BUDGET Temp Database: FIN1TEMPBlocks: 300 Blksize 2048Buffers: 300 Library Database: TBDBSecurity Level: 99 Login State: OnLast Login: Tue Sep 12 11:21:48 2000 ...This example displays information for all users who are currently logged in or paused: SHOW LOGINS ...The output of this command would be:
416
November 2011
ROBERTO: Paused
...This example displays information about the database, JUICE: SHOW DATABASE JUICE ...The output of this command would be: Database: JUICE (C:\PROGRA~1\PILOTD~1\DATA\JUICE) Maxaccess: UPDATE Disposition: ENABLED Default Usage: Exclusive Current State: AVAILABLE Protection Key: None Last user: ADMIN Last access: Fri Sep 15 14:30:07 2000
Blksize: 8192 Observations 1000 Maximum Members: 1000 Max. Size of the Database is 32 Gigabytes. Maxblocks: 5000 Number Free: 4215 ...The following example lists the partitions for the ACCNT database: SHOW DATABASE Accnt ...The output of this command would be: MASTERDB (C:\PROGRA~1\PILOTD~1\DATA\MASTERDB) Maxblocks 100 Number Free 65Database: ACCNT Maxaccess: UPDATE Disposition: ENABLED Current State: AVAILABLE Protection Key: Non Last user: ADMIN Last access: Fri Sep 8 15:38:21 2000 Blksize: 8192 Observations 500 Maxblocks: 120000 Number Free: 119988Database ACCNT Partition Information.Number of Partitions: 5Blocksize: 8192Date Last Opened for Update: Fri Sep 8 15:36:21 2000 Date Last Closed After Update: Fri Sep 8 15:36:21 2000 Partition Size Name 1 20000 ACCNT01 2 20000 ACCNT02 3 20000 ACCNT03 4 40000 ACCNT04 5 20000 ACCNT05
Syntax
SKIP [<n>] Parameter <n> Description Number of blank lines you want printed. The default is 1.
Example: SKIP
...This example skips one line between the Sales and Revenue rows: ROWS Sales SKIP ROWS Revenue
6.201 SNAPSHOT
Use
SNAPSHOT produces a subset of a database in a dump file, suitable for loading into another database on the same machine or on a different machine at a remote location.
November 2011
417
Syntax
SNAPSHOT <file> [SIZES <sizes> ] [UPDATE] [IDENTICAL] [DUMMY] [STATUS <procedure>] [PRUNE] [PERIOD <range>] [EXPAND | REDUCE] [OVERWRITE] [DRILLTHRU] [NOATTRIBUTE] [NODENSE] [NOLARGEFILES] Parameter <file> Description Specifies the name of the file into which you want to place the dumped information. Note: By default, one dump file will be created. The file can exceed 2Gb. If you don't want the dump file to exceed 2Gb, you can partition multiple snapshot files by using wildcard characters to append the filename with numbers and using the NOLARGEFILES and/or SIZES keywords. Specifies the size of the file(s) that will contain the dumped information. To control the sizes of multiple partitions, specify a list of sizes separated by commas. If you specify fewer sizes than there are partitions, the last value is used as the size for the remaining partitions. Note: When specifying the SIZES parameter, the values cannot be greater than 2Gb if expressed as raw (unscaled numbers). To specify a SIZE greater than 2Gb you must use the K, M, or G scaling factors. You can specify the sizes in any of the following units: Bytes, for example 2000000000 Kilobytes, for example 2500000K Megabytes, for example 5000M Gigabytes, for example 3G NODENSE If you want to snap a database and make sure it is backward compatible so that it can be loaded in a version of Application Server prior to version 9.4, you should use the NODENSE keyword. This prevents the snap file containing explicit commands to create DENSE measures, as this keyword would be rejected in any versions prior to 9.4. Creates the dump files without exceeding 2Gb. If the dump file is larger than 2Gb, then partitions will be created. Use the NOLARGEFILES keyword with the SIZES keyword to restrict the file sizes to a specify size less than 2Gb. Do not use NOLARGEFILES with a SIZES value that is greater than 2Gb. You might want to restrict file sizes to 2Gb for any of these reasons: You might want to move the files to another machine or operating system that does not support large files. The dump size is too big to fit on a single disk (or the free space on a single disk) and must be split over multiple disks. UPDATE Use this keyword to create a file that contains only data values without dimension definitions. You can then load the file into a database that already contains the required dimensions and members. Use this keyword to create a file that is suitable for loading into a database with exactly the same structure as your database. The time series are saved to the dump file using a numeric key, which is more efficient for loading than the default text identification. Replaces all nonmissing values with 1. This function is useful if you do not want to dump your actual data. Creates a procedure, with the name specified by <procedure>, that you can use to recreate the current status settings. Includes only the selected dimension members in the file instead of all dimension members. The member names are keyed as literal strings, not as numeric keys. You cannot use PRUNE if you have rollups that do not sum. Specify PERIOD to perform a snapshot of only the data values in range specified by <range>. For example, PERIOD 05-06 dumps data for the years 2005 through 2006.
SIZES <sizes>
NOLARGEFILES
IDENTICAL
PERIOD <range>
418
November 2011
EXPAND
Expands the number of dimensions a variable can have. Note: A dump file created by SNAPSHOT EXPAND must be loaded into a database that already has its measures and dimensions created.
Eliminates any dimensions that have only one member selected. Overwrites a system file with the same name. In addition to the time series stored in Application Server, writes selected series from Hybrid OLAP schema tables into the snap file. When you subsequently load the data from the file, all data, regardless of its origin, is loaded into Application Server as non-drillthru data. (Optional) Ensures that no attributes or attribute data are included in the dump file.
NOATTRIBUTE
Remarks
If you select only output members from your dimension and then enter the SNAPSHOT PRUNE command, the LEVEL construct in the resulting dimension will still contain the input level. Note: If an entire structural dimension is selected, the SNAPSHOT will include all related attribute dimensions.
Example
This example selects Shampoo Sales and creates the dump file SHAMSALE partitioned into multiple files, each 250K, overwriting any existing files with the same name SELECT Product Shampoo SELECT Sales SNAPSHOT shamsale?? 250k OVEWRITE ...This example selects Shampoo Sales and creates the dump file SHAMSALE: SELECT Product Shampoo SELECT Sales SNAPSHOT shamsale ...Expanding on the previous example, this example puts Deodorant Sales in the file DEODSALE. The ... dimension Product is not included in DEODSALE because of UPDATE: SELECT Product Deodorant SNAPSHOT deodsale UPDATE ...Assume that the command SELECT Region BELOW France selects three French cities that roll up ... into France. If you enter the following command, the snap file, FNAME, snaps the Region ...dimension, which contains just the three cities and the output member France. Other regions are ... excluded. The SNAPSHOT command is performed on the data in update format and the member ... names are keyed as literal strings instead of as numeric keys: SNAPSHOT fname PRUNE ...This example performs the SNAPSHOT command for the data values in 1999 and 2000. ACROSS TIME, DOWN PRODUCT, REGION, VARIABLES SET PER 95-00 SEL SALES SNAPSHOT SNAPFILE PERIOD 99-00 ...Assume you have a prototype database with SALES dimensioned by PRODUCT, using data from
November 2011
419
420
November 2011
Substitute mysnap## with the name of a snapshot file partition, and substitute pathname with the directory into which you want the snapshot file to be placed. You should create a separate entry for each partition, for example: mysnap01=/db1/mysnap01 mysnap02=/db2/mysnap02 mysnap03=/db2/mysnap03 export mysnap01 export mysnap02 export mysnap03
6.202 SOLVE-ENDSOLVE
Use
SOLVE-ENDSOLVE returns the simultaneous solution of two or more equations; it recalculates until it finds a value that satisfies all equations.
Syntax
SOLVE . . simultaneous equations . ENDSOLVE
Example: SOLVE-ENDSOLVE
...In this example, Application Server determines the value of Commission in an iterative process by ... trying a value of profit and calculating the commission. Application Server then calculates a new ... value of Profit, recalculates the commission, and so on, until it finds a value for ...commission that satisfies both equations. SOLVE Commission = 0.03 * Profit Profit = Gross Profit - Commission ENDSOLVE
6.203 SQRT( )
Use
SQRT returns the square root of a number.
Syntax
CALCULATE <result> = SQRT(<input>) Parameter <result> <input> Description Name of the result variable. Name of the variable whose square root you want to calculate.
6.204 STATUS
Use
STATUS provides general information about the current Application Server session.
November 2011
421
Syntax
STATUS
Example: STATUS
This example shows the current Application Server status:
STATUS ...The output of this command would be: Across List: COUNTRY TIME Down List: PRODUCT VARIABLE 7 TV, RADIO, KITCHEN, OUTDOOR... 4 SALESVOL, REVENUE, MARGIN, INCREASE # Selected 3 US, UK, GERMANY
Period 98/1/1 - 98/12/31 Attached Databases: CORPDB, MKTG Current Logic CONTRIB Report QUARTERLY
Syntax
SUBTOTAL . . <statement> [EXCLUDE] . ENDSUBTOTAL <subtotal> ['<text>'] [SUPPRESS] Parameter <statement> EXCLUDE <subtotal> <text> SUPPRESS Description One or more report statements, for example ROWS. Omits a specified row from the subtotal. Name of the subtotal. You can use this name in expressions as if it were a TEMP variable. Text to use in place of the name in the report. Suppresses any column calculations that are in effect when Application Server displays the subtotal row.
Example
...This example illustrates the subtotaling of costs: SUBTOTAL ROW Variable_Cost ROW Fixed_Cost UDATA ENDSUBTOTAL Total_Cost ...It produces output similar to:
422
November 2011
1997 17 4 == 21
1998 15 4 == 19
Syntax
SUBTOTAL INCLUDE <row> [, ..., <row>] <name> ['<text>'] [SUPPRESS] Parameter <row> <name> <text> SUPPRESS Description Name of a row. This can include names in the last down dimension. Assigned row name. This name can appear in subsequent expressions. Row label to use in place of the name. Suppresses column calculations in the subtotal row.
Syntax
SUBTRACT DATABASE <name> Parameter <name> Description The database name.
November 2011
423
Syntax
<output> = { SUM [-]<member>, ... ,[-]<member>} { <member1> SUM <membern> } Parameter <output> Description Name of the output member or result member whose rule of consolidation is being defined. Sums the difference between members when the consolidation statement involves the variance between members. For example, the TYPE dimension has two input members, actual and budget, whose output member is the variance between the two input members. The consolidation statement might be: variance = SUM budget, -actual. <member> <member1> <membern> Application Server adds the names of noncontiguous members. First member in a contiguous list to be added. Last member in a contiguous list to be added.
Example
...This example defines the Variance output member for a TYPE dimension: INPUT Actual, Budget OUTPUT Variance variance = SUM actual, SYMBOL 45 "Symbol" 9budget ...Sum every member from zn1 through zn5 in the order in which they are defined in the dimension: zone = zn1 SUM zn5 ...This example sums specific, noncontiguous members: footwear = SUM sneakers, sandals, pumps, slippers
<PrintedCount> - (Optional) Can be used with NLEVELPRINTED() to show the count of printed items. For example: ROWS NLEVELPRINTED() {"Total Printed", <PrintedCount>}
424
November 2011
NLEVELOTHER()
For the current nested level, show totals and counts for non-printed items following cut-off criteria.
<OthersCount> - (Optional) Can be used with NLEVELOTHER() to show the count of non-printed items. For example: ROWS NLEVELOTHER() {"Total Other", <OthersCount>}
6.210 SUPERVISOR
Use
SUPERVISOR starts the Supervisor subsystem, where you can manage database and user information in MASTERDB.
Syntax
SUPERVISOR
Example: SUPERVISOR
...This example removes the SALES database from MASTERDB: SUPERVISOR REMOVE DATABASE sales ...You can also enterSUPERVISOR without going into and getting out of the Supervisor subsystem: SUPERVISOR REMOVE DATABASE sales
6.211 SWITCH
Use
Use the SWITCH command to log into Application Server again as a different user. Or, you can also switch to a different Work database in the same session while saving the previous Work database and staying logged in as the same user.
Syntax
SWITCH { <username> [PASSWORD <password>] | WORKDB [<name>] } Parameter <username> PASSWORD <password> WORKDB Description The user name you want to log in as. Indicates that the user name has a password. The password for that user. Saves the prior Work database in the session and creates a new Work database named DBxxxxx while remaining logged in as the same user . At a later point, you can switch back to the previous Work database and start up again with your previous status. Note: See the CSWITCH command if you want to switch to a different Work database and delete the previous Work database. Saves the prior Work databases in the session, and switches to the Work database name specified while remaining logged in as the same user. If the name already exists, it is used and the state is restored. If that Work database exists but is not a valid Work database, you get an error and rollback. If the Work database does not exist, a new one is created with the blocksize and blocks defined for the current user, that is, just as original Work database would have been created. Note: Some settings like the ACROSS and DOWN commands and SELECT statements are saved in a Work database. If you switch back to a previous Work database, you will get those settings, and as a result, your view may change.
<name>
November 2011
425
6.212 SYNC
Use
SYNC specifies how the operating system file cache should perform physical disk writes when updating a database with modified data blocks. Normally at the end of any Application Server command (if you haven't done an explicit CHECKPOINT FREEZE) or at a CHECKPOINT UPDATE, Application Server will write modified database blocks to the operating system. To ensure database integrity, Application Server then also asks the operating system to physically write those blocks to disk and waits for the operating system to confirm that it has done the physical write to disk. Only then does Application Server complete the transaction. The only benefit to this process is if there is a power outage or operating system crash while the physical write is in progress, upon a restart, Application Server can rollback to the last complete transaction and ignore the failed write. In this way, the integrity of the database is guaranteed. The drawback to this method is that physical i/o is sometimes slow and Application Server waits for it to complete, so this slows down many Application Server commands. This process prevents the operating system from performing lazy physical writes at a more optimal time that is, when it needs to or when there is idle time on the machine. If you set SYNC OFF, Application Server does not ask the operating system to force modified blocks to write to disk at the end of a command or CHECKPOINT, and does not wait for any physical i/o. This often improves performance. It is recommended to use SYNC with the OFF keyword as the first command in an Application Server session that includes commands that modify the database such as CONSOLIDATE, CALCULATE, REMOVE, and CREATE. For example, you may want to put SYNC OFF as the first command in an AUTOUSE procedure. The SYNC OFF command allows the o/s file cache to do lazy physical disk writes. If SYNC OFF is set, all subsequent Application Server requests to the o/s for writes allow the o/s to handle physical writes and Application Server proceeds without waiting for its completion. Application Server never waits for physical i/o during the whole session. You benefit from performing lazy physical disk writes because it greatly shortens the time it takes to execute the commands. The drawback to this is that if there is a power outage or a machine crash and the operating system has not completed all of its physical i/o, then upon a restart, an Application Server database may be corrupted. When using SYNC OFF, once all the commands that modify the database are complete, you can then use SYNC ON to allow Application Server to handle the writing of database blocks to disk. When SYNC is ON, at the end of every Application Server command, the sync will occur. SYNC ON is the default setting.
Syntax
SYNC { OFF | ON | NOW | SHOW} Parameter OFF ON Description Allows the OS to do lazy physical i/o. Allows Application Server to handle the writing of database blocks to disk. This is the default setting. When SYNC is ON, at the end of every Application Server command, the sync will occur. Forces a disk i/o now. Shows whether SYNC ON or SYNC OFF is the current setting.
NOW SHOW
426
November 2011
6.213 SYNONYM
Use
SYNONYM starts the Synonym editor, where you can define synonym sets by using Edit Syntax 1. You use these sets to convert external source file field values to internal Application Server dimension member names when loading data. You reference these sets with the DEFINE SYNONYM command. Alternatively, you can use Edit Syntax 2 to create a synonym set to create alternate long names for dimension members for use when you want any Application Server displays to report different member long names under different circumstances. For example, you might want a report to appear in English for one group of users, but then have it appear in Spanish for a different group. You reference these sets with the SET LABEL command.
Syntax
SYNONYM [<synonym>] [;<database> | ;EXTERNAL|LOCAL]
Edit Syntax 1
<internal> = <external> [,..., <external>] <internal> = BLANK
Edit Syntax 2
[NOCASECONVERT] <alternative_label> = <internal> Parameter <synonym> Description The name of a new or existing synonym set up to 96 bytes. If you do not specify a name, Application Server uses the default synonym set if it is defined, or the last <synonym> set you edited. Name of the database where the synonym set is located. If you do not specify a database, Application Server uses your Use database. Indicates the synonym set is a text file that is not in an Application Server database. If the synonym set is a DOS file, its name cannot have an extension. Indicates that the text file is a client <text> file.
Note: You can create or edit a synonym set with the EXTERNAL or LOCAL extension, but you must copy it into a model and compile it before it can be referenced in a DEFINE SYNONYM statement.
Editor Options
Edit Syntax 1
<internal> <external> BLANK An Application Server short name. A name in an external source. Indicates that the value in the external source is null or missing.
Edit Syntax 2
[NOCASECONVERT] Used when creating a synonym set for alternate dimension member long names to be used with the SET LABEL command, NOCASECONVERT prevents Application Server from converting labels to uppercase when the set is compiled.
<alternative_label>=<internal> Defines the alternate long name to use for the specified internal short name. Note that you must specify the names in the opposite order that you would use for data loads specify the alternative member name first, and then the internal short name.
November 2011
427
Example: SYNONYM
...This example creates a synonym set called Region_Names for the Region dimension. The dimension ... member names USA, UK, and CANADA are represented in the source file as C101, C102, and ... C103. The last line indicates that missing entries in the external ... source should be assigned to the dimension member 'N/A'. SYNONYM Region_Names USA = C101 UK = C102 CANADA = C103 'N/A' = BLANK
6.214 TABLE( )
Use
TABLE retrieves a value from a table of numbers, based on an index.
Syntax
CALCULATE <result> = TABLE(<value>, <c1>, <c2>, ..., <cn>) Parameter <result> <value> <c1>, ..., <cn> Description Name of the result variable. Index value between 1 and n, where n is the number of values in the table. If the value of n is outside the table, Application Server returns a missing value. Table of numbers.
Example
...In this example, Country has the values 1, 2, or 3. Tax_Rate has the value of .32 for ...country 1, .45 for country 2, and .27 for country 3. CALCULATE Tax_Rate = TABLE(Country, .32, .45, .27)
Syntax
TABS
428
November 2011
Syntax
TABS SINGLE
Example
This example inserts a tab character between columns: SET PREFACE '123' TABS COLUMN ONCE ORDER 0-12 ENDSET
Syntax
TEXT {LEFT} [<columns>] [ '<text>] [<keyword>] {CENTER} {RIGHT} {OVER [1-N]} {<n>} Parameter LEFT CENTER RIGHT OVER 1-N Description Left-aligns the text. Center-aligns the text. Right-aligns the text. Centers the text over the specified columns. Centers text based on the actual number of columns. <N> is a symbolic column number that causes titles and text to be centered over the actual width, instead of over the stated width. A positive integer indicating the number of spaces to indent text from the left margin. One or more column numbers over which you want the text to appear. You can specify either a range of columns separated by a dash (-), such as 3 - 5, or a range of columns and an increment such as 1 - 7 - 2, indicating columns 1 through 7 incremented by 2, or columns 1, 3, 5, and 7.
<n> <columns>
November 2011
429
Example
...Print Page No. followed by the current page number of the report. For example, Page No. 5. TEXT Page No. ,<page> ...Print Country of Origin followed by the current country name as in Country of Origin is Canada. TEXT Country of Origin is ,<country> ...This example puts the default column headers between lines of equal signs: COLHEADING TEXT ========================= TEXT <heading 1> TEXT ========================= ENDCOLHEADING ...If the column headers are months, the resulting column headings appear as: JAN 98 FEB 98
6.218 TIME
Use
TIME starts the Application Server editor, where you can create or edit a time set used in lists and reports. Note: If you manually create a time set, the last OUTPUT or RESULT member must have a label.
Syntax
TIME [<time>] [;<database> | ;EXTERNAL|LOCAL]
Editor Syntax
. [ VIRTUALCONVERT {BEFORE| AFTER} ] INPUT [TEMP] <periodicity> <period> [ - <period> ] [AS | NAMED <inputs>] . Parameter <time> Description Name of a new or existing time set up to 96 bytes. If you do not specify a name, Application Server uses the default time set if it exists, or the last time set you edited. Name of the database where the time set is located. If you do not specify a database, Application Server uses your Use database. Changes the order of calculations when a virtual variable is used in conjunction with a time set with output calculations. Use BEFORE when you are summing ratios or percents and you want the time set calculation to happen first, before the virtual variable calculation. Use AFTER when you are doing a % change calculation on these same virtual variables.
<database> VIRTUALCONVERT
430
November 2011
Notes: The SET VARIABLE command also allows you to use a CONVERT BEFORE or AFTER statement. The SET VARIABLE command requires exclusive access to the dimensional model. Use the VIRTUALCONVERT when you do not have exclusive access. If a VIRTUALCONVERT statement exists in the time set, it overrides any SET VARIABLE CONVERT settings. EXTERNAL LOCAL Indicates the time set is a text file that is not in an Application Server database. If the time set is a DOS file, its name cannot have an extension. Indicates that the time set is a client text file.
Note: You can create or edit a time set with the EXTERNAL or LOCAL extension, but you must copy it into a model and compile it before it can be used in the model.
Example
...Assume you have the following time dimension named Comp: input month latest as t1 input month latest minus 12 as t2 output advance, progress advance = t2 - t1 progress = t2 / t1 ...Assume you also have a Product dimension with members Heavy, Cars, and Trucks, a Class ... dimension with a member Actual, and a logic set that calculates a variable Contrib. ...When you display the data with the following statements: ACROSS Class, Variables, Product DOWN Comp SET LATEST 98/2 LIST ...The output appears as: Actual Contrib Heavy Feb 1999 Feb 1998 Advance Progress Cars Trucks 147419.01 145052.61 2366.40 1.01
...Application Server lists the four members of Comp down the page. The first row of variables in the ... list corresponds to the first dimension member: the latest month from the chosen period, or ... February 1999. The second row of variables corresponds to the second dimension member: the ... latest month minus twelve months, or February 1998.The third and fourth rows correspond to the ... calculated output dimension members Advance and Progress.
November 2011
431
Syntax
TITLE '<text>' Parameter <text> Description Text you want to print as a title.
Example
...This example prints 1998 Revenue as the report title: TITLE '1998 Revenue'
6.220 TOTAL( )
Use
TOTAL returns the accumulated values over all the selected time periods.
Syntax
CALCULATE <result> = TOTAL(<input>) Parameter <result> <input> Description Name of the result variable. Name of the variable to total.
Example: TOTAL
...This example totals all the values of Cost over the selected period: CALCULATE Total_Spent = TOTAL(Cost)
6.221 TRACE
Use
TRACE sends a copy of commands or command output, or both, to a specified destination. The default is to overwrite the exporting file, set, or symbolic name set.
Syntax
TRACE [COMMANDS | TIMING | OUTPUT | BOTH] {<destination> [APPEND]| OFF | UPDATE} Parameter COMMANDS TIMING Description Copies either commands from the command window or any job to a printer or destination. Specifies the time it takes to execute the commands from the command window or any job to a printer or destination. In the output, the timing is displayed first, and then the command. Notes: If you specify TRACE TIMING TERMINAL, timing information appears after the command output. SHOW SETTINGS doesn't show TRACE TIMING settings. OUTPUT BOTH <destination> Copies output (data, error messages, reassurance messages) to the destination. Copies both commands and output to the destination (default). One of the following destinations: TERMINAL - Your terminal. PRINTER - The default printer on your system.
432
November 2011
<setname> [;<database> | ;EXTERNAL] , where: <setname> - Name of a set. If you copy commands, Application Server creates a procedure. If you copy output or both commands and output, Application Server creates a document. <database> - Name of the database where the set is located. If you do not specify a database, Application Server uses your Use database. EXTERNAL - Indicates the set is a text file that is not in an Application Server database. If the set is a DOS file, its name cannot have an extension. Note: When specifying a path and filename for the destination on UNIX, make sure that you do not exceed 53 bytes. OFF Turns off a TRACE command. You must enter TRACE OFF to end a trace. Note: You can have both TRACE COMMANDS and TRACE BOTH active at one time. For example, you can enter a command in the form TRACE COMMANDS testproc to capture only the commands you enter in the procedure TESTPROC, and a command in the form TRACE BOTH tracecheck to capture both commands and output in the document TRACECHECK. To turn off these commands, you need to enter TRACE COMMANDS OFF and TRACE BOTH OFF, respectively. APPEND UPDATE Overrides the default and adds the trace to the end of an exporting file or set, without overwriting it. When used, each command and its output is sent to the destination when it is executed instead of being buffered.
Example: TRACE
...This example sends everything that appears on your ...screen between the two TRACE commands to the printer: TRACE BOTH PRINTER . . . TRACE BOTH OFF ...This example sends all commands you enter, and all commands from any procedures you enter with ... JOB, to the procedure NEWPROC, until you enter TRACE BOTH OFF: TRACE COMMANDS Newproc . . (all subsequent commands are copied to the procedure newproc) (issue a series of Application Server commands) (all dialogue on the screen here is sent to the printer)
TRACE COMMANDS OFF ...This example dumps the generated SQL to a document set: TRACE ON document_set TRACE OFF ...This example directs the TRACE output to a UNIX file /lsserver/this_is_a_trace_file: TRACE /lsserver/this_is_a_trace_file ...This example sends everything that appears on your screen to a file called "t_file" which is not an ... Application Server database.It sends each command and its output to the destination when it is ...executed instead of being buffered. TRACE BOTH t_file;EXTERNAL UPDATE
November 2011
433
6.222 TYPE
Use
TYPE displays the contents of a set.
Syntax
TYPE { [<settype>] <setname> [TOP integer] } { LOGIC %<vvariable> } Parameter <settype> Description Type of set: dimension, document, logic, procedure, report, synonym, or time. If you do not specify a set type, Application Server displays the first set it finds with the specified name. Name of the set you want to display. The first number lines of the set are typed (counting from the top). The integer must be greater than 0. Types a virtual variable's hidden logic set. For example, TYPE LOGIC %margin.
Example
...This example displays the dimension Country: TYPE dimension Country INPUT usa, canada, germany, england, france OUTPUT n america, europe RESULT world n america = usa + canada europe = england + france + germany world = n america + europe
Syntax
UDASH [ '<t>' ] Parameter <t> Description Character to print in a line. If you do not specify a character, Application Server displays a line of dashes.
Example
...This example prints ---------------: UDASH ...This example prints ************: UDASH '*' ...This example prints ========: UDASH '='
434
November 2011
Syntax
UDATA ['< t> '] Parameter <t> Description Character with which to underline data. If you do not specify a character, Application Server displays a line of dashes. Note: If you use the underline option in a SET-ENDSET block, you can specify the width of the underlining for each column.
Example
...This example underlines data with ------------: UDATA ...This example underlines data with *********: UDATA '*'
Syntax
UNAME [' <t> '] Parameter <t> Description Character with which to underline variable names. If you do not specify a character, Application Server displays a line of dashes.
Example
...This example underlines the variable name with ----------------: UNAME ...This example underlines the variable name with +++++++++: UNAME '+'
6.226 USE
Use
USE specifies the database to use.
Syntax
USE <database> [EXCLUSIVE | SHARED | READ] [RETAIN] [NOVARDB] Parameter <database> Description Name of the database you want to use.
November 2011
435
Syntax
USE { <file> | <document>; <database> } [OVERWRITE] [OEM] Parameter <file> <document> <database> OVERWRITE OEM Description Name of a file or path up to 64 alphanumeric characters. If you specify a path name, you must enclose it in single quotation marks (' '). Name of an Application Server document up to 24 alphanumeric characters. Name of the database where the Application Server document is located. Overwrites a file or document with the same name. Indicates the file contains national alpha characters generated under DOS that need to be translated to the Windows ANSI equivalents.
Example: USE
...Here, FINANCE is the current Use database: SHOW DATABASE ...The output of this command would be: USE Database: FINANCE Maximum Observations: 200 Access Maxblocks TESTDB FINANCE MARKET READ 500 % Available 41% 200 500 Mode
UPDATE UPDATE
...The following statements change the database to MARKET: USE Market SHOW DATABASE ...The output of this command would be: USE Database: ACCOUNT Maximum Observations: 400 Access Maxblocks TESTDB FINANCE MARKET READ 100 % Available 41% 200 500 Mode
UPDATE UPDATE
436
November 2011
Syntax
UTEXT [' <t> '] Parameter <t> Description Character with which to underline text. If you do not specify a character, Application Server displays a line of dashes.
Example
...This example underlines text with ----------------: UTEXT ...This example underlines text with =========: UTEXT '='
6.229 VALUE( )
Use
VALUE returns the value of the specified observation for a variable.
Syntax
CALCULATE <result> = VALUE(<variable>, <n>) Parameter <result> <variable> <n> Description Name of the result variable. Name of the variable for which you want the observation. Variable names that use special characters should be in single quotation marks (' '). Number of the time series observation in the variable. The number 1 returns the first observation; NCASES( ) returns the last.
Example
...Suppose you have a time dimension Quarter with the following definition: INPUT month 1 3 INPUT quarter 1 ...and a report with the following definition: ROWS Sales ROWS Sales / VALUE(Sales, 4) 'Mon/Qua' ...When you display the report using ACROSS Quarter DOWN ...Variables, the following appears. Here, VALUE(Sales, 4) returns 60. Jan Sales Mon/Qua 10.00 0.16 Feb 20.00 0.33 Mar 30.00 0.50 Qua 1 60.00 1.00
November 2011
437
6.230 VERSION
Use
VERSION displays the current Application Server version number.
Syntax
VERSION
Example: VERSION
...This example displays the Application Server version number: VERSION ...The output of this command would be: Application Server (TM) Version 9.x.0 for Windows Copyright (C) SAP AG 200x
Reference 6010 on 03-01-2008 10:13:37
This software program is licensed by SAP AG for use pursuant to the terms and conditions of a license agreement.
6.231 WHEN-ENDWHEN
Use
WHEN-ENDWHEN executes a block of statements based on a specified condition.
Syntax
WHEN <condition> . . <statements> . [ELSEWHEN <condition> . . <statements>] . [ELSE . . <statements> ] . ENDWHEN Parameter WHEN Description Indicates the start of a block. If the condition is true, executes the statements immediately following the condition. If the condition is false, proceeds to the next conditional block, if it exists. A logical condition using any arithmetic or logical operators. Any sequence of statements or commands. If the condition is true, executes the statements immediately following the condition. If the condition is false, proceeds to the next conditional block, if it exists. Note: There is no limit to the number of ELSEWHEN blocks.
438
November 2011
ELSE ENDWHEN
If the condition is true, executes the statements immediately following the condition. If the condition is false, exits from the loop. Indicates the end of a block.
Example
...Assume that the UK has a tax rate of 30%, France has a tax rate of 28%, ...and all other countries have a rate of 32%. You can calculate the tax rates as follows: WHEN Country EQ UK Tax Rate = .3 ELSEWHEN Country EQ France Tax Rate = .28 ELSE Tax Rate = .32 ENDWHEN ...Assume that a company offers a discount that is 5% for volume over 250 units, 10% for volume over ... 500 units, and 15% for volume over 1000 units. Using the conditional operator LE, this example ... shows how to calculate the discount: WHEN Volume LE 250 Discount = 0.0 ELSEWHEN Volume LE 500 Discount = 0.05 ELSEWHEN Volume LE 1000 Discount = 0.1 ELSE Discount = 0.15 ENDWHEN
6.232 WHILE-ENDWHILE
Use
WHILE-ENDWHILE executes a block of statements until a specified condition becomes false.
Syntax
WHILE <condition> . . <statements> . ENDWHILE Parameter WHILE <condition> <statements> ENDWHILE Description Indicates the start of a loop. While the condition is true, executes the statements in the loop. When the condition is false, exits from the loop. A logical condition using any arithmetic and logical operators. Any sequence of statements or commands. Indicates the end of a loop.
November 2011
439
Syntax
WRITE {APPEND} {NEW} {UPDATE} {EXISTING} {OVERWRITE} Parameter APPEND NEW UPDATE EXISTING OVERWRITE Description Appends records to the end of a file. Writes only new records to a file. Writes new records to a file and updates any records that already exist in the file. Updates records that already exist in a file. Empties the file before writing all records to it.
Note: If you have the Application Server database set to display the short names with SET SHORT, Application Server sends the short names for the variables and dimensions to the file. If you set the database to the display labels with SET LONG, Application Server sends the labels to the file.
Example: WRITE
...Write all records to the external file specified with USE overwriting the file's contents if not empty: USE Shipment WRITE OVERWRITE
Syntax
XRAY <name> [RECORDS] [NOTREE] Parameter <name> RECORDS Description The database name. This option validates all the records in the database. This option is extremely time consuming for large databases and you should use it with care. If you do not use the RECORDS option, Application Server does not check each record, and runs much faster, but provides somewhat less validity checking. Switches off the checking of B-Trees. Use this option to do a brief check on a large database.
NOTREE
440
November 2011
6.235 YIELD( )
Use
YIELD returns a scalar value containing the yield of a bond or security with a given interest rate.
Syntax
YIELD(<value>, <rate>, <periodicity>, <maturation>, <buyprice>, <buydate>, <sellprice>, <selldate>) Parameter <value> <rate> <periodicity> <maturation> <buyprice> <buydate> <sellprice> <selldate> Description Scalar amount of the face value of the bond or security. Scalar annual rate or time-series rate. Periodicity of the dividend payment: yearly, quarterly, or monthly. Date when the bond or security matures. Scalar purchase price. Date when the bond or security was bought. Scalar price at which the bond or security is sold. This is the same as the face value if the bond is held to maturity. Date when the bond or security is sold or matures.
November 2011
441
7
7.1
A schema is a set of relational database tables that are organized to make multidimensional analysis easier to perform. The Hybrid OLAP analysis environment is a combination of an Application Server multidimensional model with a relational schema. You can create a schema from the Application Server IDQL command line. When the schema is in place, Application Server generates the SQL code required to retrieve, cache, and update the schema without interaction from the user. (The SCHEMA subsystem SPY command allows you to view the SQL code that Application Server generates.) All components of an Application Server multidimensional model, including dimensions, variables, attributes, labels, and data, are represented in the schema. For example, Application Server dimensions are defined in the Dimensions table in the schema. All of the tables in a schema are identified by a schema prefix that the user sets. For example, the Dimensions table in a schema with the prefix DEMO is called DEMO_DIMENSIONS. When you create several schemas in a single database or Oracle tablespace, you can distinguish the tables that belong to each schema by their prefix. Note: Schemas are sometimes referred to as star or snowflake schemas, because of the pattern the tables form when drawn in an entity/relationship diagram. The Hybrid OLAP schema is referred to as a galaxy schema.
7.2
A schema consists of relational tables representing all components of the Application Server database. The structure of the Hybrid OLAP schema is such that internal multidimensional data access can be transformed into efficient SQL. This ensures good performance when doing multidimensional data access in relational storage. A schema is composed of the following tables: Base tables: These contain information about the periodicities, dimensions, variables, and consolidation types that exist in the schema. Change tables: These store updates to existing Dimension and Fact tables, allowing for faster consolidation. Dimension tables: These describe the individual members of each dimension, their hierarchical relationships, and attributeinformation. Fact tables: These store the actual time-series data for variables. Data for any given variable may be split by time across several Fact tables. Optionally, you can format fact tables to store time down in fact tables. Format table: The Format table specifies Application Server formatting information. Master table: The Master table contains the fiscal calendar information, the orientation of how time information is stored in the fact tables, and Application Server version information. Reference tables: These are optional, user-created tables, one per Dimension table. They store labels for the members and variables. Using Reference tables, you can define multiple labels for a given dimension member, enabling easy support for multi-lingual labels. Tracker table: The Tracker table is at the heart of the Hybrid OLAP schema. It keeps track of the Fact tables, which store time-series data, and controls how data for a particular variable and dimension level combination is to be consolidated.
442
November 2011
7.3
Creating a Schema
When you create a relational schema, the components of an Application Server model, such as dimensions, variables, and data, are exported to relational tables. You need to create a relational table schema before you can use relational drill through, or exploit Hybrid OLAPs storage independence. You can create a schema for the Hybrid OLAP analysis environment using the EXPORT commands in the Hybrid OLAP SCHEMA subsystem of Application Server at the IDQL command line
7.4
You can build the entire dimensional model in Application Server if you want all the dimension data to be stored in the dimensional model. Application Server is optimized to allow for unlimited dimension members. For information about building a dimensional model, see the Application Server section of this help. You may prefer to build a Hybrid model instead of a standard Application Server model for any of these reasons: You have very large dimensions that youd prefer to store in the RDBMS rather than in the dimensional model.
November 2011
443
Working with Hybrid OLAP Creating a Hybrid OLAP Model You want to use on-the-fly consolidation to configure specific level combinations and do some finetuning. Note: It is also possible to use on-the-fly consolidation in a standard model, but you can only configure based on dimension inputs and outputs. You want the flexibility to use the data stored in the fact tables in other products or applications that support the same standard table format
Procedure
supervisor create database salesdb blocks 200000 members 100000 observations 1000 use salesdb access lslink connect Base ...Build the Product dimension select device, category, devlbl, catlbl from product.txt construct dimension product level device, category label devlbl, catlbl compile dimension product ...Build the Region dimension select city, market, territory, citylbl, mktlbl, terrlbl from region.txt construct dimension region level city, market, territory label citylbl, mktlbl, terrlbl compile dimension region end ...Create the variables. Account is a Hybrid dimension and Channel and Type are small dimensions created in steps 2 and 3 create monthly sales by account, channel, product, region, type create monthly units by account, channel, product, region, type
444
November 2011
You can export in the following scenarios: Export the base, the dimensions, and the variables individually. This gives you the chance to control many options when exporting. Export the entire dimensional model including the base, the dimensions, and the variables all at once. This is the simpler and easier method of exporting because it takes only one command. You do not have the control over options specified above though. With any export method you use, you can also do the following: If the model already has data loaded in it, you can export the data to the fact tables too. If you want to be able to use fact tables in any other product applications, you can structure the fact tables with time information stored in one column. Note: By default, Hybrid OLAP stores information with each time period defined as a separate column in the fact tables. . Tip: Store time going down the table if you want to optimize the time it takes to load and consolidate data. Store time going across the table if you want to optimize end-user performance.
Note: The Table Parameters table contains columns that correspond to all of the relational database table creation parameters that can be supplied as part of an Oracle SQL CREATE TABLE or CREATE INDEX statement. You can modify these parameters to control how and where Hybrid OLAP creates the rest of the schema tables and indexes. Additionally, you can set the size for each table and index, and specify privileges for other database users on the objects you create.
EXPORT DIMENSION Product, Region UNRECOVERABLE
November 2011
445
....... Export the variables and use short names rather than codes in the fact tables. EXPORT VARIABLE * USENAMES spy off end Notes: In Hybrid OLAP models, dimension names should be of no more than 17 characters. The following tables are created when you export the model: prefix_dimension1 prefix_dimension_D prefix_BY_DIM prefix_dimension2 prefix_dimension2_D prefix_CONSOLIDATIONS prefix_DAY_NAMES prefix_DIM_TYPES prefix_DIMENSIONS prefix_FMT prefix_LEVELS_dimension1 prefix_LEVELS_dimension2 prefix_MASTER prefix_MONTH_NAMES prefix_PERIOD_FORMAT prefix_TABLE_PARAMS
446
November 2011
You include the TIME DOWN keyword on only one EXPORT command to allow the fact table configuration. All proceeding EXPORT commands assume the time down configuration.
Exporting a model with time stored down the fact table columns
This topic explains how to export a dimensional model so that time is stored down the column in fact tables. This example assumes that the model has just been created and has no data loaded yet (a typical scenario), and does not require any aliases for dimension column names, or any data type specifications for columns. Use the EXPORT SCHEMA command to create base tables in the schema, and export all dimension and variable information with time going down the column in fact tables. For example:
....... Export base model to create HOLAP schema tables in RDBMS. schema .. Use SPY TERMINAL to trace to the screen the SQL commands .. issued by Application Server spy terminal connect Holap prefix ABC export schema TIME DOWN monthly YYM NAME SalesPeriod TIMETYPE Integer NTHREADS 2 spy off end
Tip: You can get better performance if you use TIMETYPE Integer because the time field doesn't have to be converted to integer to get the ranges of time.
Procedure
1. Enter the EXPORT BASE command to create the relational tables in the schema that do not depend on specific dimension, variable, or data information. Use the TIME DOWN keyword to identify that you want to store time going down the fact table column. You must issue the EXPORT BASE command before you issue the EXPORT DIMENSIONS or EXPORT VARIABLES commands. For example:
schema .. Use SPY TERMINAL to trace to the screen the SQL commands .. issued by Application Server spy terminal connect Holap prefix ABC ....... Export base model to create HOLAP schema tables in RDBMS with time down. EXPORT BASE TIME DOWN monthly YYM NAME SalesPeriod TIMETYPE Integer NTHREADS 2
2. Enter the EXPORT DIMENSION command to export dimensions from an Application Server dimensional model to the schema. Specify any column aliases and datatypes necessary. The
November 2011
447
Working with Hybrid OLAP Creating a Hybrid OLAP Model EXPORT DIMENSION command creates the Dimension Levels table and dimension tables relational tables in the schema for each dimension specified.
....... Export Product as ProductName and use short names for members EXPORT DIMENSION Product ALIAS ProductName USENAMES ....... Export Region as RegionCode with a small integer datatype EXPORT DIMENSION Region ALIAS RegionCode CODETYPE Smallint ....... Export Channel, Type, Account with no aliases with a small integer datatype EXPORT DIMENSION Channel, Type, Account, CODETYPE Smallint
3. Enter the EXPORT VARIABLE command to export variables from an Application Server dimensional model to the schema. For example, to export all variables, enter the following command.
....... Export sales and costs as FLOAT EXPORT VARIABLE Sales, Cost DATATYPE Float ....... Export margin as NUMBER EXPORT VARIABLE Margin DATATYPE Number(10,2) ....... Export units as REAL EXPORT VARIABLE Units DATATYPE Real spy off end
7.4.2.2.2
Use EXPORT DATA when you have an existing Application Server model with data in it and you have already exported the model to relational schema tables using EXPORT BASE, EXPORT DIMENSIONS, and EXPORT VARIABLES. Use the EXPORT DATA command to export the data from an Application Server dimensional model to the schema. For example, to export the data previously selected with Application Server SELECT statements, enter the following command:
EXPORT DATA SELECTED
Use EXPORT SCHEMA DATA when you have an existing Application Server model with data in it but you have not yet exported the model to relational schema tables. The EXPORT SCHEMA command does not let you specify column aliases or column datatypes, which are allowed if you use the EXPORT BASE command and then follow it with EXPORT DIMENSION and EXPORT VARIABLE command. Use the EXPORT SCHEMA command with the DATA keyword to create base tables in the schema, export all dimension and variable information, and export data from an Application Server multidimensional model. For example:
EXPORT SCHEMA DATA
Note: In Hybrid OLAP models, dimension names should be not be longer than 17 characters.
448
November 2011
accurately define all the members and levels of those dimensions. You use the Transformer to map to a data source and feed information into the Hybrid OLAP schema tables.
Procedure
1. Examine the dimension tables and dimension level tables created by the EXPORT command: In Application Server, from the Window menu, choose SQL Command. Type:
SELECT * FROM prefix_LEVELS_dimension SELECT * FROM prefix_dimension
2. Review the source files that contain the additional members for the dimensions. 3. Using a text editor, create a Transformer .INI file that contains a dimension section with parameters to load the additional members into the dimensions. For example, this file will be used to populate a dimension table for the Account dimension in the RDBMS. [Windows] TBDB=C:\program files\Pilot Software\Common\DATA\TBDB.ENG ; This is the Transformer initialization file for Hybrid OLAP. It is used to ; set up the parameters to load dimensions and data into Hybrid OLAP models. ; The Transformer can be set up to run in batch. ; Load customers into Account dimension - assumes Link/SQL based source [BldAccount] Loading=Dimension LinkIDSource=SlsBase SourceSQL=select CUSTOMER, GROUP, CUSTLBL, GRPLBL from ACCOUNT.TXT LinkIDTarget=SlsHOLAP Table=Account Schema=SLS Truncate=Yes Trace=Yes Result=Yes Format=Delimited TAB BlockSize=8192 Blocks=100000 Buffers=10000 Level1=CUSTOMER Level2=GROUP Label1=CUSTLBL Label2=GRPLBL 4. At a command prompt, run the Transformer with the initialization file and add the additional members to the Hybrid tables. Type the following command where filename is the name of the
November 2011
449
Working with Hybrid OLAP Creating a Hybrid OLAP Model Transformer initialization file and inputmembersection is the section name within the file containing the parameters to read in the members of the Hybrid dimensions:
SGTRANS -inifile filename.ini -s inputmembersection
5. Exit the command prompt. 6. Examine the relational tables to review the added dimension members to the updated dimension. In Application Server, from the Window menu, choose SQL Command. Type:
SELECT * FROM prefix_LEVELS_dimension
The Transformer load has updated the count of members at each level.
SELECT COUNT(*) FROM prefix_dimension
The resulting number of rows should be equal to the total number of members that exist in the dimension.
Procedure
1. To match the dimension information, you need to remove the original model and recreate it based on the Hybrid OLAP schema tables in the RDBMS.
. Import model from updated schema tables in RDBMS supervisor remove database salesdb supervisor create database salesdb blocks 200000 members 100000 observations 1000 use salesdb
2. You import the calendar and the standard dimensions and variables from the RDBMS tables to update the Application Server model.
schema connect HOLAP prefix sls import fiscal import dimension channel import dimension product import dimension region import dimension type
3. Create temporary view tables to import the output and result levels of the larger dimensions into Application Server, and then import those dimensions.
....... create views for importing output levels of Account SQL create view tmppfx_master as select * from sls_master SQL create view tmppfx_dimensions as select * from sls_dimensions
450
November 2011
SQL create view tmppfx_levels_account as select * from sls_levels_account SQL create view tmppfx_account as select * from sls_account where m_level > 1 prefix tmppfx import dim account
4. Now you import the variables and clean up the temporary tables.
prefix sls import var * ....... clean up temporary tables SQL drop view tmppfx_master SQL drop view tmppfx_dimensions SQL drop view tmppfx_levels_account SQL drop view tmppfx_account . update columns in dimensions table used to optimize select performance SQL update sls_dimensions set no_guests=0 where d_name=ACCOUNT SQL update sls_dimensions set max_guests_level=1 where d_name=ACCOUNT End
Procedure
1. Issue the command TRACKER INSERT * to insert records for all level combinations for all variables. Because the Tracker table stores information about the period range in the model, you must first issue a SET PERIOD command. The SET PERIOD command should cover the full range of dates you anticipate storing in the model. 2. Run a procedure similar to this:
....... Create Tracker table entries for all dimension level combinations for ....... all variables. Starting with data for 99 through 02. set period Jan 1999 - Dec 2002 schema connect HOLAP prefix sls tracker insert * end
3. View the contents of the Tracker table: From the Window menu, choose SQL Command and verify that the Holap LinkID is selected in the lower left-hand corner of the status bar. On the Command line, issue the following query to show the tracker table entries for the variable sales (V_Code=1).
November 2011
451
In Step 7 you will see how the tracker table fields are updated to control the consolidation process. Initially the location for the consolidated data is set to the RDBMS. You will update this field to store some of the consolidated data in the Application Server model.
Procedure
1. Prepare the fact section of the Transformer initialization file to load all the data for the input combinations. 2. Go to a command prompt. 3. From the data directory, type the following command where filename is the name of the Transformer initialization file and loadsection is the section name within the file containing the parameters to load the data:
sgtrans -inifile filename.ini -s loadsection
4. Exit from the command prompt. Here is a sample section of a Transformer initialization file used to input data into the fact tables in the RDBMS. [Windows] TBDB=C:\Pilot\DATA\TBDB.ENG ; Load the data for 99 - 02 [LoadData] Loading=Fact LinkIDSource=SlsBase SourceSQL=select * from DETAIL.TXT LinkIDTarget=HOLAP Schema=SLS Truncate=Yes Trace=No SlowLoad=No DateFormat=YYYY/MM Format=Delimited TAB BlockSize=8192 Blocks=100000 Buffers=10000 VARIABLE1=UNITS,UNITS VARIABLE2=SALES,SALES
452
November 2011
Dim1=ACCOUNT,ACCOUNT Dim2=CHANNEL,CHANNEL Dim3=PRODUCT,PRODUCT Dim4=REGION,REGION Dim5=TYPE,TYPE TIME=TIME 5. View the fact tables that are created in the RDBMS. From the Application Server Window menu, choose SQL Command. From the Edit menu, choose Select Link ID and then select HOLAP. From the SQL window enter:
SELECT TABLE_NAME FROM USER_TABLES
November 2011
453
7.4.2.7.1
You mark certain combinations as pending consolidation by issuing SQL code. The SQL code sets the pending flag in the Tracker table for all aggregate level combinations and indicates where the data is stored. In the sample SQL code shown below, any non-base-data level combination that contains a level of a large dimension that is stored only in the RDBMS must also be stored in the RDBMS (cons_type = 1). All others can be stored in Application Server (cons_type = 6).
Procedure
1. Mark all combinations that are not base data as pending consolidation.
....... Consolidate sales and units variables after updating Tracker table. schema connect HOLAP prefix sls ....... Pending flag set for all level combinations except base data sql update sls_tracker set pending = 1 where cons_type <> 0
2. Set all the level combinations to a consolidation type of six so that all output levels are stored preconsolidated in Application Server.
....... Store all level combinations in Application Server (cons_type of 6) sql update sls_tracker set cons_type = 6 where cons_type <> 0
3. For the combinations containing data for the levels of the dimensions known only in the RDBMS, change the consolidation type to 1 so that data will be stored preconsolidated in the RDBMS.
....... Store all level combinations with input of big dimension in relational (cons_type of 1) sql update sls_tracker set cons_type = 1 where l_account = 1 end
7.4.2.7.2
Use the CONSOLIDATE PENDING command to consolidate any variable data marked as pending in the tracker table. When you execute the CONSOLIDATE PENDING command, Application Server checks all rows in the Tracker table to see if data for the specified variables is marked for consolidation. If the value of the pending column in the Tracker table is set to any non-zero number, the data will be consolidated. Following successful consolidation, the value of the pending column is reset to 0, unless the NORESET keyword is specified.
Procedure
1. Create a procedure similar to this one to consolidate the variables in the model. You can include the SPY and PROGRESS commands to examine the SQL code generated for the consolidate.
....... Consolidate sales and units variables after updating Tracker table. schema connect HOLAP prefix sls spy terminal
454
November 2011
progress on consolidate pending noforeignkeys unrecoverable noanalyze sales nthreads 2 consolidate pending noforeignkeys unrecoverable nodimrefresh units nthreads 2 progress off spy off end
2. Use the Rollup Editor to verify the location of data in Application Server. For example:
ROLLUP Sales ADD EVERYBODY SHOW COUNT END
You can see that the Application Server model contains data for the output combinations only of the large dimensions. All of the combinations that contain input data for this dimension are stored in the fact tables in the RDBMS. 3. Use the SQL window to view the location of data in Hybrid OLAP and see the record count for the level combinations stored in the RDBMS. From the Window menu, choose | SQL Command. From the SQL window enter:
SELECT * FROM SLS_TRACKER WHERE V_CODE=1
Scroll until the NROWS column is visible. Cons_Type = 0 means base data is stored in RDBMS, Cons_Type = 1 means consolidated data is stored in the RDBMS, Cons_Type = 6 means consolidated data stored in Application Server.
November 2011
455
Working with Hybrid OLAP Creating a Hybrid OLAP Model BlockSize=8192 Blocks=100000 Buffers=10000 VARIABLE1=UNITS,UNITS VARIABLE2=SALES,SALES Dim1=ACCOUNT,ACCOUNT Dim2=CHANNEL,CHANNEL Dim3=PRODUCT,PRODUCT Dim4=REGION,REGION Dim5=TYPE,TYPE TIME=TIME 4. Run the Transformer with the initialization file to load a new period of input or base data for the Hybrid model. Type the following command to load new data where filename is the Transformer initialization file and newperiodsection is the section name in the initialization file containing the parameters to load the data from the source file:
SGTRANS -INIFILE filename.INI -S newperiodsection
5. Use the SQL window to look at delta table: From the Window menu, choose | SQL Command. From the SQL window enter:
SELECT * FROM SLS_F_1_36_F_D
456
November 2011
7.5
The default schema fact tables are built with time going across. Optionally, Hybrid OLAP's open architecture allows you to store time-related information down the column in fact tables. This format is common in other applications, and allows you to use the fact tables in those applications if desired. To create a model that can be used in other applications, you follow the same steps as though you were building a standard Hybrid OLAP model. When you are exporting the model, you include the TIME DOWN keywords in the command to specify that you want to store the time-related information down the columns in the fact tables. You can export a dimensional model with time going down columns in two ways: Export without specifying any aliases for dimension column names, or any data type specifications for columns. Use the EXPORT SCHEMA command with the TIME DOWN keyword for this method. Export while specifying aliases for dimension column names and data type specifications for columns. Use the EXPORT BASE, EXPORT DIMENSIONS, and EXPORT VARIABLES commands with the TIME DOWN keyword on the EXPORT BASE command. You include the TIME DOWN keyword on only one EXPORT command to allow the fact table configuration. All proceeding EXPORT commands assume the time down configuration.
7.6
Note: Before entering the SCHEMA subsystem, make sure you set the database to exclusive use. For example, to set a database called MARKETING to exclusive use, enter the following command:
USE MARKETING EXCLUSIVE
November 2011
457
Working with Hybrid OLAP Importing Every relational schema that you create must have a prefix. The schema prefix must be of 5 byte or fewer, and begin with an alphabetical character. If you have long dimension names (that is, dimension names of 10 or more characters, up to a maximum of 17), it is advisable to use a prefix shorter than 10 characters. The schema prefix is applied to all of the relational tables in a schema, and serves as a unique identifier.
Where required by your RDBMS, you must follow the SQL command with a commit. For example:
SQL COMMIT
Note: You cannot enter SQL SELECT statements using the SQL (Schema) command.
Exiting
Enter the END command to leave the SCHEMA subsystem.
END
7.7
Importing
Use the IMPORT FISCAL command to import fiscal calendar information defined in a schema into an existing Application Server dimensional model. For example:
IMPORT FISCAL
Note: When a fiscal calendar is already set in the Application Server dimensional model, and variable data exists, the existing fiscal calendar is used. Enter the IMPORT DIMENSION command to import dimensions defined in a schema into an existing Application Server dimensional model. For example, to import all of the schema dimensions into the model, enter the following command:
IMPORT DIMENSION *
Enter the IMPORT VARIABLES command to import variables defined in a schema into an existing Application Server dimensional model. For example:
IMPORT VARIABLES
Enter the IMPORT SCHEMA command to import fiscal calendar information, dimensions, and variables defined in a schema into an existing Application Server dimensional model. For example:
458
November 2011
IMPORT SCHEMA
7.8
Deleting a Schema
During the design and prototyping stage of data mart development, you may choose to delete part of a schema rather than the whole thing. Tables must be removed from the schema in the order designated below. This command removes the Reference table(s) from the schema:
DROP REFERENCES
This command removes the Tracker table and Fact table(s) from the schema:
DROP DATA
This command removes all of the Dimension tables from the schema:
DROP DIMENSION *
7.9
Viewing Definitions
Enter the VIEW DIMENSION command to view the schema dimensions. For example:
VIEW DIMENSION
Enter the VIEW VARIABLE command to view the schema variables. For example:
VIEW VARIABLE
Enter the VIEW SCHEMA command to view information about the variables and dimensions defined in the current schema. For example:
VIEW SCHEMA
Enter the VIEW PREFIX command to view the current schema prefix. For example:
VIEW PREFIX
Enter the VIEW CACHE command to view the current cache settings. For example:
VIEW CACHE
Enter the VIEW CONNECTION command to view the Link ID being used to connect to the relational database. For example:
VIEW CONNECTION
November 2011
459
Working with Hybrid OLAP Working with Dimensions, Variables and Data Enter the SET LABEL command to define more than one label for a dimension member. For example, to use the label set alt3 for the Scenario dimension, while connecting to the relational database with the Link ID dblink1, enter the following command:
SET LABEL Scenario FROM dblink1 NAME alt3
The Drillthru attribute specifies that a variable can be stored in either the relational tables or the Application Server multidimensional model. Enter the SET VARIABLE command to apply the Drillthru attribute to a variable. For example, to set all of the variables in a model as Drillthru, enter the following command:
SET VARIABLE *
Enter the SET VARIABLE command with the NOFROM keyword. For example, to remove the Drillthru attribute to all variables in a model, enter the following command:
SET VARIABLE * NOFROM
Enter the SHOW VARIABLE command to view the variables. For example:
SHOW VARIABLE
Drillthru variables are marked with a "D" in the Type column. In addition, after each Drillthru variable, the Link ID and schema prefix are listed. Enter the CACHE command to control how often Application Server goes back to the RDBMS to refresh the control information that it needs. For example, to cache Tracker table data until the next Application Server command is issued, enter the following command:
CACHE TRACKER COMMAND
460
November 2011
Use
CACHE is a Hybrid OLAP SCHEMA subsystem command. CACHE controls how often Application Server goes back to the RDBMS to refresh the control information that it needs. Certain combinations are not supported.
Syntax
CACHE {[ALL | DATA | DIMENSIONS | TRACKER | VARIABLES] [DELETE | FOREVER | SESSION | COMMAND | MATRIX | TIME <seconds> | OFF]} Parameter ALL DATA DIMENSIONS TRACKER VARIABLES DELETE FOREVER SESSION COMMAND MATRIX TIME <seconds> OFF Description Sets the caching options for data, dimensions, Tracker table, and variable information read into Application Server from the schema. Sets the caching options for data read into Application Server from the schema. Sets the caching options for dimension information read into Application Server from the schema. Sets the caching options for Tracker table information read into Application Server from the Tracker table in the schema. Sets the caching options for variable information read into Application Server from the schema. Deletes the cached data for the specified cache type. Retains the cached data for the specified cache type until it is deleted or the EXIT CLEAR command is executed. Retains the cached data for the specified cache type until it is deleted or the Application Server session is terminated. Retains the cached data for the specified cache type until the next Application Server command is executed. Caches the data for the specified cache type on a matrix basis. Specifies in seconds how often the SAP NetWeaver BI Connector checks to see if new data has been loaded. The default is 600 seconds (10 minutes). Switches off caching for the specified cache type.
Remarks
You use CACHE command keywords in pairs. The first keyword specifies the type of data to be cached. The second keyword determines how the data is to be cached. The following table shows the supported and default caching option for each data type. You may need to maximize the Help window to view all of the columns in the table.
Data type DATA DIMENSIONS TRACKER VARIABLES TABLES Supported values COMMAND COMMAND, SESSION, FOREVER COMMAND COMMAND, SESSION, FOREVER COMMAND, SESSION, FOREVER Default value COMMAND FOREVER COMMAND COMMAND SESSION
November 2011
461
8.2
Use
CONSOLIDATE {PENDING | INCREMENTAL} is a Hybrid OLAP SCHEMA subsystem command. CONSOLIDATE PENDING consolidates specified variable data that is marked as pending in the Tracker table. CONSOLIDATE INCREMENTAL allows you to make an intelligent consolidation of only those variable/level combinations that require consolidation following a change in input data values or dimension structure.
Syntax
CONSOLIDATE {PENDING | INCREMENTAL} [ARRAYSIZE <number>] [DIRECTLOAD] [DOINSERTS FIRST | DOUPDATES FIRST] [INDEXSPACE <tablespace_name>] [NOANALYZE] [NOCOMPRESS] [NODIMREFRESH <dimension>] [NOFOREIGNKEYS] [NORESET [<variables>] ] [NTHREADS <number>] [TABLESPACE <tablespace_name>] [UNRECOVERABLE] [WORKDB <work_database>] Parameter ARRAYSIZE <number> Description Specifies a number between 1 and 32,767 for the size of the array you want to transmit to and from the RDBMS during the consolidation process. If you do not specify an arraysize, rows are transmitted to and from the RDBMS in batches of 1,000. (Oracle) Invokes the Oracle Sql*Loader and uses the DIRECT load path to load fact tables, create the primary key, and populate any other indexes at table creation time. Specifies that you want Application Server to try to insert rows first during a CONSOLIDATE PENDING or CONSOLIDATE INCREMENTAL. If you know that your data will require mostly inserts (i.e, you have all new data for new time periods, and there are few changes to existing data), you should perform a DOINSERTS to improve performance. Tip: If you have time stored down the fact tables, you should perform a DOINSERTS because it is more likely that data will be inserted more than updated for new time periods. By default, if you do not specify either DOINSERTS or DOUPDATES, the CONSOLIDATE PENDING command will try inserts first when the Schema is storing time down, and it will try updates first when the Schema is storing time across. If the CONSOLIDATE PENDING determines that the target RDBMS table is empty then it will always do inserts. DOUPDATES FIRST Specifies that you want Application Server to try to update rows first during a CONSOLIDATE PENDING or INCREMENTAL, and then insert rows as necessary. If you know that your data will require mostly updates (i.e., you are consolidating data that has changed for the same time periods, but you dont have data for new time periods), you should perform a DOUPDATES FIRST to help improve performance. Tip: When you have time stored across the fact tables, Application Server needs to do updates and inserts to fully account for updating values in the rows before inserting new data. If you know that your data will require mostly updates, such as
DIRECTLOADPATH
DOINSERTS FIRST
462
November 2011
when time is going across, you should perform a DOUPDATES to help improve performance. By default, if you do not specify either DOINSERTS or DOUPDATES, the CONSOLIDATE PENDING command will try inserts first when the Schema is storing time down, and it will try updates first when the Schema is storing time across. If the CONSOLIDATE PENDING determines that the target RDBMS table is empty then it will always do inserts. INDEXSPACE <tablespace_name> Creates the indexes on this tablespace (Oracle or DB2). INDEXSPACE <tablespace_name> allows you to control the placement of indexes. NOANALYZE (Oracle) Do not run the ANALYZE command to gather statistics for the costbased optimizer. Information for the specified dimension is not read from the relational schema. The existing dimension cache will be used instead, improving performance significantly. Notes: Use NODIMREFRESH only when you are sure that the specified dimension has not changed since the most recent CONSOLIDATE PENDING. NODIMREFRESH information is stored in the Work database. If you use a custom Work database specified with the WORKDB keyword, you will be able to use the NODIMREFRESH information across sessions. If you use the default Work database instead and want to reuse NODIMREFRESH, make sure you save your Work database when you exit Application Server. NOCOMPRESS Turns off the default compression used by Hybrid OLAP on cached consolidated data of types 1, 2, and 6 before it is returned to the RDBMS. Note: The NOCOMPRESS keyword is intended for experimental use. In general, the default compression is recommended. NOFOREIGNKEYS NORESET <variables> Foreign key integrity constraints are not created. Do not reset the pending column in the Tracker table after data is consolidated. This option can be useful during testing. One or more variable names separated by commas. If you do not specify a variable name (the default), the currently selected variables are consolidated. Specify variable names that use special characters in single quotation marks (' '). Allows you to run two processes at the same time. When <number> is greater than 1, this keyword allows one thread to carry out the Application Server and sgtrans processing and another thread to carry out the RDBMS processing concurrently. For example, while a CONSOLIDATE PENDING command is executing, Application Server can read rows from the RDBMS and aggregate those rows at the same time that the RDBMS is delivering the rows. Tip: On multiprocessor systems, using multiple threads concurrently should always improve throughput during reading and writing processes. On single processor systems, it may also improve throughput if a chunk of any elapsed time is I/O during which the CPU would otherwise be idle. If you omit the NTHREADS keyword, or if you specify NTHREADS 1, only one process will occur at a time. For example, while a CONSOLIDATE PENDING command is executing, Application Server will read the rows from the RDBMS (via Link). While the RDBMS delivers the rows, Application Server remains idle waiting until the RDBMS is finished. When the rows are delivered, Application Server starts aggregating, while the RDBMS remains idle waiting for the next request. TABLESPACE <tablespace_name>
NODIMREFRESH <dimension>
NTHREADS <number>
November 2011
463
Remarks
When you execute the CONSOLIDATE PENDING command, Application Server checks all rows in the Tracker table to see if data for the specified variables is marked for consolidation. If the value of the pending column in the Tracker table is set to any non-zero number, the data will be consolidated. Following successful consolidation, the value of the pending column is reset to 0, unless the NORESET keyword is specified. Data will be marked as pending consolidation when the consolidation type of previously unconsolidated data is changed to a consolidation type that requires it to be stored in preconsolidated format (in either Application Server or the relational database).
8.3
Use
DELTA (Schema)
DELTA is a Hybrid OLAP SCHEMA subsystem command that allows you to delete, drop, or replace all of the delta rows from your schemas Dimension Delta or Fact Delta table(s).
Syntax
DELTA {TRUNCATE | DROP | REPLACE} {DIMENSION | FACT | BOTH} {* | <list of table names>} Parameter TRUNCATE DROP REPLACE DIMENSION FACT BOTH * Description Truncates the delta rows from the specified Delta tables. Drops the delta rows from the specified Delta tables. Replaces the delta rows in the specified Delta tables. Truncate, drop, or replace only the Dimension Delta table delta rows. Truncate, drop, or replace only the Fact Delta table delta rows. Truncate, drop, or replace both Dimension Delta and Fact Delta table delta rows. Indicates that the DELTA command applies to all Delta tables of the specified type.
<list of table names> For Dimension Delta tables, specify a list of table names. For Fact Delta tables, specify a list of table names, including the prefix if necessary.
Remarks
You should truncate delta rows from Fact Delta tables if you have done a BCP or a Sql*Loader Direct load, a TRUNCATE table, or when a CONSOLIDATE INCREMENTAL fails.
8.4
Use
DROP BASE is a Hybrid OLAP SCHEMA subsystem command. DROP BASE deletes the base tables from the current schema
Syntax
DROP BASE
464
November 2011
Remarks
You should run the DROP REFERENCES, DROP DATA, DROP DIMENSION, and DROP VARIABLE commands before you use the DROP BASE command to delete base tables from the schema. Alternatively, you can run the DROP SCHEMA command to delete the entire schema in a single step. The DROP BASE command deletes the following relational tables from the schema in the order shown: Periodicities table Consolidations table Dimension Types table Dimensions table By Dimensions table Format table Variables table Master table
8.5
Use
DROP DIMENSION is a Hybrid OLAP SCHEMA subsystem command. DROP DIMENSION deletes tables for the specified dimensions from the current schema.
Syntax
DROP DIMENSION <dimensions> [ALL | REGULAR | STRUCTURED | UNSTRUCTURED | ATTRIBUTE]
Parameter <dimensions> ALL REGULAR STRUCTURED UNSTRUCTURED ATTRIBUTE Description One or more dimension names separated by commas. You can specify an asterisk character (*) to delete tables for all dimensions defined in the schema. Deletes tables for all dimensions in the schema. Deletes tables for dimensions that are not attribute or hierarchical attribute dimensions. Deletes tables for hierarchical attribute dimensions. Deletes tables for non-hierarchical attribute dimensions. Deletes tables for all attribute dimensions, regardless of whether they are hierarchical.
Remarks
You should run the DROP REFERENCES and DROP DATA commands before you use the DROP DIMENSION command to delete tables for dimensions in the schema. Alternatively, you can run the DROP SCHEMA command to delete the entire schema in a single step.
8.6
Use
DROP REFERENCES is a Hybrid OLAP SCHEMA subsystem command. DROP REFERENCES drops any Reference tables from the existing schema.
November 2011
465
Syntax
DROP REFERENCES
Remarks
You should use the DROP REFERENCES command to delete Reference tables from the schema, before selectively deleting other tables from the schema. Alternatively, you can run the DROP SCHEMA command to delete the entire schema in a single step.
8.7
Use
DROP SCHEMA is a Hybrid OLAP SCHEMA subsystem command. DROP SCHEMA deletes the current schema.
Syntax
DROP SCHEMA
Remarks
DROP SCHEMA deletes all the tables in the current schema without requesting user confirmation.
8.8
Use
DROP VARIABLE is a Hybrid OLAP SCHEMA subsystem command. DROP VARIABLE deletes the specified variables from the current schema.
Syntax
DROP VARIABLE <variables>
Parameter <variables> Description One or more variable names separated by commas. You can specify an asterisk (*) character to delete all variables defined in the schema.
Remarks
You should run the DROP REFERENCES, DROP DATA, and DROP DIMENSION commands before you issue the DROP VARIABLE command to drop variables from the schema. Alternatively, you can run the DROP SCHEMA command to delete the entire schema in a single step.
8.9
Use
EXPORT BASE is a Hybrid OLAP SCHEMA subsystem command. EXPORT BASE creates the relational tables in the schema that do not depend on specific dimension, variable, or data information. You can export the schema with time going across, or time going down. If you export the schema with time going down the columns in the fact tables, you have the flexibility to use the tables in other applications that also support this common format for their fact tables. Tip: Store time going down the table if you want to optimize the time it takes to load and consolidate data. Store time going across the table if you want to optimize end-user performance.
466
November 2011
Syntax
EXPORT BASE [ARRAYSIZE <number>] [INDEXSPACE <tablespace_name>] [NOANALYZE] [NOFOREIGNKEYS] [TABLESPACE <tablespace_name>] { TIME ACROSS [ V_CODE <text> ] [USENAMES ] | TIME DOWN <periodicity> <dateformat> NAME <colname> TIMETYPE <type>} } [UNRECOVERABLE] Parameter ARRAYSIZE <number> Description Specifies a number between 1 and 32,767 for the size of the array you want to transmit to and from the RDBMS during the consolidation process. If you do not specify an arraysize, rows are transmitted to and from the RDBMS in batches of 1,000.
INDEXSPACE <tablespace_name> Creates the indexes on the specified tablespace (Oracle or DB2). This allows you to distribute indexes across many disks. NOANALYZE For Oracle, the NOANALYZE keyword omits running the ANALYZE command to gather statistics for the cost-based optimizer. For DB2, the NOANALYZE
keyword omits running the RUNSTATS command to gather statistics for the cost based optimizer. Note: Use this option with care. It is important that the statistics on tables be kept up to date, since this is the basis on which the RDBMS decides how to execute queries. If statistics are not available, or out of date, this may lead to the RDBMS choosing poor execution plans for queries leading to poor performance.
NOFOREIGNKEYS Foreign key integrity constraints are not created. TABLESPACE <tablespace_name> Creates the base tables on the specified tablespace (Oracle or DB2). This allows you to distribute tables across many disks. TIME ACROSS V_CODE <text> USENAMES TIME DOWN Specifies that the schema will be exported with time going across the fact tables. This is the default setting. Uses the value of <text> as the column name for variables in fact tables instead of the word V_CODE when time is stored across the fact table. Uses short names instead of codes in fact tables. Specifies that the schema will be exported with time going down the fact tables. Specify a repeating clause of <periodicity> <dateformat> NAME <colname> TIMETYPE <datatype>, one for each different periodicity that is going to be present in fact tables. When you specify TIME DOWN, a new row is entered in the prefix_MASTER file that looks like this: MST_KEY TIME_ORIENTATION <periodicity> One of the following: Yearly Semiannual Quarterly Bimonthly Monthly Lunar Weekly Biweekly Daily <dateformat> <text> 12 months 6 months quarter 2 months month 28 days. Use this with a 13-month fiscal year only. week 2 weeks day Specifies that the TIME column contains all characters. Supplying a text string of XXX for example, means that the TIME column will be MST_SETTING DOWN
November 2011
467
<date>
TIMETYPE <type>
NUMBER(p,s)
Packed decimal fixed point data with s digits, p of which are to the right of the decimal point. Specify either NUMBER(p,s), NUMERIC(p,s), DECIMAL(p,s), or DEC(p,s). Hybrid OLAP accepts any keyword as the same and generates the appropriate data type for the target RDBMS. A fixed length character string using <n> bytes. A date string stored in the internal date format of the RDBMS. A date and time string stored in the internal date format of the RDBMS.
Oracle stores any numeric datatypes in packed decimal varying length data internally so SMALLINT, INTEGER, NUMBER(p,s), REAL, and FLOAT are all the same. If using DB2, all the datatypes apply. UNRECOVERABLE (Oracle) Create all indexes without line redo log writes.
Remarks
When you create a schema manually from the IDQL command line in Application Server, you must run the EXPORT BASE command before you can export dimensions, variables, or data. The EXPORT BASE command creates the following relational tables in the schema in the order shown: Master table Periodicities table Consolidations table Dimension Types table Dimensions table By Dimensions table
468
November 2011
Format table Variables table Notes: The time orientation is set by the first EXPORT command used. If you dont specify any keywords, then TIME ACROSS is used. If you use a TIME ACROSS or DOWN keyword on any other EXPORT command, the time set by the first command will be applied. If you use the EXPORT BASE command, you must then also use the EXPORT DIMENSION and EXPORT VARIABLES commands to export those components individually. If you already have fact tables, the datatypes and date formats should be set to match those which exist in those tables. Hybrid OLAP handles the information appropriately. If you are creating fact tables for the first time and you want to store time information going down the column, it is important to consider the appropriate datatypes and date format to use. You should choose a datatype and date format that leads to the simplest and most efficient SQL. For example choose an INTEGER datatype with a format YYMD or DATE or DATETIME. These datatypes result in simple SQL, which the RDBMS handles well. If you have date values in character columns with optional separators, when HOLAP has to query fact tables for data between two given dates, the SQL must use the RDBMS functions to translate the character strings to dates, which is extra work. It may also mean that the RDBMS cannot use an index on the fact table to its best advantage.
Syntax
EXPORT DATA { SELECTED | <variables> } [ARRRAYSIZE <number>] [COMMIT [EVERY] <rows>] [DATATYPE <datatype>] [DIRECTLOADPATH] [INDEXSPACE <tablespace_name>] [NOANALYZE] [NOFOREIGNKEYS] [NOSORT] [NTHREADS <number>] [UNRECOVERABLE] [TABLESPACE <tablespace_name>] Parameter SELECTED <variables> Description Exports the data currently selected in the Application Server database. One or more variable names separated by commas. You can also specify an asterisk character (*) to export data for all variables defined in an Application Server database. Specifies a number between 1 and 32,767 for the size of the array you want to transmit to and from the RDBMS during the consolidation process. If you do not specify an arraysize, rows are transmitted to and from the RDBMS in batches of 1,000. Determines that a SQL COMMIT command should be executed after a specified number of data rows have been read. May be added after the COMMIT keyword to improve readability. The number of rows after which a SQL COMMIT command should be executed when reading data. The default is 1000 rows.
ARRAYSIZE <number>
November 2011
469
FLOAT
8 bytes
NUMBER(p,s)
DIRECTLOADPATH
Invokes the Oracle SQL*Loader and uses the DIRECT load path to load fact tables, create the primary key, and populate any other indexes at table creation time.
INDEXSPACE <tablespace_name> Create the indexes on this tablespace (Oracle or DB2). Used with EXPORT DATA SELECTED, INDEXSPACE <tablespace_name> allows you to distribute indexes across many disks. NOANALYZE For Oracle, the NOANALYZE keyword omits running the ANALYZE command to gather statistics for the cost-based optimizer. For DB2, the NOANALYZE
keyword omits running the RUNSTATS command to gather statistics for the cost based optimizer. Note: Use this option with care. It is important that the statistics on tables be kept up to date, since this is the basis on which the RDBMS decides how to execute queries. If statistics are not available, or out of date, this may lead to the RDBMS choosing poor execution plans for queries leading to poor performance.
NOFOREIGNKEYS NOSORT Foreign key integrity constraints are not created. (Oracle) Normally Application Server will write out data to the RDBMS in
the order of any primary key in the table. By presenting data presorted to the RDBMS, index creation is faster in the RDBMS because the RDBMS does not have to presort data itself. Specify NOSORT if you do not want Application Server to presort, but instead have the RDBMS sort itself when creating an index.
NTHREADS <number> Allows you to run two processes at the same time when <number> is greater than 1. NTHREADS 2 allows one thread to carry out the Application Server and sgtrans processing and another thread to carry out the RDBMS processing concurrently. If you omit the NTHREADS keyword, or if you specify NTHREADS 1, only one process will occur at a time. For example, during an EXPORT DIMENSION or EXPORT DATA command, Application Server is reading dimensions members or time series respectively, collecting the information into batches of rows, and then sending a batch to the RDBMS for insertion into a dimension or fact table. In a single thread, Application Server has to wait while the RDBMS does the inserts before it prepares the next batch. If NTHERAD is set to 2 and two threads
470
November 2011
are running, Application Server can be preparing the next batch of rows to give to the RDBMS while the RDBMS is inserting the last batch of rows. Tip: On multiprocessor systems, using multiple threads concurrently should always improve throughput during reading and writing processes. On single processor systems, it may also improve throughput if a chunk of any elapsed time is I/O during which the CPU would otherwise be idle. TABLESPACE <tablespace_name> Create the tables on this tablespace (Oracle or DB2). Used with EXPORT DATA SELECTED, TABLESPACE <tablespace_name> allows you to distribute tables across many disks. UNRECOVERABLE (Oracle) Create all indexes without line redo log writes.
Remarks
When you create a schema manually from the IDQL command line in Application Server, you must run the EXPORT BASE, EXPORT VARIABLE, and EXPORT DIMENSION commands before you can export data. Alternatively, you can run the EXPORT SCHEMA command to execute these commands in a single step. The EXPORT DATA command creates the following tables: Tracker table Fact tables
Syntax
EXPORT DIMENSION [REGULAR|STRUCTURED|UNSTRUCTURED|ATTRIBUTE] [UNRECOVERABLE] <dimensions> [ALIAS <name>] [ARRAYSIZE <number>] [DIRECTLOADPATH] [INDEXSPACE <tablespace_name>] [NOANALYZE] [NOFOREIGNKEYS] [NOSORT] [NTHREADS <number>] [TABLESPACE <tablespace_name>] [USENAMES | CODETYPE <datatype> ] Parameter REGULAR STRUCTURED UNSTRUCTURED ATTRIBUTE <dimensions> Description Exports dimensions that are not attribute or hierarchical attribute dimensions. Exports only hierarchical attribute dimensions. Exports only non-hierarchical attribute dimensions. Exports all attribute dimensions, regardless of whether they are hierarchical. One or more dimension names separated by commas. You can specify an asterisk character (*) to export all dimensions defined in an Application Server database. (Oracle) Create all indexes without line redo log writes.
UNRECOVERABLE
November 2011
471
DIRECTLOADPATH
INDEXSPACE <tablespace_name> Create the indexes on this tablespace (Oracle or DB2). Used with EXPORT DIMENSION, INDEXSPACE <tablespace_name> allows you to distribute indexes across many disks. NOANALYZE For Oracle, the NOANALYZE keyword omits running the ANALYZE command to gather statistics for the cost-based optimizer. For DB2, the NOANALYZE
keyword omits running the RUNSTATS command to gather statistics for the cost based optimizer. Note: Use this option with care. It is important that the statistics on tables be kept up to date, since this is the basis on which the RDBMS decides how to execute queries. If statistics are not available, or out of date, this may lead to the RDBMS choosing poor execution plans for queries leading to poor performance.
NOFOREIGNKEYS NOSORT Foreign key integrity constraints are not created. (Oracle) Normally Application Server will write out data to the RDBMS in
the order of any primary key in the table. By presenting data presorted to the RDBMS, index creation is faster in the RDBMS because the RDBMS does not have to presort data itself. Specify NOSORT if you do not want Application Server to presort, but instead have the RDBMS sort itself when creating an index.
NTHREADS <number> Allows you to run two processes at the same time when <number> is greater than 1. NTHREADS 2 allows one thread to carry out the Application Server and sgtrans processing and another thread to carry out the RDBMS processing concurrently. If you omit the NTHREADS keyword, or if you specify NTHREADS 1, only one process will occur at a time. For example, during an EXPORT DIMENSION or EXPORT DATA command, Application Server is reading dimensions members or time series respectively, collecting the information into batches of rows, and then sending a batch to the RDBMS for insertion into a dimension or fact table. In a single thread, Application Server has to wait while the RDBMS does the inserts before it prepares the next batch. If NTHERAD is set to 2 and two threads are running, Application Server can be preparing the next batch of rows to give to the RDBMS while the RDBMS is inserting the last batch of rows. Tip: On multiprocessor systems, using multiple threads concurrently should always improve throughput during reading and writing processes. On single processor systems, it may also improve throughput if a chunk of any elapsed time is I/O during which the CPU would otherwise be idle. TABLESPACE <tablespace_name> Create the tables on this tablespace (Oracle or DB2). Used with EXPORT DIMENSION, TABLESPACE <tablespace_name> allows you to distribute tables across many disks. USENAMES CODETYPE <datatype> Uses short names instead of codes in fact tables. The USENAMES keyword sets D_USENAMES in the prefix_DIMENSIONS table. Specify the RDBMS datatype of the dimension column to control how to store codes in fact tables:
472
November 2011
SMALLINT INTEGER
2 bytes 4 bytes
A short integer between -32,768 and 32,767. A long integer between -2,147,483,648 and 2,147,483,647.
NUMBER(<p>,<s>) Packed decimal fixed point data with <p> digits, <s> of which are to the right of the decimal point. Specify either NUMBER(<p>,<s>), NUMERIC(<p>,<s>), DECIMAL(<p>,<s>), or DEC(p,s). Hybrid OLAP accepts any keyword as the same and generates the appropriate data type for the target RDBMS. CHAR(<n>) Notes: The CODETYPE keyword sets the D_DATATYPE in prefix_DIMENSIONS. Oracle stores any numeric datatypes in packed decimal varying length data internally so SMALLINT, INTEGER, NUMBER(p,s), REAL, and FLOAT are all the same. If using DB2, all the datatypes apply. A fixed length character string using <n> bytes. VARCHAR(<n>) A varying length character string using up to <n> bytes.
Remarks
When you create a schema manually from the IDQL command line in Application Server, you must run the EXPORT BASE command before you can export dimensions. The EXPORT DIMENSION command creates the following relational tables in the schema for each dimension specified: Dimension Levels table Dimension tables Notes: In Hybrid OLAP models, dimension names should be of no more than 17 characters. While using member names instead of codes makes the fact tables more readable, textual names in VARCHAR columns will normally take up more space than INTEGER columns or SMALLINT columns. Using the correct sized integral datatypes will usually save space and improve performance in all aspects.
Syntax
EXPORT MASTER [ARRAYSIZE <number>] [INDEXSPACE <tablespace_name>] [TABLESPACE <tablespace_name>]
Parameter ARRAYSIZE <number> Description Specifies a number between 1 and 32,767 for the size of the array you want to transmit to and from the RDBMS during the consolidation process. If you do not specify an arraysize, rows are transmitted to and from the RDBMS in batches of 1,000.
November 2011
473
Remarks
You can use the Table Parameters table to control placement of all schema tables except for the Master table and the Table Parameters table itself. Placement of the Master table and Table Parameters table can be controlled via the TABLESPACE and INDEXSPACE keywords on the EXPORT BASE command. If either the EXPORT BASE or EXPORT SCHEMA command is issued without a prior EXPORT MASTER command, the Table Parameters table will still be created, and will be populated with as many reasonable values as possible. However, explicit DBA control over many elements of the objects created during the schema export process is lost. Note: Although they have no Table Parameters table, schemas created with earlier versions of Hybrid OLAP will continue to work. However, you will not have the same degree of control over table size, placement, and privileges for new tables or indexes.
Syntax
EXPORT SCHEMA [ARRAYSIZE <number>] [DATA [COMMIT [EVERY] <rows>]] [INDEXSPACE <tablespace_name>] [NOANALYZE] [NOFOREIGNKEYS] [NOSORT] [NTHREADS <number>] [TABLESPACE <tablespace_name>] { TIME ACROSS [ V_CODE <text> ] [USENAMES ] | TIME DOWN <periodicity> <dateformat> NAME <colname> TIMETYPE <datatype>} } [UNRECOVERABLE] Parameter ARRAYSIZE <number> Description Specifies a number between 1 and 32,767 for the size of the array you want to transmit to and from the RDBMS during the consolidation process. If you do not specify an arraysize, rows are transmitted to and from the RDBMS in batches of 1,000. Exports all data from the Application Server database to the schema. Determines that a SQL COMMIT command should be executed after a specified number of data rows have been read. May be added after the COMMIT keyword to improve readability. The number or rows after which a SQL COMMIT command should be executed when reading data. The default is 250 rows.
474
November 2011
INDEXSPACE <tablespace_name> Create the indexes on this tablespace (Oracle or DB2). Used with EXPORT SCHEMA, INDEXSPACE <tablespace_name> allows you to distribute indexes across many disks. Note: The schema base tables are ignored by INDEXSPACE <tablespace_name>. NOANALYZE For Oracle, the NOANALYZE keyword omits running the ANALYZE command to gather statistics for the cost-based optimizer. For DB2, the NOANALYZE
keyword omits running the RUNSTATS command to gather statistics for the cost based optimizer. Note: Use this option with care. It is important that the statistics on tables be kept up to date, since this is the basis on which the RDBMS decides how to execute queries. If statistics are not available, or out of date, this may lead to the RDBMS choosing poor execution plans for queries leading to poor performance.
NOFOREIGNKEYS NOSORT Foreign key integrity constraints are not created. (Oracle) Normally Application Server will write out data to the RDBMS in
the order of any primary key in the table. By presenting data presorted to the RDBMS, index creation is faster in the RDBMS because the RDBMS does not have to presort data itself. Specify NOSORT if you do not want Application Server to presort, but instead have the RDBMS sort itself when creating an index.
NTHREADS <number> Allows you to run two processes at the same time when <number> is greater than 1. NTHREADS 2 allows one thread to carry out the Application Server and sgtrans processing and another thread to carry out the RDBMS processing concurrently. If you omit the NTHREADS keyword, or if you specify NTHREADS 1, only one process will occur at a time. For example, during an EXPORT DIMENSION or EXPORT DATA command, Application Server is reading dimensions members or time series respectively, collecting the information into batches of rows, and then sending a batch to the RDBMS for insertion into a dimension or fact table. In a single thread, Application Server has to wait while the RDBMS does the inserts before it prepares the next batch. If NTHERAD is set to 2 and two threads are running, Application Server can be preparing the next batch of rows to give to the RDBMS while the RDBMS is inserting the last batch of rows. Tip: On multiprocessor systems, using multiple threads concurrently should always improve throughput during reading and writing processes. On single processor systems, it may also improve throughput if a chunk of any elapsed time is I/O during which the CPU would otherwise be idle. TABLESPACE <tablespace_name> Create the tables on this tablespace (Oracle or DB2). Used with EXPORT SCHEMA, TABLESPACE <tablespace_name> allows you to distribute tables across many disks. Note: The schema base tables are ignored by TABLESPACE <tablespace_name>. TIME ACROSS Specifies that the schema will be exported with time going across the fact tables. This is the default setting. Tip: Store time going down the table if you want to optimize the time it takes to load and consolidate data. Store time going across the table if you want to optimize end-user performance. V_CODE <text> USENAMES TIME DOWN Uses the value of <text> as the column name for variables in fact tables instead of the word V_CODE when time is stored across the table. Uses short names instead of codes in fact tables. Specifies that the schema will be exported with time going down the fact tables. Specify a repeating clause of <periodicity> <dateformat> NAME <colname>
November 2011
475
ORDINAL
<date>
FLOAT
8 bytes
NUMBER(p,s)
Packed decimal fixed point data with s digits, p of which are to the right of the decimal point. Specify either NUMBER(p,s), NUMERIC(p,s), DECIMAL(p,s), or DEC(p,s). Hybrid OLAP accepts any keyword as the same and generates the appropriate data type for the target RDBMS.
476
November 2011
a fixed length character string using n bytes. a varying length character string using up to n bytes. A date string stored in the internal date format of the RDBMS. A date and time string stored in the internal date format of the RDBMS.
Note: Oracle stores any numeric datatypes in packed decimal varying length data internally so SMALLINT, INTEGER, NUMBER(p,s), REAL, and FLOAT are all the same. If using DB2, all the datatypes apply. UNRECOVERABLE (Oracle) Create all indexes without line redo log writes.
Remarks
You can use the EXPORT SCHEMA command to run the EXPORT BASE, EXPORT DIMENSION, and EXPORT VARIABLE commands in a single step. Using the DATA keyword is the same as executing the DUMP command from the Application Server database to the schema. Note: If you already have fact tables, the datatypes and date formats should be set to match those which exist in those tables. Hybrid OLAP handles the information appropriately. If you are creating fact tables for the first time and you want to store time information going down the column, it is important to consider the appropriate datatypes and date format to use. You should choose a datatype and date format that leads to the simplest and most efficient SQL. For example choose an INTEGER datatype with a format YYMD or DATE or DATETIME. These datatypes result in simple SQL, which the RDBMS handles well. If you have date values in character columns with optional separators, when HOLAP has to query fact tables for data between two given dates, the SQL must use the RDBMS functions to translate the character strings to dates, which is extra work. It may also mean that the RDBMS cannot use an index on the fact table to its best advantage.
Syntax
EXPORT SKELETON DIMENSION <dimensions> LEVELS <levels> OBSERVATIONS <observations>[ARRAYSIZE <number>] Parameter Description
DIMENSION <dimensions> One or more dimension names separated by commas. In Hybrid OLAP models, dimension names should be of no more than 17 characters. LEVELS <levels> Determines the dimension levels that should be created in the schema, based on a specified dimension level list.
OBSERVATIONS <observations> Determines the number of observations that you expect to maintain in the schema, based on a specified observations list. ARRAYSIZE <number> Specifies a number between 1 and 32,767 for the size of the array you want to transmit to and from the RDBMS during the consolidation process. If you do not specify an arraysize, rows are transmitted to and from the RDBMS in batches of 1,000.
Remarks
The settings you specify when you export a skeleton schema do not have to match the dimension and variable settings in the current Application Server database. This means that you can use the EXPORT SKELETON command to design a schema to your own requirements.
November 2011
477
Schema Subsystem Command Reference EXPORT VARIABLE (Schema) After you have run the EXPORT SKELETON command, you can create a new Application Server database and then use the IMPORT SCHEMA command to map the Application Server database to the schema.
Syntax
EXPORT VARIABLE <variables> [ALIAS <name>] [ARRAYSIZE <number>] [DATATYPE <datatype>] Parameter <variables> ALIAS <name> Description One or more variable names separated by commas. You can specify an asterisk character (*) to export all variables defined in an Application Server database. Uses the value for <name> as the fact column name rather than the variable name. Tip: By adding column names that are familiar to you in the fact tables, it is much easier to navigate through the fact tables in an ad hoc manner using SQL code. ARRAYSIZE <number> Specifies a number between 1 and 32,767 for the size of the array you want to transmit to and from the RDBMS during the consolidation process. If you do not specify an arraysize, rows are transmitted to and from the RDBMS in batches of 1,000. (Available only when you previously used the EXPORT BASE TIME DOWN command) Specifies the RDBMS datatype of the variable column in which the data is stored when time is stored down the column in fact tables. You can specify a datatype for variables only when you have initially used the EXPORT BASE command with the TIME DOWN keywords.
DATATYPE <datatype>
SMALLINT INTEGER
REAL
2 bytes 4 bytes
4 bytes
A short integer between -32,768 and 32,767. A long integer between -2,147,483,648 and 2,147,483,647.
A single-precision floating-point value with a range of 3.402823E38 to 1.401298E-45 for negative values, 1.401298E-45 to 3.402823E38 for positive values, and 0. A double-precision floating-point value with a range of 1.79769313486232E308 to 4.94065645841247E324 for negative values, 4.94065645841247E-324 to 1.79769313486232E308 for positive values, and 0.
FLOAT
8 bytes
NUMBER(p,s)
Packed decimal fixed point data with s digits, p of which are to the right of the decimal point. Specify either NUMBER(p,s), NUMERIC(p,s), DECIMAL(p,s), or DEC(p,s). Hybrid OLAP accepts any keyword as the same and generates the appropriate data type for the target RDBMS.
Notes: By default, the datatype is derived from the Application Server type. For example, if Sales is INTEGRAL BYTES 2 in Application Server, then EXPORT VARIABLE will put SMALLINT in V_DATATYPE. If Sales in Application Server is NU4, EXPORT VARIABLE will put REAL in V_DATATYPE. If you specify a DATATYPE, this value overrides the one set in Application Server for this variable.
478
November 2011
This value overrides the default written to the prefix_VARIABLES column V_DATATYPE to specify the data type to store period data in fact tables. Oracle stores any numeric datatypes in packed decimal varying length data internally so SMALLINT,INTEGER,NUMBER(p,s),REAL,FLOAT are all the same. If using DB2, all the datatypes apply.
Remarks
When you create a schema manually from the IDQL command line in Application Server, you must run the EXPORT BASE command before you can export variables. The EXPORT VARIABLE command inserts data into the following relational tables in the schema for each variable specified: By Dimensions table Format table Variables table Notes: While using member names instead of codes makes the fact tables more readable, textual names in VARCHAR columns will normally take up more space than INTEGER columns or SMALLINT columns. Using the correct sized integral datatypes will usually save space and improve performance in all aspects.
Use
IMPORT DATA is a Hybrid OLAP SCHEMA subsystem command that imports data defined in SAP NetWeaver BI into an existing Application Server database. Internally IMPORT DATA imports data for one variable at a time and generates an MDX statement for each one. IMPORT DATA only imports INPUT data (transaction data). If any single variable hits the 1 million limit barrier, the data for that variable will not be imported. IMPORT DATA fetches up to 1 million cells in any one MDX query. Importing BI cube data directly into an Application Server database is best used on small cubes. It is recommended for quick display times. If you want to display SAP NetWeaver BI data from larger InfoCubes, you must use the IMPORT DIMENSION, IMPORT TIME, IMPORT VARIABLES, and IMPORT QUERY VARIABLES commands to access the cube data without actually importing it into Application Server. By accessing the data without importing it, you retrieve and cache information about the cubes in the Application Server database while the data remains in the BI cube. See the Server Configuration Guide for SAP BusinessObjects Strategy Management located on SAP Service Marketplace to learn how to use this command.
Parameter * <variable> SELECTED PROGRESS <number> Description You can also specify an asterisk character (*) to import all data defined in the schema. Name of variable to import. Imports input data from the selected dimensions. By default, the IMPORT DATA command gives reassurance messages at every 10,000 rows read from the provider. Use PROGRESS <number> to change the number of rows processed before getting a reassurance message. You can turn off reassurance messages by setting PROGRESS 0 or by issuing a SET REASSURANCE OFF command.
November 2011
479
Syntax
IMPORT DIMENSION <dimensions> [REGULAR | STRUCTURED | UNSTRUCTURED | ATTRIBUTE] * | <names> [PREFACE <literal>]
Parameter <dimensions> REGULAR STRUCTURED UNSTRUCTURED ATTRIBUTE * or <names> PREFACE "<literal>" Description One or more dimension names separated by commas. You can also specify an asterisk character (*) to import all dimensions defined in the schema. Imports dimensions that are not attribute or hierarchical attribute dimensions. Imports only hierarchical attribute dimensions. Imports only non-hierarchical attribute dimensions. Imports all attribute dimensions, regardless of whether they are hierarchical. Imports all dimensions of the specified type, or a single named dimension. Prefaces the resultant dimension with the specified option. You must enclose the keywords in double quotation marks (" "). This option, followed by a quoted string, allows you to put anything in either a dimension or an attribute set. Valid options include: [KEY BOTH] [ALLOCATE [UPDATE] <input>, <output>, <result> ] For example, specifying the command: IMPORT DIMENSION PRODUCT PREFACE "ALLOCATE UPDATE 50,10,1" generates an ALLOCATE statement so that when you import the PRODUCT dimension, the database is not reorganized when the dimension changes. Additionally, within the literal string, you can specify FACTOR nPercent, where nPercent is a percentage growth factor to use where there is no ALLOCATE statement in the PREFACE string. If you do not specify a PREFACE string, or the PREFACE string does not include a FACTOR statement, a default factor of 25% is used.
Remarks
When you create dimensions in an Application Server database using the IMPORT DIMENSION command, the dimensions are automatically created and compiled. Any existing dimensions in the Application Server database that have the same name as the dimension being imported will be completely overwritten. See the Server Configuration Guide for SAP BusinessObjects Strategy Management located on SAP Service Marketplace to learn how to use this command.
480
November 2011
The IMPORT DIMENSION command will retrieve the meta data for BI characteristics from the target cube and create corresponding dimensions in Application Server. See the Server Configuration Guide for SAP BusinessObjects Strategy Management located on SAP Service Marketplace to learn how to use this command.
Syntax
IMPORT DIMENSION { * | { <dimension> [,<dimension>] ) [INCLUDING FISCAL] [RANGE <date1>-<date2>] [HIERARCHIES {ALL|DEFAULT}] [FORCE]
Parameter * Description Imports all dimensions defined in the schema. Use * if the raw InfoCube or
Query Cube has at most 12 dimensions excluding Time and excluding Navigational Attributes. You can use * if you created a Query Cube to eliminate some Characteristics if there were too many for Application Server. If you use the simple IMPORT DIMENSION * command then the IMPORT will automatically figure out what Navigational Attributes there are to import.
<dimension> One or more dimension names separated by commas. If you have a raw InfoCube that has more than 12 Characteristics, you could issue individual IMPORT DIMENSION commands to import just the dimensions you want to
use for analysis from the cube (and IMPORT at most 12 of those). Since in ODBO and OLAP BAPI the Navigational Attributes appear as Characteristics, you import Navigational Attributes into PAS Attributes this way too If you IMPORT them one at a time you should import the Characteristic first and the related Navigational Attributes afterwards.
INCLUDING FISCAL Includes fiscal information. RANGE <date1>-<date2> Specifies the date range to import from a Time characteristic. Use this as
an alternative to restricting unwanted dates from a Query cube by using restrictions in BEx Query Designer. If you do not supply any RANGE then Application Server implicitly works as if you had done a RANGE 1/1/1900-12/31/2099 and will ignore any date outside the years 1900 through 2099.
SPANS DERIVED Uses the values in the Time characteristic. This is the default setting. Allows you to specify how to determine the span of Measures in Application Server (i.e. the span you see when you do a SHOW VARIABLES in Application Server). The quickest way for Application Server to determine each Measures span is to use the span it sees in the master data entries for the Time characteristic it uses as the basis for the Time component in Application Server on the IMPORT TIME command. SPANS DERIVED gives the fastest IMPORT time. If the dates have not been restricted, it is common in a Time dimension to have a far greater span defined in the Time characteristic (ready for future data loads and to define rollups for future dates) than actually exists. Using the values seen in the Time characteristic would result in Application Server thinking that Measures had a much bigger span of data that they really do and causing it to allocate and use unnecessarily large arrays for time series. In this case, it would be better to have Application Server actually use MDX to query the real time span of Measures or Key Figures. This takes longer (particularly if there are many measures) but gives exact results for the Time spans. SPANS EXACT HIERARCHIES ALL Executes MDX for each measure to determine the exact spans. Imports all hierarchies. If you omit the HIERARCHIES keyword, then HIERARCHIES ALL is the default setting and all hierarchies are imported.
November 2011
481
cases limiting the hierarchies to the default and not importing all hierarchies can make the IMPORT command run much faster and produce much smaller Application Server databases.
FORCE
Forces an import even if the CUBES timestamps identifies that nothing has changed. Use FORCE when you think the caches in Application Server are out-of-date or incorrect.
Syntax
IMPORT SCHEMA
Remarks
Using IMPORT SCHEMA is the equivalent of executing IMPORT FISCAL, IMPORT DIMENSION, and IMPORT VARIABLES for all variables and dimensions defined in the schema. This makes it easy to populate an existing Application Server database from any schema that conforms to the Application Server Hybrid OLAP specifications. Note: When a fiscal calendar is already set and variable data exists, IMPORT SCHEMA will not execute the IMPORT FISCAL command. Instead, it will use the existing fiscal calendar.
Syntax
IMPORT SCHEMA [INCLUDING FISCAL] [RANGE <date1>-<date2>] [SPANS {DERIVED |EXACT}] [HIERARCHIES {ALL | DEFAULT }] [SYSVAR] [CHARACTERISTIC {0CALDAY|0CALMONTH|0CALQUARTER| 0CALWEEK|0CALYEAR}] [FORCE]
Parameter INCLUDING FISCAL Description Includes fiscal information.
RANGE <date1>-<date2> Specifies the date range to import from a Time characteristic. Use this as
482
November 2011
restrictions in BEx Query Designer. If you do not supply any RANGE then Application Server implicitly works as if you had done a RANGE 1/1/1900-12/31/2099 and will ignore any date outside the years 1900 through 2099.
SPANS DERIVED Uses the values in the Time characteristic. This is the default setting. Allows you to specify how to determine the span of Measures in Application Server (i.e. the span you see when you do a SHOW VARIABLES in Application Server). The quickest way for Application Server to determine each Measures span is to use the span it sees in the master data entries for the Time characteristic it uses as the basis for the Time component in Application Server on the IMPORT TIME command. SPANS DERIVED gives the fastest IMPORT time. If the dates have not been restricted, it is common in a Time dimension to have a far greater span defined in the Time characteristic (ready for future data loads and to define rollups for future dates) than actually exists. Using the values seen in the Time characteristic would result in Application Server thinking that Measures had a much bigger span of data that they really do and causing it to allocate and use unnecessarily large arrays for time series. In this case, it would be better to have Application Server actually use MDX to query the real time span of Measures or Key Figures. This takes longer (particularly if there are many measures) but gives exact results for the Time spans. SPANS EXACT HIERARCHIES ALL Executes MDX for each measure to determine the exact spans. Imports all hierarchies. If you omit the HIERARCHIES keyword, then HIERARCHIES ALL is the default setting and all hierarchies are imported.
HIERARCHIES DEFAULT Imports the default BI hierarchy from each BI characteristic. In some
cases limiting the hierarchies to the default and not importing all hierarchies can make the IMPORT command run much faster and produce much smaller Application Server databases. SYSVAR Specifies that the Time characteristic in the Query contains System Variables (with or without offsets) and refreshes the Time cache based on the actual current contents of the Time dimension members.
Specify CHARACTERISTIC with a keyword to specify which Time characteristic to use. Application Server only expects one Time characteristic and it
CHARACTERISTIC
Remarks
Using IMPORT SCHEMA is the equivalent of executing the following: IMPORT FISCAL IMPORT DIMENSION
November 2011
483
Schema Subsystem Command Reference IMPORT TIME (SAP NetWeaver BI Connector) IMPORT TIME IMPORT VARIABLE * IMPORT QUERY VARIABLES only for BEx Query Cubes This makes it easy to populate an existing Application Server database from any schema that conforms to the Application Server Hybrid OLAP specifications. Note: When a fiscal calendar is already set and variable data exists, IMPORT SCHEMA will not execute the IMPORT FISCAL command. Instead, it will use the existing fiscal calendar.
Syntax
IMPORT TIME [INCLUDING FISCAL] [RANGE <date1>-<date2>] [SPANS {DERIVED|EXACT}] [SYSVAR] [CHARACTERISTIC {0CALDAY|0CALMONTH|0CALQUARTER| 0CALWEEK|0CALYEAR}] [FORCE]
Parameter INCLUDING FISCAL Description Includes fiscal information.
RANGE <date1>-<date2> Specifies the date range to import from a Time characteristic. Use this as
an alternative to restricting unwanted dates from a Query cube by using restrictions in BEx Query Designer. If you do not supply any RANGE then Application Server implicitly works as if you had done a RANGE 1/1/1900-12/31/2099 and will ignore any date outside the years 1900 through 2099.
SPANS DERIVED Uses the values in the Time characteristic. This is the default setting. Allows you to specify how to determine the span of Measures in Application Server (i.e. the span you see when you do a SHOW VARIABLES in Application Server). The quickest way for Application Server to determine each Measures span is to use the span it sees in the master data entries for the Time characteristic it uses as the basis for the Time component in Application Server on the IMPORT TIME command. SPANS DERIVED gives the fastest IMPORT time. If the dates have not been restricted, it is common in a Time dimension to have a far greater span defined in the Time characteristic (ready for future data loads and to define rollups for future dates) than actually exists. Using the values seen in the Time characteristic would result in Application Server thinking that Measures had a much bigger span of data that they really do and causing it to allocate and use unnecessarily large arrays for time series. In this case, it would be better to have Application Server actually use MDX to query the real time span of Measures or Key Figures. This takes longer (particularly if there are many measures) but gives exact results for the Time spans. SPANS EXACT SYSVAR Executes MDX for each measure to determine the exact spans. Specifies that the Time characteristic in the Query contains System Variables (with or without offsets) and refreshes the Time cache based on the actual current contents of the Time dimension members.
484
November 2011
CHARACTERISTIC
Specify CHARACTERISTIC with a keyword to specify which Time characteristic to use. Application Server only expects one Time characteristic and it
Forces an import even if the CUBES timestamps identifies that nothing has changed. Use FORCE when you think the caches in Application Server are out-of-date or incorrect.
Remarks
Using IMPORT SCHEMA is the equivalent of executing IMPORT FISCAL, IMPORT DIMENSION, and IMPORT VARIABLES for all variables and dimensions defined in the schema. This makes it easy to populate an existing Application Server database from any schema that conforms to the Application Server Hybrid OLAP specifications. Note: When a fiscal calendar is already set and variable data exists, IMPORT SCHEMA will not execute the IMPORT FISCAL command. Instead, it will use the existing fiscal calendar.
Syntax
IMPORT VARIABLES { * | <variable> [,<variable>]}
Parameter * <variables> Description Imports all variables defined in the schema. One or more variable names separated by commas.
Remarks
When you create variables in an Application Server database using the IMPORT VARIABLES command, the variables are automatically created and assigned the Drillthru attribute. Any existing variables in the Application Server database that have the same name as the variables being imported need to be removed prior to issuing the IMPORT VARIABLES command.
November 2011
485
Schema Subsystem Command Reference IMPORT QUERY VARIABLES (SAP NetWeaver BI Connector) If you want to set properties like RATE, EXPENSE, UNITS, DECIMALS, WIDTH and whether the variable is to be time converted with SUM, FIRST, LAST, then following an IMPORT VARIABLES command you should issue SET VARIABLE commands.
Syntax
IMPORT VARIABLES { * | <variable> [,<variable>]} [FORCE]
Parameter * <variables> Description Imporst all variables defined in the schema. One or more variable names separated by commas.
Syntax
IMPORT QUERY VARIABLES [FORCE]
Parameter FORCE Description
Forces an import even if the CUBES timestamps identifies that nothing has changed. Use FORCE when you think the caches in Application Server are out-of-date or incorrect.
Syntax
PREFIX <prefix>
Parameter <prefix> Description The prefix used in the name of the relational table. The default value is Application Server.
486
November 2011
Remarks
Every relational schema that you create must have a prefix. The schema prefix must be of 5 or fewer bytes, and begin with an alphabetical character. If you have long dimension names (that is, dimension names of 10 or more characters, up to a maximum of 17), it is advisable to use a prefix shorter than 10 characters. The schema prefix is applied to all of the relational tables in a schema, and serves as a unique identifier. An underscore character (_) is used to separate the prefix from the rest of the relational table name. For example, if you set the prefix to DEMO before creating a schema, the Dimensions table in the schema would be named DEMO_DIMENSIONS. You can use a prefix to maintain more than one schema using the same Link source. For example, you could create two schemas in the same Oracle tablespace, one with the prefix DEMO1 and the other with the prefix DEMO2. The defined prefix is saved in the Work database. This means that unless you execute the EXIT CLEAR command when you leave Application Server, the prefix will persist across sessions. You can use the VIEW PREFIX command to display the currently defined prefix.
Syntax
SCHEMA
Remarks
You use the SCHEMA command to enter the SCHEMA subsystem where you can enter Hybrid OLAP commands. Enable Hybrid OLAP before attempting to enter the SCHEMA subsystem. Note: Once you have entered the SCHEMA subsystem, you will need to establish a Link connection to the relational database before you can perform Hybrid OLAP operations such as exporting an Application Server database to a schema. This can be done with the CONNECT command.
Syntax
SET LABEL <name> [DEFAULT | FROM <linkid> NAME <label> [LANGUAGE <language>] | SYNONYM <synonym>]
Parameter <name> DEFAULT FROM <linkid> NAME <label> Description The name of the dimension or variable to which the labels are to be applied. Switches back to standard Application Server long and short names for the specified dimension or variable. Defines the Link ID used to connect to the schema. The name of the label set to be used for the specified dimension or variable, as defined in the corresponding Reference table.
November 2011
487
Remarks
Alternative names are stored in Reference tables in the relational schema. Reference tables must be created by the user or the RDBMS database administrator.
Syntax
SET VARIABLE <variables> {FROM <linkid> PREFIX <prefix> | NOFROM}
Parameter <variables> FROM <linkid> PREFIX <prefix> NOFROM Description One or more variable names separated by commas. You can specify an asterisk character (*) to assign the Drillthru attribute to all variables. Defines the Link ID that should be used to connect to the schema. Defines the schema prefix. Removes the Drillthru attribute from the specified variables.
Syntax
SPY {[TERMINAL | <name> [;EXT]] | OFF}
Parameter TERMINAL <name> EXT OFF Description Displays the SQL output in the Application Server output window. The name of an Application Server set to which SQL output will be sent. Specifies that the Application Server set specified in <name> will be created external to the Application Server database. Indicates that SQL output is no longer to be sent to the specified destination.
Remarks
You can use the SPY command to view the SQL code generated by Application Server with Hybrid OLAP when performing operations such as exporting an Application Server database to a new schema. This provides a useful insight into how Hybrid OLAP operates.
488
November 2011
Syntax
TRACKER INSERT {<variables> | SELECTED} [DIRECTLOADPATH]
Parameter <variables> Description One or more variable names separated by commas. You can specify an asterisk character (*) to populate the Tracker table with any missing records for all combinations for all variables. Inserts the variable/dimension level combinations currently selected in the Application Server database. Invokes the Oracle SQL*Loader and uses the DIRECT load path to load fact tables, create the primary key, and populate any other indexes at table creation time.
SELECTED DIRECTLOADPATH
Remarks
Records inserted for input level combinations will be marked as base data in the RDBMS. Records inserted for output combinations will be marked as preconsolidated data in the RDBMS.
Syntax
TRIGGER {DISABLE | ENABLE | DROP | REPLACE} {DIMENSION | FACT | BOTH} {* | <list of table names>}
Parameter DISABLE Description Disables the trigger. For Oracle, this generates an ALTER TRIGGER DISABLE statement. The trigger is disabled, rather than dropped. The trigger is not executed upon subsequent INSERT, UPDATE, or DELETE statements until it is enabled again. ENABLE Re-enables the trigger. For Oracle, this generates an ALTER TRIGGERENABLE statement. Thereafter, the trigger will be fired again upon subsequent INSERT, UPDATE, or DELETE statements. Physically drops the trigger. TRIGGER DROP may be useful during the prototyping stage of model development, or in cases where you will never do any incremental consolidation. Replaces an existing trigger with an up-to-date version. Note: Triggers changed in version 6.1. Therefore, if you want to preserve existing schemas, you must manually issue the TRIGGER REPLACE BOTH * command when you upgrade from version 6.0. DIMENSION FACT BOTH Apply the TRIGGER command only to Dimension table triggers. Apply the TRIGGER command only to Fact table triggers. Apply the TRIGGER command to both Dimension and Fact table triggers.
DROP
REPLACE
November 2011
489
<list of table names> For Dimension table triggers, specify a list of table names. For Fact table triggers, specify a list of table names, including the prefix if necessary.
Remarks
To get the best performance out of initial data loads via the Transformer, disable triggers before the Transformer run, and re-enable them afterwards. That way, you avoid needlessly populating the Fact Delta table(s).
Syntax
VIEW CACHE
Syntax
VIEW CONNECTION
Remarks
The current active Hybrid OLAP connection is marked with an asterisk (*). A connection opened in the same session for other Hybrid OLAP access that is not the current Hybrid OLAP connection is marked with a plus sign (+). A connection opened with the Application Server ACCESS LSLINK command that is still open in this session is marked with neither symbol.
Syntax
VIEW DIMENSION <dimensions> [FULL]
Parameter <dimensions> Description One or more dimension names separated by commas. You can specify an asterisk character (*) to display information about all dimensions defined in the schema. Provides more detailed output.
FULL
490
November 2011
Syntax
VIEW PREFIX
Syntax
VIEW {CATALOGS | CUBES | DIMENSIONS | MEASURES | HIERARCHIES | LEVELS | MEMBERS | PROPERTIES | QUERY VARIABLES} ROWSET [FULL] [<Restriction>[,<Restriction>]]
Parameter FULL <restriction> Description Provides more detailed output. <restriction name> <restriction value>. Keywords and restriction names can be abbreviated to 3 characters.
Remarks
Each rowset also has a set of restriction columns (i.e. columns that you can specify values for to restrict the output to specific databases or cubes or dimensions). The following table shows the available restrictions for each rowset. SCHEMA_NAME is not supported in SAP NetWeaver BI and should not be used. Rowset CATALOGS CUBES DIMENSIONS MEASURES HIERARCHIES Restrictions CATALOG_NAME CATALOG_NAME SCHEMA_NAME CUBE_NAME CATALOG_NAME SCHEMA_NAME CUBE_NAME DIMENSION_NAME DIMENSION_UNIQUE_NAME CATALOG_NAME SCHEMA_NAME CUBE_NAME MEASURE_NAME MEASURE_UNIQUE_NAME CATALOG_NAME SCHEMA_NAME CUBE_NAME DIMENSION_UNIQUE_NAME HIERARCHY_NAME HIERARCHY_UNIQUE_NAME CATALOG_NAME SCHEMA_NAME CUBE_NAME DIMENSION_UNIQUE_NAME HIERARCHY_UNIQUE_NAME LEVEL_NAME LEVEL_UNIQUE_NAME CATALOG_NAME SCHEMA_NAME CUBE_NAME DIMENSION_UNIQUE_NAME HIERARCHY_UNIQUE_NAME LEVEL_UNIQUE_NAME LEVEL_NUMBER MEMBER_NAME MEMBER_UNIQUE_NAME MEMBER_CAPTION
LEVELS
MEMBERS
November 2011
491
Schema Subsystem Command Reference VIEW SPANS TYPE MEMBER_TYPE Tree operator PROPERTIES CATALOG_NAME SCHEMA_NAME CUBE_NAME DIMENSION_UNIQUE_NAME HIERARCHY_UNIQUE_NAME LEVEL_UNIQUE_NAME MEMBER_UNIQUE_NAME PROPERTY_NAME PROPERTY_TYPE
CATALOG_NAME SCHEMA_NAME CUBE_NAME
QUERY VARIABLES
A restriction is a single value that is compared for equality to the corresponding value in the schema rowset. Wildcards are not supported. Only rows that exactly match the restriction value in the corresponding column are returned in the rowset. So for example if you specify a restriction on CUBE_NAME being [$0D_SD_C03] then only rows from the rowset that have the CUBE_NAME column having the value [$0D_SD_C03] are returned. This is case sensitive in some ODBO providers like SAP NetWeaver BI and not in others (for MSAS it is not case sensitive). The values used in the restrictions must adhere to the ODBO naming conventions and you should enclose them in single quotes in the command line. Many of these rowsets will output huge amounts of information if you do not use restrictions. For example the MEMBERS rowset will output every Member (i.e. a Characteristic Value) for every Dimension (i.e. Characteristic) for every Cube if you add no restrictions.
Syntax
VIEW SPANS TYPE
Syntax
VIEW TIME RANGE
Syntax
VIEW SCHEMA [FULL]
Parameter FULL Description Provides more detailed output.
492
November 2011
Remarks
VIEW SCHEMA is the equivalent of running VIEW VARIABLE and VIEW DIMENSION for all variables and dimensions defined in the schema.
Syntax
VIEW SPY
Syntax
VIEW VARIABLE <variables> [FULL]
Parameter <variables> FULL Description One or more variable names separated by commas. You can specify an asterisk character (*) to display information about all variables defined in the schema. Provides more detailed output.
Syntax
DROP DATA
Remarks
You should use the DROP REFERENCES command to drop all Reference tables from the schema before deleting the Tracker table and Fact tables from the schema. Alternatively, you can run the DROP SCHEMA command to delete the entire schema in a single step.
Syntax
CONNECT <linkid>
November 2011
493
Syntax
IMPORT FISCAL
Remarks
You can view the schemas fiscal calendar information in the Master table.
Syntax
SQL <SQL_statement>
Parameter <SQL_statement> Description Any valid SQL statement except a SELECT.
Remarks
You must follow SQL commands with SQL COMMIT statements if they are required by your RDBMS.
Syntax
ORDER <dimension> ON <variable> [TOP <n> | BOTTOM <n>] SELECT DRILLTHRU { [ONLY] ABOVE <member> | BELOW <member> } { [JUST] ABOVE <member> | BELOW <member> } { [ONLY JUST] ABOVE <member> | BELOW <member> } [{MEMBER | LEVEL | INPUTS | OUTPUTS}] {AND LEVEL <n>] Parameter <dimension> ON <variable> Description Name of the dimension to order. Orders members from the member with the largest numeric value to the member with the smallest numeric value according to the specified expression.
494
November 2011
Orders just the top <n> selected members of the dimension. Orders just the bottom <n> selected members of the dimension. Automatically selects just the members being ordered. Selects the specified member and all the members in the path above it. If the dimension contains multiple hierarchies, <member> is a member in the currently set hierarchy. ABOVE selects the specified member and all the members in the same hierarchy above it. Name of one or more members, separated by commas. Selects the specified member and the member in the path directly above it. Selects all members in the path above the specified member, but not including the specified member. Selects only the member in the path directly above the specified member. Selects the specified member and all members in the path below it. Selects the specified member and the members directly below it. Selects all members in the path below the specified member, but not including the specified member. Selects only the members in the path directly below the specified member. A level name or level number.
<member> JUST ABOVE ONLY ABOVE ONLY JUST ABOVE BELOW JUST BELOW ONLY BELOW ONLY JUST BELOW LEVEL
Remarks
Before including the DRILLTHRU keyword, the ORDER command [TOP n | BOTTOM n] keyword must be specified. In addition, when the DRILLTHRU keyword is used, the Application Server SELECT command becomes part of the ORDER DRILLTHRU statement, rather than coming before it on a separate line as in non-drillthrough models. If there is nothing after DRILLTHRU, the whole dimension is used. Note: See Application Server online Help command reference for a full description of the ORDER command.
November 2011
495
9
9.1
To see the entire schema map, you may need to scroll the Help window.
496
November 2011
9.2
Use
Consolidations Table
The Consolidations table defines an identifier that determines the source of time series data to Application Server, and how that data should be consolidated.
Format
The Consolidations table is named prefix_CONSOLIDATIONS, where prefix is the name of the schema prefix. The Consolidations table consists of the following columns:
Column cons_type cons_desc Description The unique code for a specific consolidation type. The description for a specific consolidation type.
Remarks
You use the Consolidations table to determine whether time series data should be stored in Application Server directly, or stored externally in the RDBMS, and whether data should be preconsolidated or consolidated dynamically. Typically, you would store preconsolidated data values for the most frequently accessed time series data. Look at the NHITS column of the Tracker table to determine which data users access most frequently. The cons_type column is used as a foreign key in the Tracker table, which determines where data is stored and how it should be consolidated. The contents of the Consolidations table are fixed, and will normally be generated by Application Server as part of the export process.
9.3
Use
Fact Tables
Fact tables are where the actual time series data is stored. Data for some time series may span across several Fact tables.
Format
Fact tables are named prefix_FACT_extension, where prefix is the name of the schema prefix, and extension is a system-generated value based on the variable data stored in the Fact table. Each Fact table consists of the following columns:
Column v_code m_dim Description The unique code for a specific Application Server variable, as defined in the Variables table. Fact tables include a single column for each structural dimension in the Application Server database. These columns are named m_dim, where dim is the name of the dimension to which the column relates. For example, an Application Server database with dimensions Product, Region, and Type would have corresponding columns in each of its Fact tables named m_product, m_region, and m_type. The row values in each column represent a specific dimension member, as defined by the m_code for the member in the corresponding Dimension table. p1-pn These columns represent the individual time periods in Application Server. If data for a variable is stored monthly, each column represents data for a single month. The number of time period columns in a Fact table is defined by the corresponding nobs value in the Tracker table. The start_date value in the Tracker table defines the start date for data in the p1 column in the Fact table.
November 2011
497
Remarks
Each row in a Fact table represents the data for a variable and specific dimension member combination. For example, the Actual number of Units for 386sx Chips in Phoenix could be stored in a single row. The number of observations held for this data would determine whether the data could be stored in a single Fact table, or whether it had to be spanned over several Fact tables. The export process will automatically create and populate the Tracker table and Fact tables and Application Server will have to make assumptions about how to store the data. Ideally, these default settings should be reviewed by the database administrator, to ensure that data is being stored in the most appropriate place, and that it is being consolidated in a way that will maximize performance.
9.4
Use
Format
The Fact Delta tables are named prefix_FACT_extension_D, where prefix is the name of the schema prefix, and extension is a system-generated value based on the variable data stored in the Fact table. Each Fact Delta table consists of the following columns:
Column v_code m_dim Description The unique code for a specific Application Server variable, as defined in the Variables table. The Fact tables include a single column for each structural dimension in the Application Server database. These columns are named m_dim, where dim is the name of the dimension to which the column relates. For example, an Application Server database with dimensions Product, Region, and Type would have corresponding columns in each of its Fact tables named m_product, m_region, and m_type. The row values in each column represent a specific dimension member, as defined by the m_code for the member in the corresponding Dimension table. p1-pn These columns represent the individual time periods in Application Server. If data for a variable is stored monthly, each column represents data for a single month. The number of time period columns in a Fact table is defined by the corresponding nobs value in the Tracker table. The start_date value in the Tracker table defines the start date for data in the p1 column in the Fact table.
Remarks
There is one Fact Delta table for each Fact table in the schema. Fact Delta tables are not populated until changes are made.
9.5
Use
The Dimension Types table defines whether an Application Server dimension is a structural dimension, structural attribute, or unstructured attribute.
Format
The Dimension Types table is named prefix_DIM_TYPES, where prefix is the name of the schema prefix. The Dimension Types table consists of the following columns:
498
November 2011
Description The unique code for a specific Application Server dimension type. The description for a specific Application Server dimension type.
Remarks
The d_type column becomes a foreign key in the Dimensions table. The contents of this table are fixed and will normally be generated by Application Server.
9.6
Use
Dimensions Table
The Dimensions table stores the names and types of Application Server dimensions.
Format
The Dimensions table is named prefix_DIMENSIONS, where prefix is the name of the schema prefix. The Dimensions table consists of the following columns:
Column d_name d_type d_by_dim NO_GUESTS=char Description The name of an Application Server structural or attribute dimension. The unique code for a specific Application Server dimension type, as defined in the Dimension Types table. The name of the structural dimension to which an attribute applies. This column is only applicable when d_name specifies the name of an attribute dimension. char is any non-zero character. The user will not have the ability to do anything that will cause the dimension in Application Server to differ from the dimension in the schema. An IMPORT will always use the whole dimension. There will never be any guest members in the Application Server dimension. Application Server does not need to go to the RDBMS tables to retrieve dimension members. Application Server will ignore the MAX_GUEST_LEVEL. If NO_GUESTS is a character value of 0 or NULL, the dimension in Application Server is not guaranteed to be the whole dimension. There may be guest members. Application Server will take the MAX_GUEST_LEVEL setting into account. MAX_GUEST_LEVEL=n Specify a value for n. The dimension in Application Server is created via a view which did SELECT * FROM prefix_dimname WHERE M_LEVEL > n. Typically, the dimension in Application Server just excludes the inputs. In this case, Application Server can work out when it needs to go to the RDBMS and when it can do it without. If MAX_GUEST_LEVEL = NULL, the dimension in Application Server is not created from a view which just did SELECT * FROM prefix_dimname WHERE M_LEVEL > n. Members of a single level may be split between the RDBMS and Application Server. In this case Application Server will always have to check the RDBMS for dimension members. The EXPORT command will export a dimension and set NO_GUESTS = 1, MAX_GUEST_LEVEL = 0. The Transformer will determine how many rows are inserted into a dimension table. If there are fewer than 100K, it will make the settings just like the EXPORT command did. If there are more than 100K members, it will set NO_GUESTS = 0, MAX_GUEST_LEVEL = NULL. When the user creates views and imports dimensions, the MAX_GUEST_LEVEL setting should be updated based on the view to ensure the best performance when retrieving dimension members.
Remarks
The d_type column becomes a foreign key in the Dimension Types table. It is used by the IMPORT and EXPORT commands in Application Server to determine structural dimensions, structural attributes, and unstructured attributes. For structural attributes, the d_by_dim column specifies the
November 2011
499
Schema Table Reference Dimension Tables dimension that Application Server uses to create a BY DIMENSION clause. For unstructured attributes, d_by_dim specifies the dimension for which the attribute applies. Note: In Hybrid OLAP models, dimension names should be of no more than 17 characters.
9.7
Use
Dimension Tables
The Dimension tables define the members of an Application Server dimension, and the hierarchical relationship between these members. There is a Dimension table for each Application Server structural dimension, together with a corresponding Dimension Levels table.
Format
The Dimension tables are named prefix_dimension, where prefix is the name of the schema prefix, and dimension is the name of an Application Server dimension. Each Dimension table consists of the following columns:
Column m_code m_level d_datatype Description The unique code for an Application Server dimension member. The unique code for an Application Server dimension level, as defined in the corresponding Dimension Levels table for the dimension. The datatype of the dimension column in the fact tables. D_DATATYPE can be any one of the strings TINYINT, SMALLINT, INTEGER (the default), NUMBER(n), VARCHAR(n), CHAR(n). If VARCHAR or CHAR is used, then the m_code is used in character format - this option is provided since a CHAR(1) column will occupy less space than a NUMBER column in Oracle. If D_USENAMES is any non 0 value, then all the fact table will have member names instead of member codes for the corresponding dimension. (the default is 0). If D_USENAMES is set, then the value in D_DATATYPE is ignored. The datatype used in the fact tables will always be VARCHAR(24) to correspond to allowed names in Application Server. If D_ALIAS has a non null value that string is used as the fact column name instead of m_dimname in the fact tables. The m_code of the parent of the Application Server dimension member. The m_level of the parent of the Application Server dimension member. The short name for the Application Server dimension member. The m_code of the parent of the Application Server dimension member. The m_code of the grandparent of the Application Server dimension member. The m_code for each successive level of the Application Server dimension member. A dimension can have up to 20 levels; the maximum value for n is 18. The long name for the Application Server dimension member. The uppercase version of m_label.
d_usenames
Remarks
The m_code is used in the Fact tables to find the time series for a given variable and dimension member combination. You can use the p_code and p_level columns to define the hierarchy within the dimension. If required p3_code and p4_code columns can be defined to describe more complex hierarchies. For unstructured attributes with no hierarchy, you can use a simpler version of the Dimension table which excludes the hierarchy data stored in the p_code and p_level columns. Dimension calculations (such as the subtraction typically found in Type dimensions) are not supported in the schema. Any dimension to be exported to a schema must be usable in the
500
November 2011
Application Server Rollup editor. Additionally, multiple hierarchies are not supported in the Dimension tables. Note: In Hybrid OLAP models, dimension names should be of no more than 17 characters.
9.8
Use
Format
The Dimension Delta tables are named prefix_dimension_D, where prefix is the name of the schema prefix, and dimension is the name of an Application Server dimension. Each Dimension table consists of the following columns:
Column change_date change_type m_code m_level p_code p_level m_name p1_code p2_code m_label Description The date and time that the change was made. The kind of change that occurred. Possible values are I (Input), U (Update), or D (Delete). The unique code for an Application Server dimension member. The unique code for an Application Server dimension level, as defined in the corresponding Dimension Levels table for the dimension. The m_code of the parent of the Application Server dimension member. The m_level of the parent of the Application Server dimension member. The short name for the Application Server dimension member. The m_code of the grandparent of the Application Server dimension member. The m_code of the great-grandparent of the Application Server dimension member. The long name for the Application Server dimension member.
Remarks
There is one Dimension Delta table for each Dimension table in the schema. Dimension Delta tables are not populated until the dimension is changed.
9.9
Use
By Dimensions Table
The By Dimensions table stores a unique code for combinations of Application Server dimensions. The purpose of this code is to save storage in other tables.
Format
The By Dimensions table is named prefix_BY_DIM, where prefix is the name of the schema prefix. The By Dimensions table consists of the following columns:
Column by_dim_code dim_list Description The unique code for a specific combination of Application Server dimensions. The description for a specific combination of Application Server dimensions.
Remarks
The contents of the by_dim_code column are normally generated by the RDBMS sequence generator. For example, several variables in the DEMO database are dimensioned by Product, Region, and Type, while several others are dimensioned by Product and Type.
November 2011
501
Schema Table Reference Periodicities Table The by_dim_code column is a foreign key in the Variables table. That enables the dimensions upon which each variable depends to be stored as a single value in the Variables table, rather than as a list of dimensions for each variable. The description of dimension combinations stored in the dim_list column is limited to 256 characters.
Format
The Periodicities table is named prefix_PERIODICITIES, where prefix is the name of the schema prefix. The Periodicities table consists of the following columns:
Column pdy_code pdy_name Description The unique code for a specific Application Server periodicity. The description for a specific Application Server periodicity.
Remarks
Other tables (such as the Variables table) use the pdy_code column of the Periodicities table to reduce storage where periodicity is required. In such cases, pdy_code becomes a foreign key constraint in those tables. Note: The HOURLY periodicity is no longer supported.
Format
The Master table is named prefix_MASTER, where prefix is the name of the schema prefix. The Master table consists of the following columns:
Column mst_key mst_setting Description Unique name for each setting stored in the Master table. The value of the setting.
Remarks
When you issue the EXPORT SCHEMA, EXPORT BASE, or EXPORT SCHEMA DATA commands, the text defining the fiscal calendar is automatically written to the Master table. Fiscal calendar information may span several rows, in which case the names stored in the mst_key column will be FISCAL, FISCAL1, FISCAL2...FISCALn. When you issue the IMPORT SCHEMA command, fiscal calendar information will only be updated if no variable data already exists in the Application Server model.
502
November 2011
Format
The Month Names table is named prefix_MONTH_NAMES, where prefix is the name of the schema prefix. The Month Names table consists of the following columns:
Column month_code month_name Description A number between 1 and 12 that represents the month. (1=January, 2=February, and so on.) A text string. For example, Jan for January.
Remark
When you issue an EXPORT command, this table is filled with default values using the locale in effect at the time the EXPORT command is run.
Format
The Day Names table is named prefix_DAY_NAMES, where prefix is the name of the schema prefix. The Day Names table consists of the following columns:
Column day_code day_name Description A number between 1 and 7 that represents the day of week. (1=Sunday, 2=Monday, and so on.) A text string for the day of week. For example, SUN for Sunday.
Remark
When you issue an EXPORT command, this table is filled with default values using the locale in effect at the time the EXPORT command is run.
November 2011
503
Format
The Format table is named prefix_FMT, where prefix is the name of the schema prefix. The Format table consists of the following columns:
Column fmt_code fmt_string Description The unique code for a specific Application Server format specification. The description for a specific Application Server format specification.
Remarks
The fmt_code column is a foreign key in the Variables table. This common format enables you to store specifications as a single value in the Variables table, rather than as a repeating list for each variable. The contents of the fmt_code column would usually be generated by the RDBMS sequence generator.
Format
The Period Format table is named prefix_PERIOD_FORMAT, where prefix is the name of the schema prefix. The Period Format table consists of the following columns:
Column PDY_CODE PDY_FORMAT Description Foreign key into the prefix_PERIODICITIES (PDY_CODE). The mask to use in generating the column names. Formats can be myy, ymd, yymd, dmyy, dmy, mdyy, mdy, ydm, yydm, yym, my, or ym, NUMERIC, or TEXT. Month can be used in place of m to specify a Month name. START_PERIOD Textual date as a base date. If supplied for literal strings in PDY_FORMAT, and if 2 years of monthly data is split as one year in one table and the next year in a different table and a literal MONTHNUMBER is supplied, then instead of both tables having columns names MONTHNUMBER1...MONTHNUMBER12, the first year will have MONTHNUMBER1...MONTHNUMBER12, and the second will have MONTHNUMBER13...MONTHNUMBER24.
Format
The Variables table is named prefix_VARIABLES, where prefix is the name of the schema prefix. The Variables table consists of the following columns:
Column v_code v_name v_alias Description The unique code for a specific Application Server variable. The short name for the Application Server variable. The alias name for the Application Server variable.
504
November 2011
V_datatype
Contains one of these values: TINYINT, SMALLINT, INTEGER, NUMBER(n), REAL, FLOAT, NUMBER(n,m). This column is used to determine the datatype of each variable in fact tables. For example, if V_DATATYPE is REAL for SALES, then fact tables containing SALES data will have period columns of type REAL. When you do an EXPORT VARIABLES command, the datatype is derived from the Application Server type, eg if SALES is INTEGRAL BYTES 2 in Application Server, then EXPORT will put SMALLINT in V_DATATYPE, but if SALES in Application Server is NU4 EXPORT will put REAL in V_DATATYPE. You can override this by explicitly putting a datatype on the EXPORT command line (see below). The unique code for a specific Application Server periodicity, as defined in the Periodicities table. The start period of the earliest observation for the Application Server variable. The number of observations stored. The Application Server time conversion code, abbreviated to the first character. Permitted values are F (First), L (Last), A (Average), S (Sum), and W (Weighted). The unique code for a specific combination of Application Server dimensions, as defined in the By Dimensions table. The unique code for a specific Application Server format specification, as defined in the Format table. This table is optional. The long name for the Application Server variable. Boolean flag corresponding to the Application Server Rate variable characteristic. Boolean flag corresponding to the Application Server Units variable characteristic. Boolean flag corresponding to the Application Server Expense variable characteristic. The v_code of the variable by which the variable is weighted. This column is only applicable when tc_code specifies the W (Weighted) Application Server time conversion code. The logic field is populated for Application Server virtual variables. It contains the logic to calculate the virtual variable. Can have a value of 0 or 1. Corresponds to the INTEGRAL option in the Application Server CREATE VARIABLE command. Indicates that the data is stored as integers instead of double precision, so that 1, 2, or 4 bytes per data value are used instead of 8. Can have a value of 0 or 1. Corresponds to the SPARSE option in the Application Server CREATE VARIABLE command. Indicates the variable contains many consecutive, identical values for the time series. Can have a value of 1, 2, 4, or 8. Corresponds to the BYTES option in the Application Server CREATE VARIABLE command. Specifies the number of bytes to use per data value. The default number of bytes per data value is 8 (double precision), which allows 15 digits of precision. This field is not currently used. Can have a value of TINYINT, SMALLINT, INTEGER, NUMBER (p,s), REAL, or FLOAT, corresponding to the RDBMS datatypes that can be used to store data in Fact tables.
pdy_code start_period nobs tc_code by_dim_code fmt_code v_label rate units expense v_w_code
logic integral
sparse
bytes
v_datatype
Note: Currently, all data columns in Fact tables created by the EXPORT command have a datatype of FLOAT. v_description Defines the descriptions to associate with the variables, where description is the text that describes the variable. Empty single quotation marks (' ') remove any previously set description. Corresponds to the Application Server SET VARIABLE DESCRIPTION command. Application Server displays the descriptions in the output from a SHOW VARIABLE command.
Remarks
The v_code for the variable will normally be generated by the RDBMS sequence generator. It is used throughout the Tracker table and Fact table to locate time series data for a variable.
November 2011
505
Schema Table Reference Dimension Levels Table The format of start_period can be in any date format accepted by Application Server. The combination of start_period and nobs is what you see in Application Server for the number of observations and date range when you issue the SHOW VARIABLE command.
Format
The Dimension Levels tables are named prefix_LEVELS_dimension, where prefix is the name of the schema prefix, and dimension is the name of an Application Server dimension. Each Dimension Levels table consists of the following columns:
Column m_level l_name n_members Description The unique code for an Application Server dimension level. The description for an Application Server dimension level. The number of members in the level.
Remarks
The value of m_level is used for integrity checking in the Dimension tables, Tracker table, and Fact tables. Note: In Hybrid OLAP models, dimension names should be of no more than 17 characters.
Format
The Tracker table is named prefix_TRACKER, where prefix is the name of the schema prefix. The Tracker table consists of the following columns:
Column v_code l_dim Description The unique code for a specific Application Server variable, as defined in the Variables table. The level in the dimension, where dim is the name of an Application Server dimension. The number of these columns corresponds to how many structural dimensions there are in the Application Server database. The values in this column relate to the dimension levels defined in the Dimension Levels table. The unique code for a specific consolidation type, as defined in the Consolidations table. The number of times that this variable and level combination has been accessed. The value is updated automatically by Application Server. The number of actual time series present for this variable and level combination. The value is updated automatically by Application Server. A Boolean flag indicating whether a Tracker table row has been marked for consolidation by the database administrator in the Partitions view. The Partitions view appears in the Application Server List tab when you click on the Partitions node of the schema you are using.
506
November 2011
cons_type_new
The new consolidation type code for a specific row in the Tracker table when this is changed by the database administrator in the Partitions view. The Partitions view appears in the Application Server List tab when you click on the Partitions node of the schema you are using. The values in this column relate to the consolidation types defined in the Consolidations table. The date and time on which data for this variable was last updated. This value is used to determine when data needs to be updated. The minimum access time (in seconds) taken to retrieve this data. The maximum access time (in seconds) taken to retrieve this data. The total access time (in seconds) taken to retrieve this data. The start period of the first column of data in the Fact table in which data is stored for this Application Server variable. If the data for this variable is stored in multiple Fact tables, additional start_period columns will be created in the Tracker table. The number of observations stored for this variable in the specified Fact table. If the data for this variable is stored in multiple Fact tables, additional nobs columns will be created in the Tracker table. The name of the Fact table in which data is stored for this Application Server variable. If the data for this variable is stored in multiple Fact tables, additional t_name columns will be created in the Tracker table.
nobs
t_name
Remarks
The Tracker table is normally created and populated when you export a schema. If the Tracker table will be created manually by a database administrator, this table must be created before any access to the schema is possible. The data in the nhits column can help you decide where data is best stored, and how it is best consolidated. If data is being consolidated dynamically and the database administrator notices that the data is being accessed frequently, system performance could be improved by preconsolidating the data. Conversely, if preconsolidated data has a low hit count, it probably does not need to be preconsolidated. The nrows column counts the number of actual time series present for this variable/level combination. It is used in dynamic consolidation to determine the best point from which to begin aggregation. The start_period, nobs, and t_name columns form a set of columns that can be repeated if the specified time series data cannot be stored in a single Fact table. If this is the case, three new columns named start_period1, nobs1, and t_name1 are created to store the start date, number of observations, and table name of the second Fact table in which data is stored. Further columns named start_period2, nobs2, and t_name2 may need to be created if the data spills over to a third Fact table, and so on.
Format
The Reference tables are named prefix_REF_dimension, where prefix is the name of the schema prefix, and dimension is the name of an Application Server dimension. Each Reference table consists of the following columns:
November 2011
507
language label1
Remarks
Reference tables are optional, and are not automatically generated. They must be created by the user or the RDBMS database administrator. You can define up to 248 alternative labels for a Hybrid OLAP dimension for each language you want to include. Specify the v_code in place of the m_code if you are defining labels for a variable. You can combine the unique member code (the m_code or v_code) with a language key to implement multiple language dependent labels.
Format
The Attribute tables are named prefix_ATT_attribute, where prefix is the name of the schema prefix, and attribute is the name of an Application Server attribute. Each Attribute table consists of the following columns:
Column m_code a_code Description The unique code for an Application Server dimension member. The unique code for an Application Server attribute.
Remarks
The a_code specified for attributes in the Attribute table corresponds to the m_code specified for the attribute in the corresponding Dimension table.
508
November 2011
Format
Table Parameter tables are named prefix_TABLE_PARAMS, where prefix is the name of the schema prefix. Each Table Parameters table for Oracle consists of the following columns; when the values are NULL, it takes the default setting that applies to the default tablespace or system-wide setting:
Column Description
The name of the table to which these parameters apply. This is the primary key. The tablename consists of the simple name of the table, excluding any owner extension. For example, MKTING.PROMO_PERIODICITIES appears in the Table Parameters table as PROMO_PERIODICITIES. The tablename column may also contain the following wildcard characters: * A wildcard for all base tables not explicitly mentioned.
F* A wildcard for all Fact tables not explicitly mentioned. T* A wildcard for all temporary tables. DATA_PCTFREE The PCTFREE value for the data segment. Note: When you expect considerable update activity in a table, specify a large PCTFREE value to reserve room for future row growth. If you do not expect a table to be updated or have rows deleted, you can specify a value of zero to conserve disk space. DATA_PCTUSED DATA_INITRANS The PCTUSED value for the data segment. The default is 40%. The INITRANS for the data segment. This specifies the initial number of transaction entries allocated within each data block allocated to the table. The value can range from 1 to 255 and defaults to 1. Note: In general, changing the INITRANS value from its default is not recommended. DATA_MAXTRANS The MAXTRANS for the data segment. Note: Changing the MAXTRANS value from its default is not recommended. DATA_TABLESPACE VARCHAR(20) DATA_INITIAL The name of the tablespace on which to place the data segment. If you omit this option, Oracle creates the table in the default tablespace of the user creating the table or index. The size of the first database extent in bytes. The data_initial column can take a value (for example, 2046) or a string (for example, 2K or 5M). The size of the next database extent in bytes. The data_next column can take a value (for example, 2046) or a string (for example, 2K or 5M). The MINEXTENTS for the data segment. The default is one extent. The MAXEXTENTS for the data segment. The default is 121 on both Windows NT and UNIX. The PCTINCREASE value for the data segment.
DATA_NEXT
November 2011
509
DATA_FREELISTS
The FREELISTS value for the data segment. For objects other than tablespaces, FREELISTS specifies the number of free lists for each of the free list groups for the table, cluster, or index. The default (and minimum value) for this parameter is one, meaning that each free list group contains one free list. Note: The maximum value for this parameter depends on the data block size. If you specify a FREELISTS that is too large, Oracle7 returns an error message indicating the maximum value.
DATA_FREELIST_GROUPS
The FREELIST_GROUPS value for the data segment. For objects other than tablespaces, FREELIST_GROUPS specifies the number of groups of free lists for a table, cluster, or index. The default (and minimum value) for this parameter is one. Note: Use this parameter only if you are using Oracle7 with the Parallel Server option in parallel mode.
DATA_OPTIMAL
The OPTIMAL value for the data segment. The data_optimal column can take a value (for example, 2046) or a string (for example, 2K or 5M). The default degree of parallelism for the table in future queries. The data_parallel_degree column can take a value (for example, 5) or the string DEFAULT. The default number of parallel instances for the table for future queries. The data_parallel_instances column can take a value (for example, 5) or the string DEFAULT. The CACHE setting for the data segment. An entry of NULL or 0 means NOCACHE; otherwise, CACHE is in effect. The partition clause(s) to apply when the CREATE TABLE command is run, for Oracle8 only. The data_partition column can contain a text string of up to 2,000 characters. Note: The field is ignored for Oracle7, and if it contains a NULL entry. INITRANS for the index. MAXTRANS for the index. The tablespace in which to create any indexes.
DATA_PARALLEL_DEGREE
The initial size of the table in bytes. The index_initial column can take a value (for example, 2046) or a string (for example, 2K or 5M). The initial size of the table in bytes. The index_next column can take a value (for example, 2046) or a string (for example, 2K or 5M). The MINEXTENTS value for the index. The MAXEXTENTS for the index. The index_maxextents column can take a value (for example, 121) or the string UNLIMITED. The PCTINCREASE value for the index. The FREELISTS value for the index.
INDEX_NEXT
INDEX_MINEXTENTS INDEX_MAXEXTENTS
INDEX_PCTINCREASE INDEX_FREELISTS
510
November 2011
INDEX_FREELIST_GROUPS INDEX_OPTIMAL
The FREELIST_GROUPS value for the index. The OPTIMAL value for the index. The index_optimal column can take a value (for example, 2046), or a string (for example, 2K), or NULL. Specifies what percentage of each index page to leave as free space when building the index. The first entry in a page is added without restriction. When additional entries are placed in an index page at least integer percent of free space is left on each page. The value of integer can range from 0 to 99. However, if a value greater than 10 is specified, only 10 percent free space will be left in non-leaf pages. The default is 10.
INDEX_PCTFREE DECIMAL(3,0)
INDEX_UNRECOVERABLE
Indicates whether to create the index as UNRECOVERABLE. Using this keyword makes index creation faster than using the RECOVERABLE option because redo log entries are not written. An entry of NULL or 0 means no; otherwise, YES. The default degree of parallelism to create the index. The index_parallel_degree column can take a value (for example, 5) or the string DEFAULT. The default number of parallel instances for the table for future queries. The index_parallel_instances column can take a value (for example, 5) or the string DEFAULT. The partition clause(s) to apply when the CREATE INDEX or ALTER TABLE ADD PRIMARY KEY commands are run, for Oracle8 only. The index_partition column can contain a text string of up to 2,000 characters. Note: The field is ignored for Oracle7, and if it contains a NULL entry. Comma-separated list of users/groups to grant ALL privileges to. Comma-separated list of users/groups to grant ALTER privileges to. A comma-separated list of users/groups to grant INSERT privileges to. Comma-separated list of users/groups to grant REFERENCES privileges to. Comma-separated list of users/groups to grant SELECT privileges to. Comma-separated list of users/groups to grant UPDATE privileges to. 0 or 1. Default is 0. Specifies whether to give GRANT ALL WITH GRANT OPTION. An entry of NULL or 0 means no; otherwise, YES. 0 or 1. Default is 0. Specifies whether to give GRANT ALTER WITH GRANT OPTION. An entry of NULL or 0 means no; otherwise, YES. 0 or 1. Default is 0. Specifies whether to give GRANT DELETE WITH GRANT OPTION. An entry of NULL or 0 means no;
INDEX_PARALLEL_DEGREE
INDEX_PARALLEL_INSTANC ES INDEX_PARTITION
GRANT_ALL VARCHAR(250) GRANT_ALTER VARCHAR(250) GRANT_INSERT VARCHAR(250) GRANT_REFERENCES VARCHAR(250) GRANT_SELECT VARCHAR(250) GRANT_UPDATE VARCHAR(250) GRANT_ALL_WGO DECIMAL(1,0) GRANT_ALTER_WGO DECIMAL(1,0) GRANT_DELETE_WGO DECIMAL(1,0)
November 2011
511
Schema Table Reference Table Parameters Table Reference otherwise, YES. A null value or zero means no; otherwise, yes. GRANT_INDEX_WGO DECIMAL(1,0) GRANT_INSERT_WGO DECIMAL(1,0) GRANT_REFERENCES_WG O DECIMAL(1,0) GRANT_SELECT_WGO DECIMAL(1,0) GRANT_UPDATE_WGO DECIMAL(1,0) NO_FOREIGN_KEYS DECIMAL(1,0) 0 or 1. Default is 0. Specifies whether to give GRANT INDEX WITH GRANT OPTION. An entry of NULL or 0 means no; otherwise, YES. 0 or 1. Default is 0. Specifies whether to give GRANT INSERT WITH GRANT OPTION. An entry of NULL or 0 means no; otherwise, YES. 0 or 1. Default is 0. Specifies whether to give GRANT REFERENCES WITH GRANT OPTION. An entry of NULL or 0 means no; otherwise, YES. 0 or 1. Default is 0. Specifies whether to give GRANT SELECT WITH GRANT OPTION. An entry of NULL or 0 means no; otherwise, YES. 0 or 1. Default is 0. Specifies whether to give GRANT UPDATE WITH GRANT OPTION. An entry of NULL or 0 means no; otherwise, YES. 0 or 1. Default is 0. Specifies whether to omit creating foreign keys on the table. Corresponds to the NOFOREIGNKEYS schema keyword in Application Server. An entry of NULL or 0 means no; otherwise, YES. 0 or 1. Default is 0. Specifies whether to issue an ANALYZE TABLE on the table after its loaded. Corresponds to the NOANALYZE schema keyword in Application Server. An entry of NULL or 0 means issue the ANALYZE TABLE; otherwise, do not.
NO_ANALYZE
Remarks
Whenever Hybrid OLAP creates a new table or index, it reads the Table Parameters table to see if the Database Administrator (DBA) has provided any extra information about how or where to create it. If relevant information is included in the Table Parameters table, Hybrid OLAP will use it; otherwise, wherever possible, Hybrid OLAP will estimate and create the object with a reasonable size. If the DBA has not specified in the Table Parameters table which tablespace to put the object on, but has supplied a TABLESPACE or INDEXSPACE keyword to an EXPORT or CONSOLIDATE PENDING (Schema) command, Hybrid OLAP will use the tablespace or indexspace specified in the keyword. If no placement details are given in either the Table Parameters table or these keywords, then the object will be placed in the users default tablespace. For more information about the database parameters that can be set in the Table Parameters table, see the Oracle System Administrators Guide. For more information about Oracle8 partitioning, see the Oracle8 Reference Manual. Notes: Because the Table Parameters table can control the creation of the other base tables in the schema, it has to be created prior to, and independent of, them. This is done through the SCHEMA subsystem EXPORT MASTER command. Issue the EXPORT MASTER command before issuing the EXPORT BASE or EXPORT SCHEMA commands if you want to maintain this level of control. If the EXPORT BASE or EXPORT SCHEMA command is issued without a prior EXPORT MASTER command, the Table Parameters table will still be created, and will be populated with as many reasonable values as possible. However, explicit Database Administrator control over many elements of the object created during the schema export process is lost.
512
November 2011
Schemas created in Hybrid OLAP versions prior to 6.1 do not contain a Table Parameters table. These schemas may still be used; however, you cannot control table placement, size, or privileges when new tables and indexes are created. The format of the Table Parameters table differs significantly for Oracle and DB2.
The user accesses the table as mytable, but internally there are four subtables. Note that the partition statement:
partition by range(name) ( partition part1 values less than ('F') tablespace Kathy pctfree 10 storage(initial 100k nect 100k), partition part2 values less than ('N') , partition part3 values less than ('T') tablespace Jay, partition part4 values less than (MAXVALUE) tablespace Peter)
is held in the data_partition column in the Table Parameters table in Hybrid OLAP.
November 2011
513
Schema Table Reference Table Parameters Table Reference If required, the subtables can be accessed and maintained individually via SQL. The following example queries just subtable part3 and returns names beginning with N through S:
select * from mytable partition (part3)
Note that you can apply tablespace and storage details to each subtable separately. The following example creates a partitioned index broken down by the same criteria as the parent table (indicated by the local keyword) and specifies storage details for each subindex:
create index myindex on mytable(name) local ( partition part1 tablespace tom storage (initial 20k), partition part4 storage (minextents 10))
The subindex details are optional, so the partition clause could simply be just local. Note that the partition statement:
local ( partition part1 tablespace tom storage (initial 20k), partition part4 storage (minextents 10))
is held in the index_partition column in the Table Parameters table in Hybrid OLAP. Where you want subdivision by more than one column, you put a list of column names in the range clause, and range values in the values less than clause in the same order. In Hybrid OLAP, the obvious way to use this is to partition by V_CODE in the Tracker and Fact tables, since V_CODE forms the leading part of the primary key in both; in Dimension tables, M_CODE is a suitable candidate.
9.21.3
...This example shows how the user might implement partitioning in ...Hybrid OLAP using the Juice database as an example. Note that for ...clarity, this example does not include tablespace and storage ...clauses; obviously, in a real implementation, the Database ...Administrator would certainly include those as well. prefix XXX EXPORT BASE ...modify the Table Parameters table for large dimensions sql update xxx_table_params set data_partition = 'partition by range(v_code) (partition part1 values less than (11),partition part2 values less than (21), partition part3 values less than (31), partition part4 values less than (MAXVALUE))' where tablename = 'XXX_PRODUCT' sql update xxx_table_params set index_partition = 'local' where tablename='XXX_PRODUCT' sql commit EXP DIM * EXP VAR * ...modify the Table Parameters table for the Tracker table sql update xxx_table_params set data_partition = 'partition by range(v_code) (partition part1 values less than (3),partition part2 values less than (9), partition part3 values less than (12), partition part4 values less than (MAXVALUE))' where tablename = 'XXX_TRACKER'
514
November 2011
sql update xxx_table_params set index_partition = 'local' where tablename='XXX_TRACKER' sql commit TRACKER INS * ...modify the Table Parameters table for the Fact tables sql update xxx_table_params set data_partition = 'partition by range(v_code) (partition part1 values less than (3),partition part2 values less than (9), partition part3 values less than (12), partition part4 values less than (MAXVALUE))' where tablename = 'XXX_FACT_3_18' sql update xxx_table_params set index_partition = 'local' where tablename='XXX_XXX_FACT_3_18' sql commit EXP DATA *
9.21.4
Use
The (DB2) Table Parameters table contains columns that control the properties, placement, and GRANT privileges to be used whenever you create a Hybrid OLAP table. By editing these parameters, you can control how and where Hybrid OLAP creates the rest of the schema tables and indexes. Additionally, you can set the size for each table and index, and specify privileges for other database users on the objects you create.
Format
Table Parameter tables are named prefix_TABLE_PARAMS, where prefix is the name of the schema prefix. Each Table Parameters table for DB2 consists of the following columns; when the values are NULL, it takes the default setting that applies to the default tablespace or system-wide setting:
Column Description
The name of the table to which these parameters apply. This is the primary key. The tablename consists of the simple name of the table, excluding any owner extension. For example, MKTING.PROMO_PERIODICITIES appears in the Table Parameters table as PROMO_PERIODICITIES. The tablename column may also contain the following wildcard characters: * A wildcard for all base tables not explicitly mentioned.
F* A wildcard for all Fact tables not explicitly mentioned. T* A wildcard for all temporary tables. DATA_TABLESPACE VARCHAR(20) DATA_PCTFREE DECIMAL(3,0) The tablespace in which you create the table. Specifies the percentage of each data page to leave as free space when inserting rows into the table. The value of integer can range from 0 to 99. The default is 0. This table parameter is only used when using the LOAD or REORGANIZE TABLE utilities in DB2. Standard methods of inserting rows into tables ignore this setting completely and fill as many rows into each data block as possible. Hybrid OLAP can use the LOAD facility via a DB2 API when the
November 2011
515
Schema Table Reference Table Parameters Table Reference DIRECTLOAD keyword is used in EXPORT and the Hybrid OLAP transformer. REORGANIZE TABLE can only be run from within the DB2 CLP environment. INDEX_CLUSTER DECIMAL(1,0) O or 1 whether to create the primary key index as CLUSTERED or NON CLUSTERED (the default is 0). The cluster factor of a clustering index is maintained or improved dynamically as data is inserted into the associated table, by attempting to insert new rows physically close to the rows for which the key values of this index are in the same range. Only one clustering index may exist for a table so CLUSTER may not be specified if it was used in the definition of any existing index on the table (SQLSTATE 55012). A clustering index may not be created on a table that is defined to use append mode (SQLSTATE 428D8). This is likely to be expensive on large tables which have frequent INSERT/DELETE operation. The tablespace in which to create any indexes. Note: DB2 only allows you to place indexes for a table on a different tablespace than the tablespace where the table data resides if you are using DMS (Database managed Tablespaces). If you are using SMS (System Managed Tablespaces), DB2 mandates that the index must be on the same tablespace as the table data. If you specify INDEX_SPACE to be different than DATA_TABLESPACE, you will receive DB2 errors when Hybrid OLAP tries to create the index. Also DB2 only allows the specification of an index tablespace with an explicit data tablespace. Hybrid OLAP code will ignore any setting in INDEX_TABLESPACE if DATA_TABLESPACE is NULL. Specifies what percentage of each index page to leave as free space when building the index. The first entry in a page is added without restriction. When additional entries are placed in an index page at least integer percent of free space is left on each page. The value of integer can range from 0 to 99. However, if a value greater than 10 is specified, only 10 percent free space will be left in non-leaf pages. The default is 10. Indicates whether indexes are reorganized online and the threshold for the minimum percentage of space used on an index leaf page If after a key is deleted from an index leaf page, the percentage of space used on the page is at or below integer percentage, an attempt is made to merge the remaining keys on this page with those of a neighboring page. If there is sufficient space on one of these pages, the merge is performed and one of the pages is deleted. The value of integer can be from 0 to 99. However, a value of 50 or below is recommended for performance reasons. Specifies that an index can support both forward and reverse scans; that is, in the order defined at INDEX CREATE time and in the opposite (or reverse) order. Value is 0 or 1. The default is 0. GRANT_ALL VARCHAR(250) GRANT_ALTER Comma-separated list of users/groups to grant ALL privileges to. Comma-separated list of users/groups to grant ALTER
INDEX_TABLESPACE VARCHAR(20)
INDEX_PCTFREE DECIMAL(3,0)
INDEX_MINPCTUSED DECIMAL(3,0)
516
November 2011
VARCHAR(250) GRANT_CONTROL VARCHAR(250) GRANT_DELETE VARCHAR(250) GRANT_INDEX VARCHAR(250) GRANT_INSERT VARCHAR(250) GRANT_REFERENCES VARCHAR(250) GRANT_SELECT VARCHAR(250) GRANT_UPDATE VARCHAR(250) GRANT_ALL_WGO DECIMAL(1,0) GRANT_ALTER_WGO DECIMAL(1,0) GRANT_CONTROL_WGO DECIMAL(1,0) GRANT_DELETE_WGO DECIMAL(1,0) GRANT_INDEX_WGO DECIMAL(1,0) GRANT_INSERT_WGO DECIMAL(1,0) GRANT_REFERENCES_WG O DECIMAL(1,0) GRANT_SELECT_WGO DECIMAL(1,0) GRANT_UPDATE_WGO DECIMAL(1,0) NO_FOREIGN_KEYS DECIMAL(1,0) NO_INITIAL_LOGGING DECIMAL(1,0)
privileges to. Comma-separated list of users/groups to grant CONTROL privileges to. Comma-separated list of users/groups to grant DELETE privileges to. Comma-separated list of users/groups to grant INDEX privileges to. Comma-separated list of users/groups to grant INSERT privileges to. Comma-separated list of users/groups to grant REFERENCES privileges to. Comma-separated list of users/groups to grant SELECT privileges to. Comma-separated list of users/groups to grant UPDATE privileges to. 0 or 1. Default is 0. Specifies whether to give GRANT ALL WITH GRANT OPTION. An entry of NULL or 0 means no; otherwise, YES. 0 or 1. Default is 0. Specifies whether to give GRANT ALTER WITH GRANT OPTION. An entry of NULL or 0 means no; otherwise, YES. 0 or 1. Default is 0. Specifies whether to give GRANT CONTROL WITH GRANT OPTION. An entry of NULL or 0 means no; otherwise, YES. 0 or 1. Default is 0. Specifies whether to give GRANT DELETE WITH GRANT OPTION. An entry of NULL or 0 means no; otherwise, YES. 0 or 1. Default is 0. Specifies whether to give GRANT INDEX WITH GRANT OPTION. An entry of NULL or 0 means no; otherwise, YES. 0 or 1. Default is 0. Specifies whether to give GRANT INSERT WITH GRANT OPTION. An entry of NULL or 0 means no; otherwise, YES. 0 or 1. Default is 0. Specifies whether to give GRANT REFERENCES WITH GRANT OPTION. An entry of NULL or 0 means no; otherwise, YES. 0 or 1. Default is 0. Specifies whether to give GRANT SELECT WITH GRANT OPTION. An entry of NULL or 0 means no; otherwise, YES. 0 or 1. Default is 0. Specifies whether to give GRANT UPDATE WITH GRANT OPTION. An entry of NULL or 0 means no; otherwise, YES. 0 or 1. Default is 0. Specifies whether to omit creating foreign keys on the table. An entry of NULL or 0 means no; otherwise, YES. 0 or 1. Default is 0. Specifies whether to create the table with NOT LOGGED INITIALLY. An entry of NULL or 0 means no;
November 2011
517
Schema Table Reference Table Parameters Table Reference otherwise, YES. Any changes made to the table by an Insert, Delete, Update, Create Index, Drop Index, or Alter Table operation in the same unit of work in which the table is created are not logged. All catalog changes and storage-related information are logged, as are all operations that are done on the table in subsequent units of work. A foreign key constraint cannot be defined on a table that references a parent with the NOT LOGGED INITIALLY attribute This can be used to improve performance on loading the table with conventional inserts etc and is similar to the UNRECOVERABLE option we use in Oracle. This applies only to the table and not the index. Foreign keys are not allowed on such a table as a parent table since the contents are not logged and therefore unsafe if the database were rolled back, the foreign key integrity constraint could not be maintained. Therefore this option must be ignored on most of out tables if foreign keys are created. It is most useful for fact tables. NO_RUNSTATS DECIMAL(1,0) 0 or 1. Default is 0. Specifies whether to omit doing a RUNSTATS on a table after it is loaded with rows. The RUNSTATS command is a CLP command that gathers the statistics required by the Query Optimizer to decide how best to execute a query.
Remarks
Whenever Hybrid OLAP creates a new table or index, it reads the Table Parameters table to see if the Database Administrator (DBA) has provided any extra information about how or where to create it. If relevant information is included in the Table Parameters table, Hybrid OLAP will use it; otherwise, wherever possible, Hybrid OLAP will estimate and create the object with a reasonable size. If the DBA has not specified in the Table Parameters table which tablespace to put the object on, but has supplied a TABLESPACE or INDEXSPACE keyword to an EXPORT or CONSOLIDATE PENDING (Schema) command, Hybrid OLAP will use the tablespace or indexspace specified in the keyword. If no placement details are given in either the Table Parameters table or these keywords, then the object will be placed in the users default tablespace. Notes: Because the Table Parameters table can control the creation of the other base tables in the schema, it has to be created prior to, and independent of, them. This is done through the SCHEMA subsystem EXPORT MASTER command. Issue the EXPORT MASTER command before issuing the EXPORT BASE or EXPORT SCHEMA commands if you want to maintain this level of control. If the EXPORT BASE or EXPORT SCHEMA command is issued without a prior EXPORT MASTER command, the Table Parameters table will still be created, and will be populated with as many reasonable values as possible. However, explicit Database Administrator control over many elements of the object created during the schema export process is lost. Schemas created in Hybrid OLAP versions prior to 6.1 do not contain a Table Parameters table. These schemas may still be used; however, you cannot control table placement, size, or privileges when new tables and indexes are created. The format of the Table Parameters table differs significantly for Oracle and DB2.
518
November 2011
10
November 2011
519
Hybrid OLAP Reference Topics Maintaining Your Environment EXHIBIT COUNT dimensionname DRILLTHRU looks in the schema. The counts for the inputs, outputs, and results refer to the numbers in the schema. These counts disregard the dimension as it appears in Application Server. EXHIBIT COUNT dimensionname DRILLTHRU BYLEVEL looks in the schema to give the number of external levels and the number of external members at each level. These counts disregard the dimension as it appears in Application Server.
520
November 2011
can define any number of labels for a given dimension member, enabling easy support for multilingual labels. Reference tables are optional, and are not automatically generated. They must be created by the user or the RDBMS database administrator. The SQL format to create a Reference table is as follows, for a prefix MYPREFIX and a dimension PRODUCT:
CREATE TABLE MYPREFIX_REF_PRODUCT AS (M_CODE INTEGER PRIMARY KEY,LANGUAGE CHAR VARYING(n), ALTNAME1 CHAR VARYING(n1), ALTNAME2 CHAR VARYING(n2), . . ALTNAMEx CHAR VARYING(nx), CONSTRAINT some_name M_CODE REFERENCES MYPREFIX_PRODUCT(M_CODE))
where n, n1, n2,...nx are widths that you determine. ALTNAME is a placeholder here; and may be replaced by more descriptive names. LANGUAGE is a column that can contain user-defined language strings, such as FR or FRA or FRENCH. However, by default, Hybrid OLAP looks for EN for English. The contents of the LANGUAGE column must be in upper-case. For example, in a Reference table for PRODUCT with columns MYNAMES1, MYNAMES2, and MYNAMES3, and languages of EN and FR, the Hybrid OLAP command
SET LABEL PRODUCT FROM MYLINKID PREFIX MYPREFIX NAME MYNAMES2
will use the column MYNAMES2 for language EN in the Reference table to get the labels to use in displays in Application Server. The Hybrid OLAP command
SET LABEL PRODUCT FROM MYLINKID PREFIX MYPREFIX NAME MYNAMES3 LANGUAGE FR
will get the labels from Reference table column MYNAMES3 where the LANGUAGE column is FR.
November 2011
521
Hybrid OLAP Reference Topics Maintaining Your Environment When working storage (and thus the Work database) is likely to be large, you should specify an alternate Work database, create it as a partitioned database, and give it enough space to handle the model. To estimate the maximum amount of space you need for your Work database, apply the following formula:
((number of periods in current SET PERIOD) + 2) * 8 * X * Y
where X is the maximum number of rows for a variable/level combination. For example, suppose that you have most existing data for SALES and you have 3 dimensions A, B, and C, each with 3 levels with (1000,10,1), (2000,20,1), and (3000,30,1) members at each level respectively. You estimate that approximately 10% of all possible combinations exist. In this case, the value of X could be as large as
((1000*20*30) + (2000*10*30) + (3000*10*20)) * 0.1
or 180K. Y is a safety factor with a suggested value of 2. This takes into account internal rollups of consolidated combinations into multiple parent combinations. In the example here, if we have 24 periods, then the Work database could grow to approximately 75MB. You should take the estimate created with this formula into account when you create the alternate Work database.
522
November 2011
split Fact table data by time and variable across multiple disks, using your own criteria based on the structure of your data, your analysis needs, and your system. For example, if you have multiple time periods and several years worth of data, Hybrid OLAP might place all of the data into a single Fact table by default. However, if you have determined that you will need to access the last 12 months worth of data more often, you might decide to place that data into one Fact table, and the rest into a second, "history" Fact table. The majority of subsequent queries will run faster. To split fact data manually, you do not have to physically create any of the partition tables. After populating the Tracker table with rows for the variable and level combinations, and before any Fact tables are created, update the Tracker table to reflect your chosen partitioning scheme. To split the fact data across many smaller RDBMS tables, add additional rows using your RDBMSs SQL utility, and update the rows with different table names for different combinations. When a CONSOLIDATE PENDING or CALCULATE takes place, the Tracker table rows are used to determine where to put the data. If a combination is marked to be stored in the RDBMS, the table names (by time and combination) that you supplied are used. Where those tables do not already exist, they are created for you, together with indexes.
10.2.6 Recommended Settings & Memory for Optimal HOLAP Performance (Oracle)
When carrying out a sort to disk, the following should be considered: For Oracle, try to give the RDBMS more memory for sorting by adjusting the init.ora parameter SORT_AREA_SIZE, which determines the number of bytes each process can use for sorting. It is recommended that the temporary tablespace or (tempdb) is located on a different physical disk to the tablespace or segment from the table itself, in order to reduce disk contention. Try to create the index on a different tablespace or segment and on a different physical disk to both the temporary sort space and the table being sorted. Placing each component on a different disk reduces disk contention, takes advantage of multiple disk caches, and provides a degree of parallelism.
10.2.7 Recommended Settings and Memory for Optimal HOLAP Performance (DB2)
When carrying out a sort to disk, the following should be considered: For DB2, memory used for sorting is governed by two system parameters: Sort Heap Threshold (sheapthres) which is an instance setting. Sort Heap Size (sortheap) which is a database specific setting. These parameters are documented in the DB2 Administrator's Guide. The default value for sortheap allows 1MB for sorting. This amount should be enough for most of our queries, but the database administrator may want to monitor this and make sortheap higher if appropriate. It is recommended that the temporary tablespace or (tempdb) is located on a different physical disk to the tablespace or segment from the table itself, in order to reduce disk contention. The default system temporary tablespace is TEMPSPACE1. To use GLOBAL TEMPORARY TABLES, the user must also create a user temporary tablespace. This should be on a separate physical disk to the other tablespaces if possible.
November 2011
523
Hybrid OLAP Reference Topics Maintaining Your Environment Try to create the index on a different tablespace or segment and on a different physical disk to both the temporary sort space and the table being sorted. Placing each component on a different disk reduces disk contention, takes advantage of multiple disk caches, and provides a degree of parallelism. You can only do this in DB2 if you are using DB2 DATABASE MANAGED TABLESPACS (DMS tablespaces). If you place tables on SYSTEM MANAGED TABLESPACES (SMS tablespaces), then DB2 mandates that the tables and all its indexes reside in the same tablespace.
524
November 2011
When you specify DIRECTLOAD, HOLAP runs Sql*Loader and invokes it with DIRECT=TRUE. When it creates any Dimension or Fact tables, the primary key and any other indexes are created when the tables are created, rather than at the end of the processing when all the rows have been loaded, which allows the Sql*Loader to populate the indexes faster. The DIRECTLOAD keyword is ignored if HOLAP is not going to do pure inserts on a Fact table, for example, if you specify CONSOLIDATE PENDING DIRECTLOAD SALES where the Fact table already contains existing rows for SALES.
method
As Sql*Loader is a command line program, the input data is normally expected to be in files. When FILES is specified, the data will be written to files in the specified temp directory. If the processing is successful and there are no errors, these files will be deleted automatically (unless LEAVE=1). If you specify FILES, you will require extra disk space to store those files, and processing will be slower than using a pipe. Specify PIPES to use a named pipe to transfer data to Sql*Loader, which is faster and uses much less disk space than FILES. size is the number of bytes to use as a buffer for the named pipe. On Windows NT, a buffer of 256K should be sufficient. On UNIX, the maximum size is platformdependent. If size is not specified, a default value of 32K is used. is the number of rows Sql*Loader will insert before carrying out an internal save (similar to a COMMIT). A value of 1,000,000 may be appropriate. At present, by default, an internal save is not carried out until all rows have been inserted into the table. For more information, refer to the Oracle documentation.
rows
November 2011
525
11
Transformer
526
November 2011
Transformer
; Dimension load with source data in relational [customer_sql] Loading=Dimension Schema=lss Table=customer
November 2011
527
Transformer Parameter File Reference LinkIDSource=orasource SourceSQL=select CUSTOMER, CUSTOMERNA, DISTRICT, DISTRICTNA, REGION, REGIONNA from customer Format=Delimited TAB LinkIDTarget=holap Result=Yes Truncate=Yes Trace=No
; Match fields returned from RDBMS with levels and labels in dimension Level1=CUSTOMER Level2=DISTRICT Level3=REGION Label1=CUSTOMERNA Label2=DISTRICTNA Label3=REGIONNA
; Dimension load with source data in flat file [customer_text] Loading=Dimension Schema=lss Table=customer InputFile=customer.txt Format=Delimited, Delimiter=" LinkIDTarget=holap Result=Yes ; Change Truncate to No after initial load to add dimension members Truncate=Yes Trace=No
; Describe columns in flat file Col1=CUSTOMER,TEXT 10 Col2=CUSTOMER_LBL,TEXT 50 Col3=DISTRICT,TEXT 10 Col4=DISTRICT_LBL,TEXT 50 Col5=REGION,TEXT 10 Col6=REGION_LBL,TEXT 50
528
November 2011
Transformer
; Match fields in flat file with levels and labels in dimension Level1=CUSTOMER Level2=DISTRICT Level3=REGION Label1=CUSTOMER_LBL Label2=DISTRICT_LBL Label3=REGION_LBL
; Attribute load with source data in relational ; Have to build dimension component first [cot_dim_sql] Loading=Dimension Schema=lss Table=cot LinkIDSource=orasource SourceSQL=select COT from customer Format=Delimited TAB LinkIDTarget=holap Result=Yes Truncate=Yes Trace=No
Level1=COT Label1=COT
; Load the data for the attribute variable [cot_data_sql] Loading=Attribute Schema=lss Table=cot Dimension=customer LinkIDSource=orasource SourceSQL=select CUSTOMER, COT from customer Format=Delimited TAB LinkIDTarget=holap Truncate=Yes Trace=No
November 2011
529
DimField=CUSTOMER AttrField=COT
; Initial data load from SQL source [data_sql_init] Loading=Fact Schema=lss LinkIDSource=orasource SourceSQL=select CUSTOMER, PRODUCT, CHANNEL, to_char(NEWDATE,'yyyy/mm/dd') NEWTIME, UNITS, SALES, COSTS from transact_hist Format=Delimited TAB DateFormat=YYYY/MM/DD LinkIDTarget=holap Truncate=Yes Trace=No Blocks=250000 BlockSize=8192 Load=10000
; Match returned fields with model components VARIABLE1=UNITS,UNITS VARIABLE2=SALES,SALES VARIABLE3=COSTS,COSTS DIM1=CUSTOMER,CUSTOMER DIM2=CHANNEL,CHANNEL DIM3=PRODUCT,PRODUCT TIME=NEWTIME
; Incremental data load from SQL source [data_sql_incr] Loading=Fact Schema=lss LinkIDSource=orasource SourceSQL=select CUSTOMER, PRODUCT, CHANNEL, to_char(NEWDATE,'yyyy/mm/dd') NEWTIME, UNITS, SALES, COSTS from transact_currmonth Format=Delimited TAB
530
November 2011
Transformer
; Match returned fields with components in Application Server model VARIABLE1=UNITS,UNITS VARIABLE2=SALES,SALES VARIABLE3=COSTS,COSTS DIM1=CUSTOMER,CUSTOMER DIM2=CHANNEL,CHANNEL DIM3=PRODUCT,PRODUCT TIME=NEWTIME
; Initial data load from data in flat file [data_text_init] Loading=Fact Schema=lss InputFile=transact.txt Format=Delimited Tab DateFormat=MM/DD/YYYY LinkIDTarget=holap Truncate=Yes Trace=No Blocks=250000 BlockSize=8192 Load=10000
; Describe columns in flat file COL1=CUSTOMER,TEXT 24 COL2=PRODUCT,TEXT 24 COL3=CHANNEL,TEXT 24 COL4=TIME,TEXT 10 COL5=UNITS,NUMERIC 10.0
November 2011
531
11.5.2
This topic contains the parameters that are valid for all sections of the Transformer parameter file. The first table describes parameters that are required. The second table shows optional parameters that have default values if not used. The third table shows optional parameters that can be used in applicable situations. They do not have default values if they are not used.
(Table 1) Keyword/Syntax [windows] TBDB=tbdb_path [section_name] Description of Required parameters where tbdb_path is the full path and name of the TBDB.ENG file which stores Transformer messages string. This section is required on Windows NT systems. On UNIX define TBDB as an environment variable prior to running the Transformer. where section_name is a descriptive label for the section of the file. When you run the Transformer you pass the name of the parameter file and the name of the section as follows. sgtrans inifile file_name s section_name Loading=table_type Schema=prefix LinkIDSource=LinkID and SourceSQL=SQL or InputFile=file_name where file_name is the full path and name of the input ASCII text file. Note: A Transformer parameter file includes either LinkIDSource and SourceSQL or InputFile, but not both Format=style where style defines the field layout of the source file. The setting is one of the following: Fixed, Delimited Tab, or Delimited, (to indicate a comma-delimited format). Other field separator characters are accepted, for example, Delimited~ and Delimited|. LinkIDTarget=LinkID Col1=colname,coltype length to Coln=colname,coltype length where LinkID is a valid Link ID to connect to the schema tables in the RDBMS. where colname is the alias for the field name, coltype is text for dimension fields and numeric for variable fields. For text fields length is the number of characters and for numeric fields it is the number of digits to the left and right of the decimal (ex. 10.2) where table_type is the type of table that is being loaded. The setting is Dimension, Fact, or Attribute. where prefix is the schema prefix of the table(s) to be updated. where LinkID is a valid Link ID to connect to source data residing in a supported RDBMS. where SQL is the SQL statement(s) to retrieve the required data from the source data in the RDBMS.
532
November 2011
Transformer
These entries are required when the source data is from an ASCII text file. There must be one Coln= entry for each column in the file.
Note: You must insert a comma between colname and coltype and a space between coltype and length. This table below contains the syntax for optional parameters in all sections. If you do not specify these parameters, default values will be used.
(Table 2) Keyword/Syntax Truncate=yes | no Description of optional parameters with default values where no indicates that updates will be added to the existing table and yes truncates or drops existing tables prior to the load. Use No for an incremental update and Yes when rebuilding the schema. If you do not specify this parameter, then Truncate=no is used. Trace=yes | no Blocksize=n Blocks=n where yes displays the SQL being executed to the terminal. If you do not specify this parameter, then Trace=no is used. where n is the blocksize of the Transformer cache. If you do not specify this parameter, then Blocksize=2048 is used. where n is the number of blocks in the Transformer cache. Blocks is used in conjunction with Blocksize to determine the size to which the cache file can grow. If you do not specify this parameter, then Blocks=25000 is used. Load=n where n is the number of SQL target records to buffer for output to the SQL fast loader. If you do not specify this parameter, then Load=1000 is used. WorkDB=file_name where file_name is the name of the temporary cache file created by the Transformer. If you specify a unique cache file name in each section, you can run multiple Transformer sessions simultaneously. If you do not specify this parameter, then WorkDB=SGTRANSC is used. Timings=Yes|No Controls whether to display or remove the timings that are shown in Transformer output when the Trace parameter is set to Yes. To display timings, specify Timings=Yes. To omit timings, specify Timings=No. If you do not specify this parameter and Trace=Yes, then Timings=No is used and no timings are displayed during a trace. Nthreads=n Specifies the number of threads to use. If Nthreads=1, the Transformer and the RDBMS share one thread. If you specify Nthreads=2, two threads are started and the tasks can operate concurrently. If you do not specify this parameter, then Nthreads=1 is used and the Transformer and RDBMS share one thread. OutputFile=file_name where file_name is the full path and name of the output ASCII text file. If an output file is defined, transformed data is output to an ASCII text file and is not loaded into the schema. If no output file is defined or if you do not specify this parameter, then data is loaded into the schema tables.
This table below contains the syntax for optional parameters in all sections. Use these optional parameters only when applicable to the situation. If you do not specify these parameters, no values will be used.
Specifies whether Application Server will try to insert rows first or update rows first. If you know that your data will be adding new records to the relational tables, specify TryFirst=Insert to improve
November 2011
533
Transformer Parameter File Reference performance. If you know that your data will be updating records that are in the tables already, specify TryFirst=Update. This keyword is used only for Fact tables. By default Transformer will try inserts first when the Schema is storing time down and it will try updates first when the Schema is storing time across. When the TRUNCATE=YES parameter is used, then TryFirst=INSERT will always be used.
Comment=character Delimited=character
where character is the character used in the input ASCII text file to indicate a comment line that should be skipped during the load. where character specifies the quote character that surrounds input data strings in ASCII input files. If the strings contain the field delimiter character then they must be in quotes. Indicates whether or not to use Oracle Sql*Loader to perform a direct path load of the Dimension or Fact table. Direct path load is valid only when creating the tables. To use Directload=Yes, the parameter Truncate=Yes must be used.
Directload=Yes|No
11.5.3
This table contains the syntax for the required parameters in Dimension sections. The first table describes parameters that are required. The second table shows optional parameters that have default values if not used.
(Table 1) Keyword/Syntax Description of required parameters
where dimension is the name of the structural or attribute dimension to be loaded or updated. where yes adds a Result (apex) member and level to the dimension. where field names the column from the source data that represents the short names for the level in the dimension. Level1 corresponds to the input members of the dimension and Leveln to the highest output level below the Result member. where field names the column from the source data that represents the long names or labels for the members at the corresponding level of the dimension. Note: For Level and Label entries some manipulation of the text values is possible. Instead of naming a column in the source data, field may be a literal string enclosed in quotation marks () or a substring or a column. It also may be a concatenation of two or more of these elements separated by plus signs (+). The syntax for the substring function in the Parameter reference file is: SUBSTR(column_name, offset, length)
This table below contains the syntax for optional parameters in the Dimension sections. If you do not specify these parameters, default values will be used.
(Table 2)Keyword/Syntax Description of optional parameters with default
Delete=Yes|No
For Dimension table loads, this parameter indicates that the members in the source should be deleted from the schema tables. If you do not specify this parameter, then Delete=No will be used. For Dimension table updates, setting this parameter to Yes causes the
Cachedim=Yes|No
534
November 2011
Transformer
Transformer to load a copy of existing members into memory prior to the update. This may speed up the load in cases where there are a lot of records in the new data set. If the update data set is small, setting this parameter to No may improve the load time. If you do not specify this parameter, then Cachedim=No will be used.
11.5.4
This table contains the syntax for the required parameters in Fact sections. The first table describes parameters that are required. The second table shows optional parameters that have default values if not used.
(Table 1) Keyword/Syntax Description of required parameters DateFormat=date_format Period=start_date [-end_date]
where date_format is the format of the dates in the source data. where start_date is the date of the first observation to load, and end_date is the optional date of the last observation to load. start_date and end_date must be entered in the format specified in the DateFormat setting. The default for end_date is start_date. Note: The Period setting should be used when you are updating an already-populated Fact table and you have Truncate set to No.
where var_name is the Application Server short name for the variable being loaded and field is the corresponding column in the source data. There is one Variablen= entry for every variable in the source data. Note: All variables loaded together must have the same dimensionality and periodicity.
where dim_name specifies the dimensions being loaded and field is the corresponding column in the source data. All of the dimensions that the variables are dimensioned by must be listed. Note: The string manipulation described above for Level and Label entries is an option here also.
Time=field
where field maps to the source data column that contains the date.
This table below contains the syntax for optional parameters in the Fact sections. If you do not specify these parameters, default values will be used.
(Table 2) Keyword/Syntax Description of optional parameter with default value ReadOption=Add During Fact table loads, ReadOption=Add aggregates input data if required, and adds it to corresponding observations that already exist in the Fact table. New rows are created in the Fact table if required. If this parameter is used, you must set the Truncate parameter to Truncate=No. If you do not specify this parameter, data will not be aggregated.
11.5.5
The attribute dimension is built first in the same manner as a structural dimension and then data is loaded for the attribute variable. The following table contains the syntax for additional entries required for Attribute variable sections:
Keyword/Syntax Table=attribute Description
November 2011
535
where dimension is the structural dimension this attribute is tied to. where field is the column in the source data that represents the short name for the input values of the structural dimension. where field is the column in the source data that represents the attribute data value associated with the structural dimension member in DimField.
11.5.6
Keep the following points in mind as you use the Transformer: Do not add unnecessary spaces to parameter file settings. If you are not sure, follow the examples in this Help file. Give each output ASCII text file you create a unique name. OutputFile does not overwrite an existing file with the same name. To get the best performance out of initial data loads via the Transformer, disable triggers on your schema tables before the Transformer run, and re-enable them afterwards, using the TRIGGER (Schema) command. That way, you avoid needlessly populating the Fact Delta table(s).
536
November 2011