1 Inside Module 5 Working with Files Page n Copying files 2 n Working with ordinary disc files3 n Defining fields 4 n New or existing files7 n Writing.

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

© Paradigm Publishing, Inc Access 2010 Level 1 Unit 2Creating Forms and Reports Chapter 6Creating Reports and Mailing Labels.
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.
INSERT BOOK COVER 1Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Access 2010 by Robert Grauer, Keith Mast,
Concepts of Database Management Sixth Edition
Microsoft Access 2003 Introduction To Microsoft Access 2003.
Mark Dixon Page 1 07 – Reports. Mark Dixon Page 2 Session Aims & Objectives Aims –To use reports to produce more readable documents Objectives, by end.
Developing Effective Reports
Guide To UNIX Using Linux Third Edition
Unix Filters Text processing utilities. Filters Filter commands – Unix commands that serve dual purposes: –standalone –used with other commands and pipes.
UNIX Filters.
SQL Query Extras MIS 433. Rerunning the last Query n Type the forward slash “/” to rerun the last query that was entered.
Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts
1 Inside Module 2 Working with Databases Page n Choosing input from databases2 n Reading an entire dataset serially6 n Determining fields in a dataset8.
Advanced File Processing
FIRST COURSE Access Tutorial 1 Creating a Database.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. ACCESS 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 4 – Creating New.
1 Dbedit Editing TurboIMAGE Datasets Page n How can Dbedit help me with my work?3 n Accessing Dbedit 4 n Finding entries with a known key 6 n What if I.
Chapter 3 Single-Table Queries
Working with a Database
XP Chapter 5 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Developing Effective Reports Chapter 5 “Nothing succeeds.
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.
Press Esc to Exit ©2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in.
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Guide To UNIX Using Linux Fourth Edition
1 Data List Spreadsheets or simple databases - a different use of Spreadsheets Bent Thomsen.
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Office Access 2003 Lab 3 Analyzing Data and Creating Reports.
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.
Management Information Systems MS Access MS Access is an application software that facilitates us to create Database Management Systems (DBMS)
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.
Chapter Five Advanced File Processing Guide To UNIX Using Linux Fourth Edition Chapter 5 Unix (34 slides)1 CTEC 110.
1 Single Table Queries. 2 Objectives  SELECT, WHERE  AND / OR / NOT conditions  Computed columns  LIKE, IN, BETWEEN operators  ORDER BY, GROUP BY,
Concepts of Database Management Seventh Edition
Microsoft Office 2007 Intermediate© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! With Microsoft ® Office 2007 Intermediate Chapter.
Transforming TurboIMAGE Data for Eloquence, Oracle, and More By Bob Green, Robelle
XP New Perspectives on Microsoft Access 2002 Tutorial 1 1 Microsoft Access 2002 Tutorial 1 – Introduction To Microsoft Access 2002.
MS Access 2007 Management Information Systems 1. Overview 2  What is MS Access?  Access Terminology  Access Window  Database Window  Create New Database.
SESSION 3.1 This section covers using the query window in design view to create a query and sorting & filtering data while in a datasheet view. Microsoft.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 15 Advanced Tables.
Any Questions? Control Breaks Agenda Control Breaks –Also known as Reports with sub-totals.
Microsoft Office XP Illustrated Introductory, Enhanced Tables and Queries Using.
XP. Objectives Sort data and filter data Summarize an Excel table Insert subtotals into a range of data Outline buttons to show or hide details Create.
5 1 Data Files CGI/Perl Programming By Diane Zak.
Chapter Five Advanced File Processing. 2 Lesson A Selecting, Manipulating, and Formatting Information.
Microsoft Access 4 Database Creation and Management.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
Lesson 13 Databases Unit 2—Using the Computer. Computer Concepts BASICS - 22 Objectives Define the purpose and function of database software. Identify.
McGraw-Hill/Irwin ©2009 The McGraw-Hill Companies, All Rights Reserved Business Driven Information Systems 2e Plug-In T3: Problem Solving Using Excel 2007.
CPSC 203 Introduction to Computers T97 By Jie (Jeff) Gao.
DAY 18: MICROSOFT ACCESS – CHAPTER 3 CONTD. Akhila Kondai October 21, 2013.
Key Applications Module Lesson 22 — Managing and Reporting Database Information Computer Literacy BASICS.
Chapter 11: Sequential File Merging, Matching, and Updating Programming Logic and Design, Third Edition Comprehensive.
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
GO! with Microsoft Office 2016
Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts
Microsoft Office Access 2010 Lab 2
Inside Module 10 Editing TurboIMAGE Datasets Page
GO! with Microsoft Access 2016
MODULE 7 Microsoft Access 2010
Creating and Modifying Queries
Guide To UNIX Using Linux Third Edition
Programming Logic and Design Fourth Edition, Comprehensive
Chapter 14 Sorting and Merging.
Exercise Open the Store database and copy the m-customer dataset into a file called Custfile Then look at the contents of Custfile >base store >get m-customer.
Inside Module 6 Working with Suprlink Page Accessing Suprlink 4
Inside Module 9 Latest Features in Suprtool
Inside Module 5 Working with Files Page Copying files 2
Inside Module 8 Extracting Data Page Using the Extract command 2
Lesson 13 Working with Tables
Presentation transcript:

