A Baker's Dozen Tricks in a Button Thirteen Tricks of the SIR Trade Rolled into a Single Useful Application © Tom Shriver, DataVisor 2002.

Slides:



Advertisements
Similar presentations
How to Import an Excel File Using the SAS Import Wizard SAS 9 for Windows.
Advertisements

1 Appendix A: Writing and Submitting SAS ® Programs A.1 Writing and Submitting SAS Programs.
Georgia Institute of Technology DrJava Appendix A Barb Ericson Georgia Institute of Technology May 2006.
Lesson 13 PROTECTING AND SHARING DOCUMENTS
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Microsoft Office Illustrated Using Advanced Features.
1 Lab Session-I (A and B) CS-120 Fall 2000 Using Windows Using An Editor Using Visual C++ Using Compiler Writing and Running Programs Lab-1 DUE Fri September.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2006 Microsoft Corporation.
FIRST COURSE Creating Web Pages with Microsoft Office 2007.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Word Project 8 Working with Macros and Visual Basic for Applications (VBA)
Open and save files directly from Word, Excel, and PowerPoint No more flash drives or sending yourself documents via Stop manually merging versions.
Creating a Console Application with Visual Studio
Outlook 2007 Tips, Tricks, and Tools. Overview Main Screen Navigation Pane View Pane Reading Pane To–Do Bar Create a New Message Contacts Create a Signature.
Working with SharePoint Document Libraries. What are document libraries? Document libraries are collections of files that you can share with team members.
TrendReader Standard 2 This generation of TrendReader Standard software utilizes the more familiar Windows format (“tree”) views of functions and file.
START EXCEL BUILD OR RETRIEVE YOUR OPTIMIZATION MODEL SAVE YOUR WORKBOOK!! CHOOSE “Solver…” IN THE “Tools” MENU SPECIFY IN SOLVER DIALOG BOX: 1.CELL TO.
A First Program Using C#
Making ODBC easier By Dave Doulton University of Southampton.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 Exploring Microsoft Office Word 2007 Chapter 7 The Advanced User Robert Grauer, Keith Mulbery,
Introducing Dreamweaver MX 2004
Tutorial 1 Getting Started with Adobe Dreamweaver CS3
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
Mail merge I: Use mail merge for mass mailings Perform a complete mail merge Now you’ll walk through the process of performing a mail merge by using the.
Southampton University Computing Services Implementing Web data access using sirweb.cgi By Dave Doulton University of Southampton.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
A1 Visual C++.NET Intro Programming in C++ Computer Science Dept Va Tech August, 2002 © Barnette ND & McQuain WD 1 Quick Introduction The following.
Alice 2.0 Introductory Concepts and Techniques Project 1 Exploring Alice and Object-Oriented Programming.
Converting SIR 3.2 Databases to SIR2002 A Practical Guide to Coming of Age in SIR Land © Tom Shriver, DataVisor 2002.
Teacher’s Assessment Assistant Worksheet Builder Starting the Program
Introduction to Engineering MATLAB – 6 Script Files - 1 Agenda Script files.
GDT Development Tutorial. GDT Development Tutorial Doug Evans and Detlef Lexut GDT 2008 International User Conference August 10 – 13  Lake Las Vegas,
CPSC1301 Computer Science 1 Overview of Dr. Java.
PowerTeacher with Web Grade Book Semester Classes School Year August 2012.
Basic & Advanced Reporting in TIMSNT ** Part Two **
22/10/ June Changes I have seen. What I like about SIR/XS.
Diagnostic Pathfinder for Instructors. Diagnostic Pathfinder Local File vs. Database Normal operations Expert operations Admin operations.
ISU Basic SAS commands Laboratory No. 1 Computer Techniques for Biological Research Animal Science 500 Ken Stalder, Professor Department of Animal Science.
Advanced samples Printing two types of labels from two different custom forms We have two different labels that contain the same data. One is suitable.
Heartbase May 9-11, 2005SIR users’ conference Report Writing with heartbase Report Writing with heartbase.
Lesson 10 - Mail Merge and Reviewing Documents Advanced Microsoft Word.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
Implementing and Using the SIRWEB Interface Setup of the CGI script and web procfile Connecting to your database using HTML Retrieving data using the CGI.
How to Setup and Score a Tournament May Let’s Get Organized The setup and organization outlined in this clinic are suggested steps however can be.
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
The Diagnostic Pathfinder System Introduction Getting Started.
Matthew Glenn AP2 Techno for Tanzania This presentation will cover the different utilities on a computer.
4 Copyright © 2004, Oracle. All rights reserved. Creating a Basic Form Module.
SIRxs in Review aka The Joys of XS Presented at SIR-UK Conference Dublin, Ireland, June 2008 © Tom Shriver, DataVisor 2008.
1 Chapter 3: Getting Started with Tasks 3.1 Introduction to Task Dialogs 3.2 Creating a Listing Report 3.3 Creating a Frequency Report 3.4 Creating a Two-Way.
Customizing the SIR Menu System Managing the Interactive SIR-RDBMS User Environment © Tom Shriver, DataVisor 2002.
GDT Tips and Tricks. GDT Tips and Tricks Doug Evans GDT 2004 International User Conference – Evolving the Legacy July  Tucson, Arizona GDT Tips.
Creating New Forms Projects can appear more professional when using different windows for different types of information. Select Add Windows Form from.
Troubleshooting Dashhawk Issues. Here's what you have to do to have the DashHawk run properly Go to the ACTUAL PROGRAM file (not the short cut)
NextGen Trustee GL/Accounting This class will cover NextGen Financial Management for Trustee Offices. We will look at GL accounts, Transactions, Bank Reconciliation,
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Introduction Purpose  This training course demonstrates the use of the High-performance.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 11 Creating Web Applications and Writing Data to a Database.
June 17, 2009 Office 2007 Tips & Tricks.
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Working in the Forms Developer Environment
Creating a Basic Form Module
Appendix A Barb Ericson Georgia Institute of Technology May 2006
NextGen Trustee General Ledger Accounting
SIRxs in Review aka The Joys of XS Presented at SIR-UK Conference
Workshop for Programming And Systems Management Teachers
Presentation transcript:

