Easily Modify Report Programs (because you have better things to do) Ted Holt Sr. Software Developer, Profound Logic Software Sr. Technical Editor, Four.

Slides:



Advertisements
Similar presentations
iSeries Database Files
Advertisements

MASTER QUOTE OVERVIEW.
Chapter 2: Modularization
Machine Independent Assembler Features
WIN-202 System QCEW Technical Conference Philadelphia, PA June 16, 2005.
System Design System Design - Mr. Ahmad Al-Ghoul System Analysis and Design.
Programming Logic and Design Fourth Edition, Introductory
Slide 1 Word Processing. Slide 2 What is a word processor? A word processor is a computer that you use for writing, editing and printing text. A dedicated.
Access - Project 1 l What Is a Database? –A Collection of Data –Organized in a manner to allow: »Access »Retrieval »Use of That Data.
Output Design Dr. Merle P. Martin CSU Sacramento.
A Guide to SQL, Seventh Edition. Objectives Understand the concepts and terminology associated with relational databases Create and run SQL commands in.
Modules, Hierarchy Charts, and Documentation
Welcome to SAS…Session..!. What is SAS..! A Complete programming language with report formatting with statistical and mathematical capabilities.
Sage Library Consortium Cataloging-in-Publication MARC record conversion.
CS1100: Access Reports Microsoft Access Report Construction Created By Martin Schedlbauer CS11001Microsoft Access.
Unit J: Creating a Database Microsoft Office Illustrated Fundamentals.
Presentation © Copyright 2002, Bryan Meyers Defining Data with Definition Specifications Chapter 3.
Copyright © 2003 by Prentice Hall Module 4 Database Management Systems 1.What is a database? Data hierarchy and data organization Field, record, file,
Microsoft Office Illustrated Fundamentals Unit L: Creating Database Reports.
Getting Started Chapter 2 Presentation © Copyright 2002, Bryan Meyers
IS 320 Notes for Chapter 8. ClassX Problems: Low-Tech Fix Use last year's videos on ClassX  Select "Semesters" tab  Select IS 320  Select the week/lecture.
Chapter 9 Designing Databases Modern Systems Analysis and Design Sixth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
1 © 2000 John Urrutia. All rights reserved. Qbasic Constructing Qbasic Programs.
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Office Access 2003 Lab 3 Analyzing Data and Creating Reports.
Presentation © Copyright 2002, Bryan Meyers Externally Described Files Chapter 6.
SAS Efficiency Techniques and Methods By Kelley Weston Sr. Statistical Programmer Quintiles.
Agenda Reporting Work on Assignment 4! Printing on power systems.
TSH User Group Meeting 2010 MDS Enhancements TSH User Group Meeting 2010.
Printing on power systems Program/ Command Data Report Layout (Printer File) Job Output Queue *FILE Spooled File.
Computer Literacy BASICS: A Comprehensive Guide to IC 3, 5 th Edition Lesson 23 Getting Started with Access Essentials 1 Morrison / Wells / Ruffolo.
Objectives Set the margins of a document. Align text.
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.
Welcome to RPG544. Bit about Cindy Administrative Stuff Standards Due Dates Web Page.
INPUT / OUTPUT STATEMENTS
DBT544. DB2/400 Advanced Features Level Check Considerations Database Constraints File Overrides Object and Record Locks Trigger Programs.
Worksheet for a Service Business
Database Management Systems (DBMS)
Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.
1.  Introduction  The Benefits of the Report Writer Module ◦ For Detail and Summary Printing ◦ For Control Break Processing ◦ For Printing Headings.
COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
Fun!(damental) and Fun!(ctional): An Introduction to Table-driven Programming Ted Holt Sr. Software Developer, Profound Logic Software Sr. Technical Editor,
CSCI 161 Lecture 3 Martin van Bommel. Operating System Program that acts as interface to other software and the underlying hardware Operating System Utilities.
A Guide to SQL, Sixth Edition 1 Chapter 7 Reports.
Chapter 2 Page ref. Chapter 2 Customizing QuickBooks 53.
McGraw-Hill/Irwin Introduction to QuickBooks Pro, 2004 © 2005 The McGraw-Hill Companies, Inc., All Rights Reserved. Chapter 11 Customizing QuickBooks.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 5 & 6 By Ravi Mandal.
LESSON 5-2 Bank Reconciliation
How’s assignment 1 coming? Winter 2007
GO! with Microsoft Office 2016
RPG Programming with Printer Files
IBC233 Week 6.
Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts
Yoel Kortick Senior Librarian
GO! with Microsoft Access 2016
RPG Programming with Printer Files
While Loops BIS1523 – Lecture 12.
Any Questions?.
An Introduction to Structured Program Design in COBOL
Structured COBOL Programming
LESSON 5-2 Bank Reconciliation
CHAPTER 17 The Report Writer Module
LESSON 5-2 Bank Reconciliation
Machine Independent Assembler Features
Machine Independent Assembler Features
LESSON 5-2 Bank Reconciliation
Microsoft Office Illustrated Fundamentals
IBC233 Week 5.
IBC233 Lecture 3 Updated Fall 2011
Alternate graphic representation 880 field
OUTPUT DESIGN PRINT K, expression list K FORMAT (specification list)
Presentation transcript:

