Inside Module 8 Extracting Data Page Using the Extract command 2

Slides:



Advertisements
Similar presentations
1 PowerHouse and Suprtool Page n Why use Suprtool?2 n Combining Suprtool and QUIZ 4 n Linking multiple files8 n Creating complex subfiles14 n Importing.
Advertisements

1 Working with Suprlink Page n Accessing Suprlink4 n A sample scenario6 n Self-describing files15 n Linking files19 n Adding information32 n Suprlink requirements41.
Computer Science & Engineering 2111 Text Functions 1CSE 2111 Lecture-Text Functions.
MIS: Chapter 14 Cumulative concepts, features and functions, plus new functions COUNTIFS, SUMIFS, AVERAGEIFS (Separate ppt on REACH.louisville.edu) All.
1 Pertemuan 04 Expression Matakuliah: D0524 / Algoritma dan Pemrograman Komputer Tahun: 2005 Versi:
Databases Lab 5 Further Select Statements. Functions in SQL There are many types of functions provided. The ones that are used most are: –Date and Time.
Introduction to Oracle9i: SQL1 Selected Single-Row Functions.
Lecture 6 29/1/15. Number functions Number functions take numbers as input, change them, and output the results as numbers. 2.
Chapter 06: Lecture Notes (CSIT 104) 1 Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 1 Copyright © 2008 Prentice-Hall. All rights reserved.
Advanced File Processing
Advanced Excel for Finance Professionals A self study material from South Asian Management Technologies Foundation.
Fortran 1- Basics Chapters 1-2 in your Fortran book.
1 Inside Module 9 Latest Features in Suprtool n Variable Substitution n $Counter n $Clean and $FindClean n $Total and $Subtotal n $SPLIT n $EDIT n $NUMBER.
Inside Module 7 Exporting Data to the World Page n Exporting data to other applications2 n STExport converts the data4 n Running STExport5 n Dates and.
FUNCTIONS AND STORED PROCEDURES & FUNCTIONS AND PROTECTING A DB AND PHP (Chapters 9, 15, 18)
Chapter 10 Selected Single-Row Functions Oracle 10g: SQL.
Chapter 5 Selected Single-Row Functions. Chapter Objectives  Use the UPPER, LOWER, and INITCAP functions to change the case of field values and character.
1 Inside Module 4 Selecting Records with Suprtool Page n Using the If command 2 n Comparing fields4 n Selecting by pattern-matching 7 n Let’s do a crossword.
Lecture6:Data Manipulation in SQL, Simple SQL queries Prepared by L. Nouf Almujally Ref. Chapter5 Lecture6 1.
Advanced File Processing. 2 Objectives Use the pipe operator to redirect the output of one command to another command Use the grep command to search for.
Module 3: Creating Maps. Overview Lesson 1: Creating a BizTalk Map Lesson 2: Configuring Basic Functoids Lesson 3: Configuring Advanced Functoids.
Copyright © 2008 Pearson Prentice Hall. All rights reserved Chapter 6 Data Tables and Amortization Tables Exploring Microsoft Office Excel 2007.
Oracle 11g: SQL Chapter 10 Selected Single-Row Functions.
WHAT IS A DATABASE? A DATABASE IS A COLLECTION OF DATA RELATED TO A PARTICULAR TOPIC OR PURPOSE OR TO PUT IT SIMPLY A GENERAL PURPOSE CONTAINER FOR STORING.
Chapter 3 Selected Single-Row Functions and Advanced DML & DDL.
EXPRESSION Transformation. Introduction ►Transformations help to transform the source data according to the requirements of target system and it ensures.
Chapter Five Advanced File Processing. 2 Lesson A Selecting, Manipulating, and Formatting Information.
1 Creating and Maintaining Database Objects Part 1 Database Systems.
Programming with Microsoft Visual Basic th Edition
1 Inside Module 8 Extracting Data Page n Using the Extract command2 n Coercion3 n $-functions4 n Extract from a table7.
1 Inside Module 3 Working with Eloquence Page n Commands to access Eloquence databases2 n Opening and closing a database3 n Eloquence and Base Command4.
Lesson 3: Using Formulas
Do-more Technical Training
Retrieving Data Using the SQL SELECT Statement
Prepared By: Bobby Wan Microsoft Access Prepared By: Bobby Wan
Open Source Server Side Scripting MySQL Functions
Exploring Excel Chapter 5 List and Data Management: Converting Data to
Relational Database Design
Writing Basic SQL SELECT Statements
Chapter 10 Selected Single-Row Functions Oracle 10g: SQL
Microsoft Office Access 2010 Lab 2
Inside Module 10 Editing TurboIMAGE Datasets Page
The Selection Structure
Programming in COBOL.
Data File Import / Export
Writing Basic SQL SELECT Statements
Computations Done on table data
SQL Text Manipulation Farrokh Alemi, Ph.D.
Variables In programming, we often need to have places to store data. These receptacles are called variables. They are called that because they can change.
Chapter 3 The DATA DIVISION.
Guide To UNIX Using Linux Third Edition
Structured COBOL Programming
Benchmark Series Microsoft Word 2016 Level 2
Chapter 14 Sorting and Merging.
Inside Module 3 Working with Eloquence Page
Single-Row Functions Lecture 9.
Structured Query Language – The Fundamentals
Computing in COBOL: The Arithmetic Verbs and Intrinsic Functions
Inside Module 9 Latest Features in Suprtool
CHAPTER 17 The Report Writer Module
Contents Preface I Introduction Lesson Objectives I-2
Chapter 2: Introduction to C++.
The ultimate in data organization
Welcome 1 This is a document to explains the chosen concept to the animator. This will take you through a 5 section process to provide the necessary details.
C++ Programming Basics
Lecture 5 SQL FUNCTIONS.
Trainer: Bach Ngoc Toan– TEDU Website:
Programming in COBOL.
REACH Computer Resource Center
Introduction to SQL Server and the Structure Query Language
Presentation transcript:

