Download presentation
Presentation is loading. Please wait.
1
Inside Module 7 Programming with Suprtool2 Page
Calling Suprtool from a program 2 Invoking Suprtool for an end-user 3 Examples of user interfaces for Suprtool functions 4 Prompting users for selection criteria 8 Installing the Suprtool2 routine 9 Three ways COBOL can use Suprtool 11
2
Calling Suprtool from a program
There are two ways to execute Suprtool commands for a program: 1. Run Suprtool first, then run the program 2. Have the program call Suprtool2 Suprtool2 A routine that you can call from application programs to define and execute Suprtool tasks
3
Invoking Suprtool for an end-user
Any 3GL program can invoke Suprtool tasks, including COBOL, QUICK, FORTRAN, TRANSACT, and SPL Call the Suprtool2 interface routine procedure suprtool2 (suprcontrol); array suprcontrol; Each call to Suprtool2 passes one line of commands that can include MPE or Suprlink commands Suprtool functions are invisible to the end-user
4
Suprtool2 control Parm 01 supr-control. 05 supr-version pic s9(4) comp value supr-status pic s9(4) comp supr-ok value zeros supr-bad-msgfile value supr-aborted value supr-create-error value supr-bad-total-type value supr-command-line pic x(256) value spaces. 05 supr-flags supr-priority pic x(2) value spaces supr-priority-cs value "CS" supr-priority-ds value "DS" supr-priority-es value "ES" {continued} COBOL programmers can copy this control record from Cobol.Qlibsrc.Robelle directly into a COBOL program with the following Qedit command: /add 50.1=cobol.qlibsrc.robelle For other programming languages, you can extract the source code from the user manual (Suprcall.Doc.Robelle).
5
Suprtool2 control Parm continued
10 supr-maxdata pic s9(9) comp value supr-print-state pic x(2) value "ER" supr-print-on-error value "ER" supr-print-always value "AL" supr-print-never value "NE" supr-total-type pic x(2) value "CO" supr-total-cobol value "CO" supr-total-ascii value "AS" supr-other-flags pic x(18) value spaces. 05 supr-totals pic s9(17) sign is trailing separate character occurs 15 times. 05 supr-out-count pic s9(9) comp supr-workspace pic x(20) value spaces.
6
Calls to Suprtool2 from a COBOL program
$include cobol.qlibsrc.robelle 00-main section. perform 02-get-if-specs. move "base invory.data,5,dev" to supr-command-line. perform 01-call-suprtool. move "get invrec" to supr-command-line. perform 01-call-suprtool. move if-command to supr-command-line. perform 01-call-suprtool. move "purge selitem" to supr-command-line. perform 01-call-suprtool {continued} This example uses Suprtool to build an extract file that can be processed by a COBOL program. The Suprtool User Manual contains additional examples in other languages, such as TRANSACT, FORTRAN, QUICK and SPL.
7
Calls to Suprtool2 from a COBOL program continued
move "output selitem" to supr-command-line. perform 01-call-suprtool. move "extract item,descript" to supr-command-line. perform 01-call-suprtool. move "sort item" to supr-command-line. perform 01-call-suprtool. move "exit" to supr-command-line. perform 01-call-suprtool. Actual call to Suprtool 01-call-surtoool. call "Suprtool2" using supr-control. if not supr-ok then display "Suprtool interface error number: ", supr-status. Exit The last call must be a line with the Exit command; it must be spelled out fully, left-justified, and it must appear by itself in the supr-command-line buffer. This signals Suprtool2 to execute the preceding command lines.
8
Prompting users for selection criteria from a COBOL program
Use a buffer to format the IF command 01 if-command. 05 filler pic x(9) value "IF ITEM=‘". 05 sel-prefix pic x(4). 05 filler pic x(2) value "‘ ". Code to insert selection criteria into the IF buffer 02-get-if-specs. display "Enter 4-character item prefix to select:". accept input-buf. move input-buf to sel-prefix. Code in main program perform 02-get-if-specs. move if-command to supr-command-line. perform 01-call-suprtool. get-if-specs This paragraph customizes a prepared If command by inserting the selection criteria provided. supr-command-line The final If command is moved to supr-command- line in the main module. Moving Suprtool If you have moved Suprtool to a different account, you can still access it through Suprtool2 by adding a :Setjcw and a :File command to your logon UDC. :setjcw suprtool2filecommand = 2 :file suprtool = suprtool.pub.devutil Netbase or OMNIDEX access If you want to access Netbase or OMNIDEX hooks and run Suprtool with Lib = P instead of Lib = S, you need to set one more JCW. :setjcw suprtool2lib = 1 1 for Lib = P 2 for Lib = G
9
Installing Suprtool2 on MPE V
MPE V uses the CM version of Suprtool2 :run cmprog;lib = p :segmenter {load into your SL file} -sl sl.pub -purgesl segment,suprtool -usl st2usl.pub.robelle -addsl suprtool -exit On MPE V, load the code into your SL file and run your applications with Lib = P. The USL filename is St2usl.Pub.Robelle, and the segment name is Suprtool. If you get an illegal file access error on the -USL command, make a copy of the USL file in your group. :purge tempusl :fcopy from = st2usl.pub.robelle;to=tempusl;new :segmenter -sl sl.pub -usl tempusl
10
Installing Suprtool2 on MPE/iX
MPE/iX uses the NM version of Suprtool2 Run your programs with :run nmprog;xl = "st2xl.pub.robelle" Or copy the module to your own XL file :linkedit -xl xl.pub -copy xl;from = st2xl.pub.robelle;& replace -exit
11
Three ways COBOL programs can use Suprtool
Batch report programs Run Suprtool and create an output file Read and format output file On-line programs Call Suprtool2 routine Pass commands to a Suprtool child process Read Suprtool output file Call Speed Demon routine instead of DBGET to read every record Example One Robelle customer uses the Suprtool2 routine to expedite the delivery time of new equipment. They enter the selection criteria for searching orders. A COBOL program calls Suprtool2 to find the selected order numbers and loads the matching records into another dataset with the report name.
12
Summary Call Suprtool2 routine
Execute Suprtool program as a child process Read results from a file created by Suprtool
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.