Easily Modify Report Programs (because you have better things to do) Ted Holt Sr. Software Developer, Profound Logic Software Sr. Technical Editor, Four Hundred Guru

Agenda Definitions and background The "Cletus" method An example

3 Format of Columnar Reports Contributions 3/17/15 Page 1 Shift Name Amount ===== ======================== ====== 1 Fife, Bernard P Haywood, Jesse W Shift total Heggs, Luther Figg, Hollis Shift total Grand total 45.00

4 Traditional Methods of Report Definition Output specifications DDS Remember these?

5 Problem with Traditional Methods Making one change... Adding a column Deleting a column Moving a column Resizing a column

6 Problem with Traditional Methods requires making more changes. Adjust column headings, detail lines, subtotals, and grand totals.

Problem with Traditional Methods Modifying DDS and O specs by hand is tedious. RLU stinks.

Agenda Definitions and background The "Cletus" method An example

9 A Different Approach Published in Four Hundred Guru on April 14, 2004 "An Alternative to Externally Described Printer Files" Updated "An Alternative to Externally Described Printer Files, Take 2"

10 Advantages of the "Cletus" Method Column headings, detail line, and total lines adjust together.

11 Advantages of the "Cletus" Method Spacing and skipping are easily controlled with simple assignment statements.

12 Advantages of the "Cletus" Method Most of the report logic is reusable code in a template.

13 The PrintLine Data Structure Length is the record length Defines the columns of a report All subfields are alpha

14 The PrintLine Data Structure Includes unnamed spacer fields to separate the columns Overlapping columns may be defined with OVERLAY keyword.

15 The PrintLine Data Structure D PrintLine ds 132 D Column01 7 D 1 D Column02 25 D 1 D Column03 7 D 2 D Column04 15

16 The PrintLine Data Structure D PrintLine ds 132 D ColCusNo 7 D 1 D ColCusName 25 D 1 D ColQtySold 7 D 2 D ColAmount 15

17 Loading the Data Structure Use same structure for column headings, detail lines, and column totals

18 Loading the Data Structure Use EVAL for character data Use EVALR for numeric data

19 Loading the Data Structure Use %EDITC and %EDITW functions to load numeric fields

20 Loading Column Headings eval Column01 = 'State' eval Column02 = 'Name' evalr Column03 = 'Account' eval Column04 = 'City' exsr Print

21 Loading a Detail Line eval Column01 = State eval Column02 = %trimr(LstNam) + ' ' + Init evalr Column03 = %editc(CusNum:'4') eval Column04 = City exsr Print