Inside Module 8 Extracting Data Page Using the Extract command 2 Coercion 3 $-functions 4 Extract from a table 7

Extract basics Extract command “extracts” the data from the input source Fields are “placed” in the output file in order of the extract commands Extract a range of fields Extracting constants The Extract command extracts the data from the input data source. You can extract a field from a database, flat file or self-describing file by just referencing the field name. > extract customer-no The fields are written to the data source in the order specified in the extract commands. You can extract a range of fields by using the range syntax: > extract customer-no \ sales-amt The above command tells Suprtool to extract all the fields between and including customer-no and sales-amt based on the input source layout. This features works with Image and Eloquence datasets and self- describing files. You can also extract constants such as: > extract city=“Niagara Falls” > extract sales-amt=0 > extract ^13,^10 { extract carriage return and line feed }

Coercion and Numeric Expressions Extract also coerces data from the source to the target Changes from one data type to another Define display-field,1,8,display Extract display-field = double-field Simple Arithmetic functions Extract total = cost * qty Extract budget99 = actual98 + 1000 Extract profit = sales-amt – cost Extract average = total / qty Extract day = ccyymmdd-date mod 100 The Extract command also has the power to “coerce” (change) numeric data from one data type to another. For example if you have a double field in your data source you can change it to a display type with the extract command: >extract display-field = double-field Suprtool will know how to handle this transformation and do it for you. Suprtool is also capable of processing arithmetic expressions for any numeric data type.

Date $- functions $date specify constant or relative date value in various formats $today current system date or calculate a date relative to the system date $stddate converts a date in any format to CCYYMMDD $days converts the date into a Julian format Suprtool also has many functions to manipulate or set the intended target field. One set of functions that you can use to set or change data are the Date functions. Some of these functions are: $date – specify any date in any number of ways. Can define relative dates based on current system date $today- used to extract a today’s date or relative to today e.g. $today(-1) $stddate – convert any date format to ccyymmdd $days – converts any date format to julian days for date arithmetic

String $- functions converts all alphabetic characters to uppercase $lower converts all alphabetic characters to lowercase $trim removes leading and trailing spaces $ltrim removes leading spaces $rtrim removes trailing spaces Other functions can be used on strings are: $upper- converts characters to upper case $lower – converts characters to lower case $trim – trims leading and trailing spaces $ltrim – trims leading spaces $rtrim – trims trailing spaces

Numeric $- functions Returns absolute value of a number $truncate Returns a number to the left of the decimal place Suprtool supports numeric functions as well. The $abs function returns the absolute value of a given number. For example, if the field credit- amount contains the value –547.83, then the $abs function returns 547.83. The function also works on an expression such as: >def newcredit,1,4,double >ext newcredit = $abs(credit / 100 * 1.07) The $truncate function returns the number to the left of the decimal place. For example, if the field stddev contains the value 547.83, the $truncate function returns 547. Please note there is no rounding. Like the $abs function, $truncate also works on expressions as well as fields: > def newdev,1,4,double >ext newdev = $truncate(stddev * 1.07 / 100)

Extract from a table $lookup available in Extract but slightly different Must load the table with data Table mytable,key,file,sdfilename,data(tabledata) File must be self-describing Extract field = $lookup(mytable,key,tabledata) The Table command allows for data to be loaded along with matching key values. >table table-name,key-field,file,filename,data(field1,field2,...) An example of loading two data fields called cost and desc along with the key field of part into a table would be: >table partab,part,file,partin,data(cost,desc) You can specify up to 20 data fields as long as the total size of the key fields and data does not exceed 256 bytes. The Table file must be self- Describing (Link) in order to use the data option. When loading data into a table, Suprtool eliminates duplicate entries based on the key value, so the associated data values may not be loaded into the table. The Extract command can utilize the $lookup function to return data. The syntax for the $lookup function would look as follows: >extract target = $lookup(table-name,key-field,data-field) The Table name, key-field and data-field are all defined by the Table command, which must be input before the Extract command.

Extract from a Table Sample >table newprices,prodno,file,bosslist,data(price,desc) >get part-master >if $lookup(newprices,prodno) >update >extract price = $lookup(newprices,prodno,price) >extract desc = $lookup(newprices,prodno,desc) >xeq A classic example: your boss comes to you with a list of new prices and descriptions for certain parts in the Part-Master dataset. The basic steps to do this are to load the new prices and descriptions into a Table, indexed by the product number (prodno), then Extract the price field from each record and replace it with a $lookup on the table. We do the If $lookup to select only the parts which have new prices, then Extract with $lookup to replace the existing price with a new one. The Update command forces a database update on each selected record and must come before the Extract command. If you do not specify the If $lookup, then records that did not qualify under the $lookup function in the extract field, would end up with zeroes for any numeric field and spaces for any byte type fields.

Summary Extract command Extract with coercion Numeric Expressions Extract with $-functions Date functions String functions Numeric functions Extract from a table