************************************************************************* ** ** Source File Name = monreset.cbl ** ** Licensed Materials - Property of IBM ** ** (C) COPYRIGHT International Business Machines Corp. 1995, 2000 ** All Rights Reserved. ** ** US Government Users Restricted Rights - Use, duplication or ** disclosure restricted by GSA ADP Schedule Contract with ** ** PURPOSE : ** to demonstrate the use of the RESET DATABASE SYSTEM ** MONITOR DATA AREAS. ** ** APIs USED : ** RESET MONITOR sqlgmrst() ** ** For more information about these samples see the README file. ** ** For more information on Programming in COBOL, see the: ** - "Programming in COBOL" section of the Application Development Guide. ** ** For more information on Building COBOL Applications, see the: ** - "Building COBOL Applications" section of the Application Building Guide. ** ** For more information on the SQL language see the SQL Reference. ** ************************************************************************* Identification Division. Program-Id. "monreset". Data Division. Working-Storage Section. copy "sqlutil.cbl". copy "sqlca.cbl". copy "sqlmonct.cbl". * Local Variables 77 rc pic s9(9) comp-5. 77 errloc pic x(80). * variables for RESET DATABASE SYSTEM MONITOR DATA 01 database. 05 database-length pic s9(4) comp-5 value 6. 05 database-name pic x(8) value "sample". Procedure Division. reset-pgm section. display "Sample COBOL Program : monreset.cbl". display "Reset Database Monitor Data for sample database". ******************************************************* * RESET DATABASE SYSTEM MONITOR DATA AREAS API called * ******************************************************* call "sqlgmrst" using by value database-length by value 0 by reference SQLCA by reference database-name by value SQLM-OFF by value 0 by value SQLM-DBMON-VERSION2 returning rc. move "RESET DB MONITOR" to errloc. call "checkerr" using SQLCA errloc. display "Database Monitor Reset for sample was successful". end-reset. stop run.