!*********************************************************************** ! Name_of_sqr_file : sqrshell.sqr !*********************************************************************** ! Description: SQR template -- PLUS-- additional program ! logic needed for a typical SQR program and generated report. ! Owner: Dept_that_this_sqr_belongs_to. ! Frequency: How_often_would_this_sqr_be_run. !*********************************************************************** ! Specifications By: Name_of_person_requesting_this program ! Date: Date_when_request_was issued. !*********************************************************************** ! Created By: Arlan Martin ! Date: 03/27/2008 !*********************************************************************** ! MODIFICATION LOG !*********************************************************************** ! Date Description of Change(s) ... so you do not forget ******* ! 04/21/08 Updated basic SQR template with common Heading section, ! PROCESS-Main, and some procedure sections. ! ! !*********************************************************************** #include 'setenv.sqc' !Set environment !*********************************************************************** ! Setup Section !*********************************************************************** ! Subsitution variable used: ! UM_ORIENTATION values: PORTRAIT, LANDSCAPE (default PORTRAIT) ! UM_PRINTER_TYPE values: HPLASER, LINEPRINTER, INDEPENDENT, HTML, CSV, ! POSTSCRIPT (default INDEPENDENT) ! UM_REPORT_OPTION values: SINGLE, MULTIPLE ! SINGLE - Almost always used ! MULTIPLE - Rarely used, set when creating a report for each campus from one program Begin-Setup #define UM_ORIENTATION LANDSCAPE #define UM_PRINTER_TYPE INDEPENDENT #define UM_REPORT_OPTION SINGLE #include 'umseta.sqc' !Please add additional setup commands below this line... #define col_sep 1 #define col_sep2 2 end-setup ! Do Not Change !*********************************************************************** ! Initialize SQR !*********************************************************************** begin-Program do Stdapi-Init do Init-DateTime do Get-Current-DateTime show '' show 'Starting Issue Reporting: ' $AsOfNow ! Please modify the variable values below to your values Let $ReportTitle = 'SQR Sample Report' Let $ReportId = 'SQRShell' LET $BU = ' ' ! Establish selection criteria for report - [Input Parameters] do Get_Input_Parms Let $report_busunit = $BU do Get_Dates do Get-Database-Name ($DBName) show 'Database ID: ' $DBName show '$ReportID: ' $ReportId do Process-Main do Wrap_Up !*********************************************************************** do Get-Current-DateTime show '' show 'Ending Issue Reporting: ' $AsOfNow do Stdapi-Term end-Program !*********************************************************************** ! End of Initialize SQR !*********************************************************************** !*********************************************************************** ! Report Heading Setup !*********************************************************************** Begin-Heading 6 ALTER-PRINTER Point-Size = 8 #include 'umhdra.sqc' !* Set Standard Report Headings ** End-Heading !*********************************************************************** ! End Report Heading Setup !*********************************************************************** ! ToDo - Add your program within Process-Main !*********************************************************************** ! Program entry point !*********************************************************************** begin-procedure Process-Main ! Add your logic here let $DO_Procedure = 'Process-Main' show 'this procedure is required.' ! BEGIN-SELECT on-error=sql-recover ! End-Select end-procedure !********************************************************************* ! End of Program entry point !*********************************************************************** ! ToDo - Add your functional DO procedures here.... !************************ $$$$$$$$$$ ****************************** ! ********************* Misc. Do Procedures ******************** !*********************************************************************** begin-procedure Get_Input_Parms ! Retrieve "Input parameters for SQR" do Get-Value('BusUnit',$BU) show 'Business Unit is: ' $BU end-procedure !************************ $$$$$$$$$$ ****************************** begin-procedure Get_Dates Let $ASOFDATE = datenow() !* Current Date DD-MMM-CCYY ** show '$ASOFDATE: ' $ASOFDATE end-procedure !************************ $$$$$$$$$$ ****************************** begin-procedure get_Person_name let $DO_Procedure = 'get_Person_name' ! BEGIN-SELCET on-error=sql-recover ! End-Select end-procedure !************************ $$$$$$$$$$ ****************************** begin-procedure Print_It ALTER-PRINTER Point-Size = 8 end-procedure !************************ $$$$$$$$$$ ****************************** begin-procedure Wrap_Up end-procedure !************************ $$$$$$$$$$ ****************************** Begin-Procedure sql-Recover show 'Do_Procedure > ' $Do_Procedure display $SQL-Error let $err_msg = $SQL-Error STOP QUIET End-Procedure sql-Recover !************************ $$$$$$$$$$ ****************************** Begin-Procedure show-errors show '+-------------------------------------------------------------+' show $err_msg show '+-------------------------------------------------------------+' STOP End-Procedure show-errors !*********************************************************************** ! **************** End of User Do Procedures ******************* !*********************************************************************** !*********************************************************************** ! Standard Include Files !*********************************************************************** #Include 'curdttim.sqc' !Get-Current-DateTime procedure #Include 'datetime.sqc' !Routines for date and time formatting #Include 'number.sqc' !Routines to format numbers #Include 'reset.sqc' !Reset printer procedure #Include 'stdapi.sqc' !Update Process API #Include 'datemath.sqc' !Date Manipulation functions #Include 'umfunclib.sqc' !UMaine specific functions !*********************************************************************** ! End of Standard Include Files !*********************************************************************** !*********************************************************************** ! Special Include Files !*********************************************************************** !Add any other include files below