
Using Functions Release 8.2 Version 03 and Higher August 21, 2018 Active Technologies, EDA, EDA/SQL, FIDEL, FOCUS, Information Builders, the Information Builders logo, iWay, iWay Software, Parlay, PC/FOCUS, RStat, Table Talk, Web390, WebFOCUS, WebFOCUS Active Technologies, and WebFOCUS Magnify are registered trademarks, and DataMigrator and Hyperstage are trademarks of Information Builders, Inc. Adobe, the Adobe logo, Acrobat, Adobe Reader, Flash, Adobe Flash Builder, Flex, and PostScript are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries. Due to the nature of this material, this document refers to numerous hardware and software products by their trademarks. In most, if not all cases, these designations are claimed as trademarks or registered trademarks by their respective companies. It is not this publisher's intent to use any of these names generically. The reader is therefore cautioned to investigate all claimed trademark rights before using any of these names other than to refer to the product described. Copyright © 2018, by Information Builders, Inc. and iWay Software. All rights reserved. Patent Pending. This manual, or parts thereof, may not be reproduced in any form without the written permission of Information Builders, Inc. Contents Preface ........................................................................ 17 Conventions ........................................................................19 Related Publications .................................................................20 Customer Support ...................................................................20 Information You Should Have ..........................................................21 User Feedback ......................................................................22 Information Builders Consulting and Training ............................................ 22 1. How to Use This Manual ...................................................... 23 Available Languages .................................................................23 Operating Systems .................................................................. 23 2. Introducing Functions .........................................................25 Using Functions .....................................................................25 Types of Functions ...................................................................26 WebFOCUS-specific Functions.................................................... 28 Simplified Analytic Functions..................................................... 28 Simplified Character Functions....................................................28 Character Functions.............................................................30 Variable Length Character Functions...............................................33 Character Functions for DBCS Code Pages......................................... 34 Maintain-specific Character Functions..............................................35 Data Source and Decoding Functions..............................................36 Simplified Date and Date-Time Functions...........................................37 Date Functions................................................................. 38 Standard Date Functions................................................... 38 Legacy Date Functions..................................................... 39 Date-Time Functions.............................................................41 Maintain-specific Date and Time Functions......................................... 43 Maintain-specific Standard Date and Time Functions............................43 Maintain-specific Legacy Date Functions......................................43 Simplified Conversion Functions.................................................. 44 Format Conversion Functions.....................................................45 Using Functions 3 Contents Maintain-specific Light Update Support Functions....................................46 Simplified Numeric Functions.....................................................46 Numeric Functions..............................................................47 Maintain-specific Script Functions.................................................49 Simplified Statistical Functions................................................... 49 Simplified System Functions......................................................50 System Functions...............................................................50 Simplified Geography Functions...................................................52 Character Chart for ASCII and EBCDIC ..................................................53 3. Accessing and Calling a Function ..............................................61 Calling a Function ................................................................... 61 Supplying an Argument in a Function ...................................................63 Argument Types................................................................ 63 Argument Formats.............................................................. 64 Argument Length................................................................65 Number and Order of Arguments..................................................66 Verifying Function Parameters.................................................... 66 Calling a Function From a DEFINE, COMPUTE, or VALIDATE Command .......................69 Calling a Function From a Dialogue Manager Command ...................................70 Assigning the Result of a Function to a Variable.....................................71 Branching Based on the Result of a Function....................................... 72 Calling a Function From an Operating System RUN Command......................... 74 Calling a Function From Another Function ............................................... 75 Calling a Function in WHERE or IF Criteria ...............................................75 Using a Calculation or Compound IF Command......................................77 Calling a Function in WHEN Criteria .................................................... 77 Calling a Function From a RECAP Command .............................................78 Storing and Accessing an External Function ............................................. 80 Storing and Accessing a Function on z/OS..........................................80 Storing and Accessing a Function on UNIX..........................................81 Storing and Accessing a Function on Windows...................................... 81 4. Simplified Analytic Functions ................................................. 83 4 Information Builders Contents FORECAST_MOVAVE: Using a Simple Moving Average .....................................83 FORECAST_EXPAVE: Using Single Exponential Smoothing ................................. 89 FORECAST_DOUBLEXP: Using Double Exponential Smoothing ..............................92 FORECAST_SEASONAL: Using Triple Exponential Smoothing ...............................94 FORECAST_LINEAR: Using a Linear Regression Equation ..................................98 PARTITION_AGGR: Creating Rolling Calculations ........................................ 102 PARTITION_REF: Using Prior Field Values in Calculations .................................112 5. Simplified Character Functions .............................................. 117 CHAR_LENGTH: Returning the Length in Characters of a String ........................... 118 CONCAT: Concatenating Strings After Removing Trailing Blanks From the First .............. 119 DIGITS: Converting a Number to a Character String ......................................121 LAST_NONBLANK: Retrieving the Last Field Value That is Neither Blank nor Missing .........124 LOWER: Returning a String With All Letters Lowercase ...................................125 LPAD: Left-Padding a Character String .................................................126 LTRIM: Removing Blanks From the Left End of a String .................................. 128 PATTERNS: Returning a Pattern That Represents the Structure of the Input String ...........129 POSITION: Returning the First Position of a Substring in a Source String ................... 131 REGEX: Matching a String to a Regular Expression ......................................132 REPLACE: Replacing a String .........................................................134 RPAD: Right-Padding a Character String ................................................136 RTRIM: Removing Blanks From the Right End of a String .................................138 SPLIT: Extracting an Element From a String ............................................ 139 SUBSTRING: Extracting a Substring From a Source String ................................140 TOKEN: Extracting a Token From a String .............................................. 142 TRIM_: Removing a Leading Character, Trailing Character, or Both From a String ............ 144 UPPER: Returning a String With All Letters Uppercase ................................... 147 6. Character Functions .........................................................149 Character Function Notes ............................................................150 ARGLEN: Measuring the Length of a String .............................................150 ASIS: Distinguishing Between Space and Zero ..........................................151 BITSON: Determining If a Bit Is On or Off .............................................
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages650 Page
-
File Size-