1 Inside Module 5 Working with Files Page n Copying files 2 n Working with ordinary disc files3 n Defining fields 4 n New or existing files7 n Writing records10 n Listing records13 n Printing reports18 n Calculating field totals20 n Sorting and removing duplicates21

2 Copying files n Copying an MPE file >input file1 >output file2 >xeq n Copying an entire dataset to an MPE file >base store >get m-customer >output custdump >exit

3 MPE files vs HP-UX files n File system differences n Input command requires more information on HP-UX n Reclen n Linefeeds

4 Working with ordinary disc files n A source of input files can be ordinary disc files, such as MPE, KSAM, tape files or POSIX files n You can select, extract, and sort these files n Listing the Custdump file >input custdump >list char >xeq

5 POSIX filespace vs MPE filespace n MPE filenames have three parts: n file.group.account n file.groupaccount is assumed n filegroup and account are assumed n POSIX filenames can have any number of parts: n./fileassumed to be in the current directory n../filein the next level ‘up’ n./Letters/PersonalStuff/Mom n /ACCOUNT/GROUP/FILE n Suprtool can use POSIX files anywhere it can use MPE files n HP-UX files are similar to MPE’s POSIX files

6 Define the record structure n Use the DEFINE command to describe the layout of a flat file >input custdump >define account,17,8 >define lastname,37,16 >define credit,13,4,int;item credit,decimal,2 >extract account,lastname,credit >sort account >if credit > >list standard >xeq May 06, :28 File: CUSTDUMP Page 1 ACCOUNT LASTNAME CREDIT Melander Coyle

7 Let Suprtool maintain field names n Use the INPUT command to tell Suprtool that a file has the same structure as a dataset >input custdump = m-customer >item credit-rating,decimal,2 >extract cust-account,name-last,credit-rating >sort cust-account >if credit-rating > >list standard >xeq May 06, :38 File: CUSTDUMP Page 1 CUST-ACCO NAME-LAST CREDIT-RATING Melander Coyle

8 To create, or not to create -- that is the option n Default is to create a new, permanent file >output custdump n TEMP creates a temporary file >output foo,temp n APPEND adds data to an existing file >output blabla,append n ERASE overwrites an existing file >output subfile,erase

9 To squeeze, or not to squeeze, that is the option n Sometimes output file capacity (limit) is set higher than the number of records (EOF) n Sometimes the limit is squeezed to the EOF to save disc space n You control it with SET SQUEEZE ON or OFF n To reserve space for appending later, use SET SQUEEZE OFF

10 To squeeze, or not to squeeze, what is the default? n If you specify Set Squeeze On or Off, Suprtool will do what you say n If you don’t specify, Suprtool makes up its own mind n The Output file will be squeezed except in these cases: n input is a file, not a dataset n output option is Append or Erase n output option is Ask or Num,Query

11 Writing records n The OUTPUT command determines where your output records go and in what format >output customer,num,data n Select one of these output formats: Data (default) - records are identical to input format Key - records contain only the sort keys Num - records contain 32-bit input record number

12 More common record formats n Additional formats of the OUTPUT command: Num,Key Num,Data Queryancient self-describing Linkimproved self-describing Num,Query AskASK report writer ASCIIhuman-readable Displaycomputer-readable PRNimport to PC program

13 Numrecs controls size of output file n Limit the number of records selected n Limit the size of the sort scratch files n Limit the size of the output file if input is a dataset n Specify the number of records in a tape file n Use percentage >100 with SET SQUEEZE OFF to create output file bigger than input file. This provides space for appending records. >numrecs 100 >numrecs >numrecs 10% >numrecs 200%

