Using Functions

Total Page:16

File Type:pdf, Size:1020Kb

Using Functions TIBCO WebFOCUS® Using Functions Release 8207 May 2021 DN4501670.0521 Copyright © 2021. TIBCO Software Inc. All Rights Reserved. Contents 1. How to Use This Manual ...................................................... 17 Available Languages .................................................................17 Operating Systems .................................................................. 17 2. Introducing Functions .........................................................19 Using Functions .....................................................................19 Types of Functions ...................................................................20 WebFOCUS-specific Functions.................................................... 22 Simplified Analytic Functions..................................................... 22 Simplified Character Functions....................................................23 Character Functions.............................................................25 Variable Length Character Functions...............................................28 Character Functions for DBCS Code Pages......................................... 29 Maintain-specific Character Functions..............................................30 Data Source and Decoding Functions..............................................31 Simplified Date and Date-Time Functions...........................................33 Date Functions................................................................. 33 Standard Date Functions................................................... 33 Legacy Date Functions..................................................... 35 Date-Time Functions.............................................................36 Maintain-specific Date and Time Functions......................................... 38 Maintain-specific Standard Date and Time Functions............................38 Maintain-specific Legacy Date Functions......................................39 Simplified Conversion Functions.................................................. 39 Format Conversion Functions.....................................................40 Maintain-specific Light Update Support Functions....................................42 Simplified Numeric Functions.....................................................42 Numeric Functions..............................................................42 Maintain-specific Script Functions.................................................45 Simplified Statistical Functions................................................... 45 Machine Learning (Python-based) Functions........................................ 45 Simplified System Functions......................................................46 System Functions...............................................................47 Using Functions 3 Contents Simplified Geography Functions...................................................49 Character Chart for ASCII and EBCDIC ..................................................50 3. Accessing and Calling a Function ..............................................59 Calling a Function ................................................................... 59 Supplying an Argument in a Function ...................................................61 Argument Types................................................................ 61 Argument Formats.............................................................. 62 Argument Length................................................................63 Number and Order of Arguments..................................................64 Verifying Function Parameters.................................................... 64 Calling a Function From a DEFINE, COMPUTE, or VALIDATE Command .......................67 Calling a Function From a Dialogue Manager Command ...................................68 Assigning the Result of a Function to a Variable.....................................69 Branching Based on the Result of a Function....................................... 70 Calling a Function From an Operating System RUN Command......................... 72 Calling a Function From Another Function ............................................... 73 Calling a Function in WHERE or IF Criteria ...............................................73 Using a Calculation or Compound IF Command......................................75 Calling a Function in WHEN Criteria .................................................... 75 Calling a Function From a RECAP Command .............................................76 Storing and Accessing an External Function ............................................. 78 Storing and Accessing a Function on z/OS..........................................78 Storing and Accessing a Function on UNIX..........................................79 Storing and Accessing a Function on Windows...................................... 79 4. Simplified Analytic Functions ................................................. 81 FORECAST_MOVAVE: Using a Simple Moving Average .....................................81 FORECAST_EXPAVE: Using Single Exponential Smoothing ................................. 87 FORECAST_DOUBLEXP: Using Double Exponential Smoothing ..............................90 FORECAST_SEASONAL: Using Triple Exponential Smoothing ...............................92 FORECAST_LINEAR: Using a Linear Regression Equation ..................................97 PARTITION_AGGR: Creating Rolling Calculations ........................................ 100 PARTITION_REF: Using Prior or Subsequent Field Values in Calculations ....................110 4 Contents INCREASE: Calculating the Difference Between the Current and a Prior Value of a Field ...... 114 PCT_INCREASE: Calculating the Percentage Difference Between the Current and a Prior Value of a Field .......................................................................118 PREVIOUS: Retrieving a Prior Value of a Field ...........................................121 RUNNING_AVE: Calculating an Average Over a Group of Rows ............................ 123 RUNNING_MAX: Calculating a Maximum Over a Group of Rows ........................... 126 RUNNING_MIN: Calculating a Minimum Over a Group of Rows ............................ 129 RUNNING_SUM: Calculating a Sum Over a Group of Rows ................................132 5. Simplified Character Functions .............................................. 135 CHAR_LENGTH: Returning the Length in Characters of a String ........................... 136 CONCAT: Concatenating Strings ......................................................137 DIFFERENCE: Measuring the Phonetic Similarity Between Character Strings ................ 139 DIGITS: Converting a Number to a Character String ......................................142 GET_TOKEN: Extracting a Token Based on a String of Delimiters ..........................144 INITCAP: Capitalizing the First Letter of Each Word in a String .............................145 LAST_NONBLANK: Retrieving the Last Field Value That is Neither Blank nor Missing .........146 LEFT: Returning Characters From the Left of a Character String ...........................148 LOWER: Returning a String With All Letters Lowercase ...................................150 LPAD: Left-Padding a Character String .................................................151 LTRIM: Removing Blanks From the Left End of a String .................................. 153 OVERLAY: Replacing Characters in a String ............................................ 154 PATTERNS: Returning a Pattern That Represents the Structure of the Input String ...........156 POSITION: Returning the First Position of a Substring in a Source String ................... 158 POSITION: Returning the Position of a Search String in a Source String .................... 160 Regular Expression Functions ........................................................161 Using Regular Expressions on z/OS..............................................162 REGEX: Matching a String to a Regular Expression................................. 162 REGEXP_COUNT: Counting the Number of Matches to a Pattern in a String............ 165 REGEXP_INSTR: Returning the First Position of a Pattern in a String...................169 REGEXP_REPLACE: Replacing All Matches to a Pattern in a String.................... 172 REGEXP_SUBSTR: Returning the First Match to a Pattern in a String.................. 174 REPEAT: Repeating a String a Given Number of Times ...................................176 Using Functions 5 Contents REPLACE: Replacing a String .........................................................177 RIGHT: Returning Characters From the Right of a Character String .........................179 RPAD: Right-Padding a Character String ................................................181 RTRIM: Removing Blanks From the Right End of a String .................................183 SPACE: Returning a String With a Given Number of Spaces ...............................184 SPLIT: Extracting an Element From a String ............................................ 185 SUBSTRING: Extracting a Substring From a Source String ................................186 TOKEN: Extracting a Token From a String .............................................. 188 TRIM_: Removing a Leading Character, Trailing Character, or Both From a String ............ 190 UPPER: Returning a String With All Letters Uppercase ................................... 193 6. Character Functions .........................................................195 Character
Recommended publications
  • IBM Data Conversion Under Websphere MQ
    IBM WebSphere MQ Data Conversion Under WebSphere MQ Table of Contents .................................................................................................................................................... 3 .................................................................................................................................................... 3 Int roduction............................................................................................................................... 4 Ac ronyms and terms used in Data Conversion........................................................................ 5 T he Pieces in the Data Conversion Puzzle............................................................................... 7 Coded Character Set Identifier (CCSID)........................................................................................ 7 Encoding .............................................................................................................................................. 7 What Gets Converted, and How............................................................................................... 9 The Message Descriptor.................................................................................................................... 9 The User portion of the message..................................................................................................... 10 Common Procedures when doing the MQPUT................................................................. 10 The message
    [Show full text]
  • JFP Reference Manual 5 : Standards, Environments, and Macros
    JFP Reference Manual 5 : Standards, Environments, and Macros Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054 U.S.A. Part No: 817–0648–10 December 2002 Copyright 2002 Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, CA 95054 U.S.A. All rights reserved. This product or document is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No part of this product or document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Third-party software, including font technology, is copyrighted and licensed from Sun suppliers. Parts of the product may be derived from Berkeley BSD systems, licensed from the University of California. UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd. Sun, Sun Microsystems, the Sun logo, docs.sun.com, AnswerBook, AnswerBook2, and Solaris are trademarks, registered trademarks, or service marks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc. The OPEN LOOK and Sun™ Graphical User Interface was developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the pioneering efforts of Xerox in researching and developing the concept of visual or graphical user interfaces for the computer industry. Sun holds a non-exclusive license from Xerox to the Xerox Graphical User Interface, which license also covers Sun’s licensees who implement OPEN LOOK GUIs and otherwise comply with Sun’s written license agreements.
    [Show full text]
  • Notetab User Manual
    NoteTab User Manual Copyright © 1995-2016, FOOKES Holding Ltd, Switzerland NoteTab® Tame Your Text with NoteTab by FOOKES Holding Ltd A leading-edge text and HTML editor. Handle a stack of huge files with ease, format text, use a spell-checker, and perform system-wide searches and multi-line global replacements. Build document templates, convert text to HTML on the fly, and take charge of your code with a bunch of handy HTML tools. Use a power-packed scripting language to create anything from a text macro to a mini-application. Winner of top industry awards since 1998. “NoteTab” and “Fookes” are registered trademarks of Fookes Holding Ltd. All other trademarks and service marks, both marked and not marked, are the property of their respective ow ners. NoteTab® Copyright © 1995-2016, FOOKES Holding Ltd, Switzerland All rights reserved. No parts of this work may be reproduced in any form or by any means - graphic, electronic, or mechanical, including photocopying, recording, taping, or information storage and retrieval systems - without the written permission of the publisher. “NoteTab” and “Fookes” are registered trademarks of Fookes Holding Ltd. All other trademarks and service marks, both marked and not marked, are the property of their respective owners. While every precaution has been taken in the preparation of this document, the publisher and the author assume no responsibility for errors or omissions, or for damages resulting from the use of information contained in this document or from the use of programs and source code that may accompany it. In no event shall the publisher and the author be liable for any loss of profit or any other commercial damage caused or alleged to have been caused directly or indirectly by this document.
    [Show full text]
  • M-Command Manual NYSOL Package Current Release: Ver
    M-Command Manual NYSOL Package Current Release: Ver. 2.0 Releases: October 6, 2014: Ver. 2.0 Release April 30, 2014 : Updated errors in examples March 10, 2014 : Changes in installation method corresponding to integration of NYSOL package February 15, 2014 : Added mxml2csv November 2, 2013 : Added mpadding, mvnullto, mvdelnull, and minor changes September 20, 2013 : First Release March 24, 2015 Copyright ⃝c 2013-2014 by NYSOL CORPORATION Contents 1 Changes from Package 1.0 7 1.1 Addition of Automatic Sorting Function ................................ 8 1.2 Commands with Change in Specifications ............................... 8 1.3 Executing Previous Scripts ....................................... 9 2 M-Command 11 2.1 M-Command ............................................... 12 2.2 Let's start ................................................. 12 2.3 Installation ................................................ 14 2.4 CSV .................................................... 15 2.5 Data Type ................................................. 18 2.6 Specify Fields ............................................... 19 2.7 Working with Data Without Field Names ............................... 24 2.8 Multibyte Characters ........................................... 25 2.9 Specify Parameters ............................................ 27 2.10 Environment Variable .......................................... 39 2.11 Key Break Processing .......................................... 41 3 Command Reference 43 3.1 Format of MCMD ...........................................
    [Show full text]
  • IBM Enhanced 5250 Emulation Program User's Guide Version 2.4 Publication No
    G570-2221-05 IBM Enhanced 5250 Emulation Program User's Guide Version 2.4 GS70-2221-0S IBM Enhanced 5250 Emulation Program User's Guide Version 2.4 Note! ------------------~--------------------------------. Before using this information and the product it supports, be sure to read the general information under "Notices" on page xv. Sixth Edition (April 1994) This edition applies to the IBM Enhanced 5250 Emulation Program Version 2.4 and to all subsequent releases and modifications until otherwise indicated in new editions. The following paragraph does not apply to the United Kingdom or any country where such provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you. This publication could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. Products are not stocked at the address below. Additional copies of this publication may be purchased from an IBM Authorized Dealer, IBM PC Direct™ (1-800-IBM-2YOU), IBM AS/400® Direct (1-800-IBM-CALL), or the IBM Software Manufacturing Company (1-800-879-2755). When calling, reference Order Number G570-2221 and Part Number 82G7303. Requests for technical information about these products should be made to your IBM Authorized Dealer or your IBM Marketing Representative.
    [Show full text]
  • Pdflib-9.3.1-Tutorial.Pdf
    ABC PDFlib, PDFlib+PDI, PPS A library for generating PDF on the fly PDFlib 9.3.1 Tutorial For use with C, C++, Java, .NET, .NET Core, Objective-C, Perl, PHP, Python, RPG, Ruby Copyright © 1997–2021 PDFlib GmbH and Thomas Merz. All rights reserved. PDFlib users are granted permission to reproduce printed or digital copies of this manual for internal use. PDFlib GmbH Franziska-Bilek-Weg 9, 80339 München, Germany www.pdflib.com phone +49 • 89 • 452 33 84-0 [email protected] [email protected] (please include your license number) This publication and the information herein is furnished as is, is subject to change without notice, and should not be construed as a commitment by PDFlib GmbH. PDFlib GmbH assumes no responsibility or lia- bility for any errors or inaccuracies, makes no warranty of any kind (express, implied or statutory) with re- spect to this publication, and expressly disclaims any and all warranties of merchantability, fitness for par- ticular purposes and noninfringement of third party rights. PDFlib and the PDFlib logo are registered trademarks of PDFlib GmbH. PDFlib licensees are granted the right to use the PDFlib name and logo in their product documentation. However, this is not required. PANTONE® colors displayed in the software application or in the user documentation may not match PANTONE-identified standards. Consult current PANTONE Color Publications for accurate color. PANTONE® and other Pantone, Inc. trademarks are the property of Pantone, Inc. © Pantone, Inc., 2003. Pantone, Inc. is the copyright owner of color data and/or software which are licensed to PDFlib GmbH to distribute for use only in combination with PDFlib Software.
    [Show full text]
  • Downloading Fonts
    Chapter 10: Downloading Fonts Contents of this Chapter • Introduction to Soft Fonts. ............................................................ 10-1 • The Font ID ................................................................................. 10-3 • The Font Definition...................................................................... 10-4 • Managing Fonts ......................................................................... 10-38 This chapter describes the following PCL commands: Font ID ...............................................Esc*c#D ................................... 10-3 Download Font ...................................Esc)s#W[font definition] ........... 10-4 Font Control .......................................Esc*c#F ................................. 10-38 10.1 Introduction to Soft Fonts Chapter 10 describes the first part of font downloading: font definition. Chapter 11 describes the second part of font downloading: character definition. Font Downloading Downloading a font to the printer consists of the following steps: 1. Define a Font ID for the font and download the font definition. 2. Define the Character Codes and character definitions for each character. The definition of a font with n characters looks like the following: Font ID Font Definition Character Code1 Character Definition1 Character Code2 Character Definition2 ... Character Coden Character Definitionn Hewlett-Packard CONFIDENTIAL Version 6.0 5/01/95 10 - 2 Downloading Fonts Definitions Font ID: A unique identification number that is designated
    [Show full text]
  • Emulator User's Reference
    Personal Communications for Windows, Ver sion 5.8 Emulator User’s Reference SC31-8960-00 Personal Communications for Windows, Ver sion 5.8 Emulator User’s Reference SC31-8960-00 Note Before using this information and the product it supports, read the information in “Notices,” on page 217. First Edition (September 2004) This edition applies to Version 5.8 of Personal Communications (program number: 5639–I70) and to all subsequent releases and modifications until otherwise indicated in new editions. © Copyright International Business Machines Corporation 1989, 2004. All rights reserved. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Figures . vii Using PDT Files . .24 Double-Byte Character Support. .25 Tables . .ix Printing to Disk . .26 Workstation Profile Parameter for Code Page . .27 About This Book. .xi Chapter 5. Key Functions and Who Should Read This Book. .xi How to Use This Book . .xi Keyboard Setup . .29 Command Syntax Symbols . .xi Default Key Function Assignments . .29 Where to Find More Information . xii Setting the 3270 Keyboard Layout Default . .29 InfoCenter. xii Default Key Functions for a 3270 Layout . .29 Online Help . xii Setting the 5250 Keyboard Layout Default . .32 Personal Communications Library. xii Default Key Functions for a 5250 Layout . .32 Related Publications . xiii Default Key Functions for the Combined Package 34 Contacting IBM. xiii Setting the VT Keyboard Layout Default . .34 Support Options . xiv Default Key Functions for the VT Emulator Layout . .35 Keyboard Setup (3270 and 5250) . .36 Part 1. General Information . .1 Keyboard File . .36 Win32 Cut, Copy, and Paste Hotkeys .
    [Show full text]
  • Information, Characters, Unicode
    Information, Characters, Unicode Unicode © 24 August 2021 1 / 107 Hidden Moral Small mistakes can be catastrophic! Style Care about every character of your program. Tip: printf Care about every character in the program’s output. (Be reasonably tolerant and defensive about the input. “Fail early” and clearly.) Unicode © 24 August 2021 2 / 107 Imperative Thou shalt care about every Ěaracter in your program. Unicode © 24 August 2021 3 / 107 Imperative Thou shalt know every Ěaracter in the input. Thou shalt care about every Ěaracter in your output. Unicode © 24 August 2021 4 / 107 Information – Characters In modern computing, natural-language text is very important information. (“number-crunching” is less important.) Characters of text are represented in several different ways and a known character encoding is necessary to exchange text information. For many years an important encoding standard for characters has been US ASCII–a 7-bit encoding. Since 7 does not divide 32, the ubiquitous word size of computers, 8-bit encodings are more common. Very common is ISO 8859-1 aka “Latin-1,” and other 8-bit encodings of characters sets for languages other than English. Currently, a very large multi-lingual character repertoire known as Unicode is gaining importance. Unicode © 24 August 2021 5 / 107 US ASCII (7-bit), or bottom half of Latin1 NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SS SI DLE DC1 DC2 DC3 DC4 NAK SYN ETP CAN EM SUB ESC FS GS RS US !"#$%&’()*+,-./ 0123456789:;<=>? @ABCDEFGHIJKLMNO PQRSTUVWXYZ[\]^_ `abcdefghijklmno pqrstuvwxyz{|}~ DEL Unicode Character Sets © 24 August 2021 6 / 107 Control Characters Notice that the first twos rows are filled with so-called control characters.
    [Show full text]
  • Acronyms and Abbreviations *
    APPENDIX A Acronyms and Abbreviations * a atto (10-18) A ampere A angstrom AAR automatic alternate routing AARTS automatic audio remote test set AAS aeronautical advisory station AB asynchronous balanced [mode] (Link Layer OSI-RM) ABCA American, British, Canadian, Australian armies abs absolute ABS aeronautical broadcast station ABSBH average busy season busy hour ac alternating current AC absorption coefficient access charge access code ACA automatic circuit assurance ACC automatic callback calling ACCS associated common-channel signaling ACCUNET AT&T switched 56-kbps service ACD automatic call distributing *Alphabetized letter by letter. Uppercase letters follow lowercase letters. All other symbols are ignored, including superscripts and subscripts. Numerals follow Z, and Greek letters are at the very end. 1103 Appendix A 1104 automatic call distributor ac-dc alternating-current direct-current (ringing) ACE automatic cross-connection equipment ACFNTAM advanced communications facility (VTAM) ACK acknowledge character acknowledgment ACKINAK acknowledgment/negative acknowledgment ACS airport control station asynchronous communications system ACSE association service control element ACTS advanced communications technology satellite ACU automatic calling unit AD addendum NO analog to digital A-D analog to digital ADAPT architectures design, analysis, and planning tool ADC analog-to-digital converter automatic digital control ADCCP Advanced Data Communications Control Procedure (ANSI) ADH automatic data handling ADP automatic data processing
    [Show full text]
  • X-Ways Forensics & Winhex Manual
    X-Ways Software Technology AG X-Ways Forensics/ WinHex Integrated Computer Forensics Environment. Data Recovery & IT Security Tool. Hexadecimal Editor for Files, Disks & RAM. Manual Copyright © 1995-2021 Stefan Fleischmann, X-Ways Software Technology AG. All rights reserved. Contents 1 Preface ..................................................................................................................................................1 1.1 About WinHex and X-Ways Forensics.........................................................................................1 1.2 Legalities.......................................................................................................................................2 1.3 License Types ...............................................................................................................................4 1.4 More differences between WinHex & X-Ways Forensics............................................................5 1.5 Getting Started with X-Ways Forensics........................................................................................6 2 Technical Background ........................................................................................................................7 2.1 Using a Hex Editor........................................................................................................................7 2.2 Endian-ness...................................................................................................................................8 2.3 Integer
    [Show full text]
  • Unicode Convertfile Converts Text files from One Encoding to Another Encoding
    Title stata.com unicode convertfile — Low-level file conversion between encodings Description Syntax Options Remarks and examples Also see Description unicode convertfile converts text files from one encoding to another encoding. It is a low-level utility that will feel familiar to those of you who have used the Unix command iconv or the similar International Components for Unicode (ICU)-based command uconv. If you need to convert Stata datasets (.dta) or text files commonly used with Stata such as do-files, ado-files, help files, and CSV (*.csv) files, you should use the unicode translate command; see[ D] unicode translate. If you wish to convert individual strings or string variables in your dataset, use the ustrfrom() and ustrto() functions. Syntax unicode convertfile srcfilename destfilename , options srcfilename is a text file that is to be converted from a given encoding and destfilename is the destination text file that will use a different encoding. options Description srcencoding( string ) encoding of the source file; UTF-8 if not specified dstencoding( string ) encoding of the destination file; UTF-8 if not specified srccallback(method) what to do if source file contains invalid byte sequence(s) dstcallback(method) what to do if destination encoding does not support characters in the source file replace replace the destination file if it exists method Description stop specify that unicode convertfile stop with an error if an invalid character is encountered; the default skip specify that unicode convertfile skip invalid characters substitute specify that unicode convertfile substitute invalid characters with the destination encoding’s substitute character during conversion; the substitute character for Unicode encodings is \ufffd escape specify that unicode convertfile replace any Unicode characters not supported in the destination encoding with an escaped string of the hex value of the Unicode code point.
    [Show full text]