A Baker's Dozen Tricks in a Button Thirteen Tricks of the SIR Trade Rolled into a Single Useful Application © Tom Shriver, DataVisor 2002

For Web Based Viewers of this Presentation This presentation demonstrates several SIR and PQL programming techniques by explaining a single application. A working version of the COMPANY database available from DataVisor demostrates this application and contains all the PQL code. This code is easily adapted to any SIR database (SIR2000 or SIR2002). A CD containing these (and other) demonstration materials was distributed at the SIR UK Conference in Aberdeen, Scotland, June For a free copy of these materials, contact DataVisor by at:

Thirteen Tricks ©2002 Tom Shriver, DataVisor3 Everyday Problem and a Suggested Solution u Problem: Starting a New PQL Program n We need another new PQL Retrieval n We start writing the same 20 lines of code n We add a few Variations u Solution: Make a Menu Option or Button n That writes the skeleton n That has the bells and whistles you conveniently forgot

Thirteen Tricks ©2002 Tom Shriver, DataVisor4 What do we want the button to do? 1. Create Starter PQL Code uThat is Efficient uThat has the tricky code already written u Commonly Used User Prompts u Date Booleans u Tabulate Structure 2. Give us some options uFilename or Member name uOutput (Report) Filename uPrompt for Common Parameters uPost Processing Options (e.g. Print, Display)

Thirteen Tricks ©2002 Tom Shriver, DataVisor5 13 Tricks at a Glance

Thirteen Tricks ©2002 Tom Shriver, DataVisor6 The Baker's Dozen Tricks 1. Generate PQL Program 2. Automatically Edit PQL & make it SIR Default File 3. Run Many Programs in one Procedure 4. Prompt for Date Range (allow human formats) 5. Abort Complex Procedure Midstream 6. Disconnect & Reconnect Master for Speed 7. Use "Template Code" for PQL Procedures 8. Post Process PQL Output (only if PQL Runs OK) 9. EDIT Output File 10. Print Output File 11. Display as Web Page 12. Start other Software that uses PQL Output (e.g. SPSS) 13. Do it all with a Customized Button

Thirteen Tricks ©2002 Tom Shriver, DataVisor7 1. Generate a PQL Program 1. Create a Template of the PQL (TRICKS.BASE_PQL) 2. Write a PQL Program, a VisualPQL Dialog (TRICKS.RUNPMT) that: 1.Prompts for Output File Name 2.Prompts for Other Customizations 3.Reads PQL Template 4.Inserts Customizations where Necessary 5.Writes all to the New File when Done

Thirteen Tricks ©2002 Tom Shriver, DataVisor8 2. Automatically Edit Generated PQL & Make it the SIR Default Edit File 1. After the " END PROGRAM " of Generator Program, use the DBMS Any-Time Command: EDITFILE "file_name" PROGRAM. WRITE(NEW.PQL)"c This is my New PQL Program" END PROGRAM EDITFILE "NEW.PQL" 2. In the Generator Program, set Global FILENAME with name of PQL File. SIR uses this global when you invoke the File Editor. COMPUTE FNAME="NEW.PQL" COMPUTE N = GLOBALS("FILENAME",FNAME)

Thirteen Tricks ©2002 Tom Shriver, DataVisor9 3. Put Many Programs and Procedures in a Single Command Set u All DBMS commands & command sets allowed oPQL oDBMS Anytime Commands oUtilities oSchema Definition oCompiler Controls (CIF) u Later Commands Use Results of Earlier Ones u Have to Make Sure all Possibilities are handled