14 Listing records n Listing refers to displaying the records in either a dump format or as simple reports n Use the LIST command to produce formatted listings of selected records >list octal,char >list decimal,record >list standard >list hex,char,labels

15 List format of nonself-describing files >in catalog.pub.sys(12/12) >list >exit >IN CATALOG.PUB.SYS (12) >OUT $NULL (12) 00000: Wrong vol 00006: ume on LDev 00014: Another 00022: available (Y 00030: /N)? 00036: SAME TO: :

16 Some List options for reports n ONEPERLINE n NONAME n NOSKIP n STANDARD format n DUPLEX printing n HEADINGS n NOREC

17 Listing one field per line >get m-customer >list oneperline >xeq >GET M-CUSTOMER (1) >OUT $NULL (0) NAME-FIRST= Terry NAME-LAST= Coyle STATE-CODE= AL CUST-STATUS= 30

18 Preparing program input by combining List options n Combine LIST options to format input to other programs >get m-customer >extract name-last, name-first, city, state-code >list norec, noskip, noname, oneperline >file suprlist=myinput,new;save;dev=disc; rec=- 80,,f,ascii;nocctl >xeq n Run the program with the file as input :run dataload.prog;stdin=myinput or.... :run dataload.prog < myinput

19 Printing reports n The LIST command writes to an output file called Suprlist, which defaults to $stdlist n Override the default using a file command :file suprlist;dev=laser155 n Listing to a LaserJet n SET PCL command indicates page orientation and font type

20 Printing mailing labels n Use the EXTRACT command with LIST ONEPERLINE to produce mailing labels >get m-customer >extract " " {blank line} >extract " " {blank line} >extract customer-name >extract street-address(1) >extract street-address(2) >extract street-address(3) >extract " " {blank line} >list oneperline,noname,noskip,norec >xeq

21 Calculating totals in numeric fields n The TOTAL command provides an easy way to sum the contents of one or more numeric fields in selected records >if state-code = "BC" >total sales-total n By default, the result is printed to $stdlist or can be redirected to another device n If you are using the Suprtool2 interface from a programming language, the total amount is returned to the calling program in the workspace

22 Sorting records n Suprtool can sort in several ways n On any field n On any part of an input record, not just previously defined fields n According to multiple sort keys (e.g., primary, secondary) n Ascending or descending order n MPE files require a DEFINE command to define the field or use the KEY command

23 Working with duplicate records n DUPLICATE [ NONE | ONLY ] [ RECORD | KEYS [ n ] ] >duplicate none record >duplicate none keys 1 >duplicate only record >duplicate only keys n DUPLICATE NONE KEYS [ n ] [ COUNT ] [ TOTAL field [ field... ] ] >duplicate none keys count >duplicate none keys total sales-qty sales-value >duplicate none keys count total sales-qty sales-value

24 Discarding duplicates from the output file n Remove duplicates to get a list of unique values or records n Based on the whole record or the sort key(s) >sort cust-account >dup none keys Input file - 6 records Output file - 3 records

25 Saving only the duplicates n Remove “originals” to get a list of duplicate values or records n Exact opposite of DUPLICATE NONE >sort cust-account >dup only keys Input file - same 6 records Output file - the other 3 records

26 Counting records n DUPLICATE COUNT can tell you how many records have the same key Input file - 6 records >get d-sales >sort cust-account >duplicate none keys count Output file - 3 records

27 Totaling records n DUPLICATE TOTAL calculates a field total for all records with the same key Input file - 6 records >get d-sales >sort cust-account >duplicate none keys total sales- total Output file - 3 records

28 Exercises Duplicates, Duplicates, Duplicates, Duplicates n Exercise 1 Create a list of all the states/provinces in which we have customers n Exercise 2 List all the dates on which we made more than one sale n Bonus Exercise 3 List all the sales made on the dates in Exercise 2 HINT: Requires two passes, and the TABLE command

29 How to check Suprtool results n Use the :SHOWJCW command to check the Job Control Word (JCW) after a task has been completed n On MPE V and MPE/iX, the SUPRTOOLOUTCOUNT JCW contains the number of records written to the output file (up to 65,535 maximum) n On MPE/iX, the SUPRTOOLFULLCOUNT variable also contains the output count (no limit) n On HP-UX, -oc option puts count into.stoutcount

30 Summary n Copy a dataset or a file n Define new fields n Select a set of records n Produce listings n Specify record formats n Sorting records n Checking for duplicates