22 Loading Column Totals eval Column02 = State + ' total' evalr Column04 = %editc(Count:'3') eval SpaceBefore = DoubleSpace exsr Print Note: There is no need to load unused columns because each write clears the data structure.

23 Spacing and Skipping Use a printer control data structure to control spacing and skipping. FPAY922P o f 132 printer prtctl(PrtCtl) F oflind(Overflow) D PrtCtl ds D SpaceAndSkip 1 12 D SpaceBefore 1 3 D SpaceAfter 4 6 D SkipBefore 7 9 D SkipAfter D CurrentLine 13 15s 0

24 Spacing and Skipping If SpaceAndSkip is blank, the program assumes you want to space once before printing.

25 Writing to the Printer Use the WRITE opcode with the printer file name in factor 2 and the data structure in the result field. write Pay922P PrintLine

26 Features of the Template Single spacing (before) is assumed. The printer data structure and spacing/skipping data structure are always cleared after writing to the printer.

27 Features of the Template Predefined spacing and skipping constants improve readability. Works with SQL input (my preference) or input opcodes (e.g., READ).

Agenda Definitions and background The "Cletus" method An example

29 Example Time Programs DEMO1C (CL driver) and DEMO1R (Report program) File QCUSTCDT is in library QIWS.

30 Example Time DEMO1C (CL driver) pgm ovrdbf qcustcdt share(*yes) opnqryf qcustcdt + keyfld((state) (lstnam) (init)) call demo1r clof qcustcdt dltovr qcustcdt endpgm

31 Example Time Fqcustcdt if e disk prefix(C_) Fqsysprt o f 132 printer oflind(Overflow) F prtctl(PrtCtl) Program described

32 Example Time D PrtCtl ds D SpaceAndSkip 1 2 D SpaceBefore 1 3 D SpaceAfter 4 6 D SkipBefore 7 9 D SkipAfter D CurrentLine 13 15s 0

33 Example Time D SingleSpace c '001' D DoubleSpace c '002' D NoSpacing c '000' D TopOfForm c '001'

34 Example Time D PrintLine ds 132 D Column01 7 D 1 D Column02 25 D 1 … 3 columns omitted D Column06 12 D 1 D Column07 2

35 Example Time D SaveState s like(C_State) D CdtDue1 s like(C_CdtDue) D CdtDueR s like(CdtDue1) D BalDue1 s like(C_BalDue) D BalDueR s like(BalDue1)

36 Example Time // subroutine PrintDetail Column01 = C_State Column02 = %trimr(C_LstNam) + ' ' + C_Init evalr Column03 = %editc(C_CusNum:'4') Column04 = C_City evalr Column05 = %editc(C_CdtDue:'J') evalr Column06 = %editc(C_BalDue:'J') exsr Print

37 Example Time // subroutine PrintHeaders DoubleStrike = True PageNbr += 1 PrintLine = 'Customer List by State (' + %trim(psdsProcName) + ') ' + %editc(psdsSysDate:'Y') + ' ' + %editw(psdsSysTime:' : : ') + ' Page ' + %char(PageNbr) SkipBefore = TopOfForm exsr Print

38 Example Time evalr Column03 = 'Account' evalr Column05 = 'Credit' evalr Column06 = 'Balance' SpaceBefore = DoubleSpace exsr Print

39 Example Time // control totals Column02 = ' ' + SaveState + ' total' evalr Column05 = %editc(CdtDue1:'J':*CurSym) evalr Column06 = %editc(BalDue1:'J':*CurSym) eval Column07 = '*' SpaceBefore = SingleSpace SpaceAfter = SingleSpace exsr Print

40 Quizzette How would you make the following changes? 1.Allow 5 fewer positions for the name. 2.Add 2 spaces between credit due and balance due.

41 Quizzette 3.Double-space the detail lines. 4.Double-strike the control totals and grand total. 5.Put the city column after state?

EVAL *INLR = *ON;