Thirteen Tricks ©2002 Tom Shriver, DataVisor10 4. Prompt for Dates & Date Ranges (allow human date formats and variations)  Single most frequently used booleans are to limit retrievals by date or date ranges. Create a standard way to do this (TRICKS.DATERANG) u Since Y2K we've formatted our dates with 4 digits for the year – makes for lots of typing u Users would prefer to enter strings like "1 1 2" for "Jan "  A PQL program can interpret these, expand them and put them in globals for later use (TRICKS.DATEEDIT)

Thirteen Tricks ©2002 Tom Shriver, DataVisor11 5. Abort Procedures Midstream u In Complex Procedures, user may request an abort u How to Stop things Midstream? 1. In First Program, set an "Abort" global 2. After Program, use Conditional Compilation ( CIF ) 3. FINISH command stops everything PROGRAM. compute n = globals("ABORT","YES") END PROGRAM c this comment is very important CIF EQ " ", "YES" FINISH CIF END

Thirteen Tricks ©2002 Tom Shriver, DataVisor12 6. Disconnect & ReConnect Master to Speed Up Retrievals (NoUpdate) Check if Master is Connected with SYSTEM(38) n Set a Global Variable to Remember Setting DBMS Command CLEAR MASTER Disconnects PROGRAM | TRICKS.MSTCLEAR. COMPUTE MST_STAT = SYSTEM(38). COMPUTE X=GLOBALN('MSTSTAT',MST_STAT). IF(MST_STAT = 1)EXECUTE DBMS 'CLEAR MASTER' END PROGRAM n ReConnect with: PROGRAM | TRICKS.MSTSET. COMPUTE MST_STAT =. IF(MST_STAT = 1)EXECUTE DBMS 'SET MASTER' END PROGRAM

Thirteen Tricks ©2002 Tom Shriver, DataVisor13 7. Use Template Code for PQL Procedures u Figure out Tricky Procedures Once u Have the Program Generator Insert Needed Code u You modify the Template, e.g. change variables

Thirteen Tricks ©2002 Tom Shriver, DataVisor14 8. Post Process PQL Output (only if PQL Program ran Successfully) n Anything you typically do after you run a PQL program is a candidate for Post Processing Options oEdit, Print, Modify, Use with other Software n But you Only want to Post Process if PQL was OK oTERROR system global has count of errors oConditionally Compile the Post Processing Code

Thirteen Tricks ©2002 Tom Shriver, DataVisor15 9. Edit the PQL Output File 10. Print the PQL Output File Set Filenames in a Standard Global (e.g. REPFILE ) n Use Global in Procedure Definitions Use DBMS EDITFILE command to Edit Use DBMS PRINT FILE command to Print GLOBAL REPFILE = GENDER.REP PROGRAM. PROCESS REC 1. GET VARS GENDER. PERFORM PROCS. END REC FREQUENCIES INTEGER = GENDER(1,2) / FILENAME=" " END PROGRAM c EDITFILE " " PRINT FILE " "

Thirteen Tricks ©2002 Tom Shriver, DataVisor Format & Display as a Web Page (HTML)  Use HTML Option on some Commands like TABULATE  Post Process Output and Add HTML commands ( DVPROCF.DVTOOLS.MKHTMTX, DVPROCF.DVTOOLS.MKHTMTAB )

Thirteen Tricks ©2002 Tom Shriver, DataVisor Start other Software Using Output u SIR Interface Procedures: SPSS, SAS, etc GLOBAL REPFILE = GENDER.REP PROGRAM. PROCESS REC EMPLOYEE. GET VARS ALL. PERFORM PROCS. END REC SPSS SAVE FILE FILENAME=" " / VARIABLES = ALL END PROGRAM c PROGRAM. DISPLAY YESNOBOX 'Start SPSS?' RESPONSE YN. IFNOT(YN=1)STOP. PQL ESCAPE ' "C:\Program Files\SPSS\SPSSWIN.EXE" '. END PROGRAM

Thirteen Tricks ©2002 Tom Shriver, DataVisor Pull it All Together with a Custom Tool Bar Button n Several Methods to Add a Button (or Menu Item) oCopy, Edit & ReCompile SYSPROC.SYSTEM.MAINMENU oUse DVMenu Dialog Tool n To Edit MainMenu oDeclare Integer Variable as a Menu Item Alias oAssign a Value not Given to Other Menu Item Aliases oDefine Button: TBARITEM MKPQL, "MKPQLPIC","PQL Starter",0 oDefine what to do if item is selected IF(ID=MKPQL)execute dbms "CALL TRICKS.PQLSTART" oSave, Run, Exit SIR, Start SIR again to see changes