QUIZ is a report generator used for basic inquiries into a database. This document is designed to give an introduction to Quiz with examples that can be followed. The client can work through the examples step by step. New commands and suggestions are added with each example to help build Quiz proficiency. For information on file and field names used, please request a copy of the Student Information Data Dictionary. For more information and documentation on QUIZ please contact your computer support analyst.
Interactive Quiz Session
To run Quiz simply choose QUIZ from the system utilities menu. Quiz responds with a few informative messages and displays the prompt ">".
To access student information issue the command:
>SET DICT SIQDB.PROD.ADMIN
If your logon is not on the Admin system, type the command:
This will point all Student Information files to the right group so the client may access them. To access a different system contact your computer support analyst.
To exit QUIZ and return to the select menu screen simply enter "EXIT" or "E".
Three commands are required in every Quiz program:
ACCESS - identifies the file(s) to be read. (A list of files available can be obtained by entering the command SHOW FILES.)
REPORT - specifies the fields (data) to be reported. (A list of items (fields) in the file(s) accessed can be obtained by entering the command SHOW ITEMS.)
GO - starts the actual processing of the Quiz program.
Other Useful Commands:
SELECT - specifies a particular set of data records to be reported, thus eliminating unwanted records. The selection criteria can be based on:
< or LT = less than <= or LE = less than or equal to = or EQ = equal to >= or GE = greater than or equal to > or GT = greater than <> or NE = not equal to
SORT - organizes the data in a logical order such as alphabetically by student name.
SET REPORT LIMIT - determines the number of records to be reported. When practicing and testing, report limit should be set low for fast results.
The following Quiz program accesses the file "COURSE", finds up to 25 English 101 sections for fall 1988, and reports session and course information as well as instructor name. The records will be reported in alphabetical order by instructor name.
ACCESS COURSE SELECT IF SESSION-CRS-SEC > "AF88ENGL 101 00 " AND & SESSION-CRS-SEC < "AF88ENGL 101 99 " SORT ON INSTR-NAME SET REPORT LIMIT 25 REPORT SESSION-CRS-SEC CLASS-DESCRIP INSTR-NAME GO
Tips and Notes:
- Because this is a learning session the report limit has been set low, thus only the first 25 English 101 students from the database will be reported.
- The "&" is a continuation character. In this example the "&" signifies that the SELECT command uses two lines.
- If a mistake is made, Quiz lets the client know! Quiz checks spelling and syntax (Quiz is picky). Simply re-enter the erroneous command in its entirety; do not re-enter the entire program, only the erroneous command(s).
- If Quiz prompts with a "?" simply press the return key to receive the Quiz prompt ">".
- Once the client EXITs Quiz the program created will be gone.
- For help type HELP within Quiz.
Qedit Files and Quiz
Even though Quiz can be run interactively it is much more practical to create an MPE/iX file which can be "USE"'d in Quiz. Combining an editor file and Quiz makes the process of writing a Quiz program much simpler. If actually writing a program in Quiz there is not the ability to correct a typographical error by merely changing the erroneous letter or word; the client must re-enter the entire command. In QEDIT corrections can be made to the character(s) in error. (Note, a line is not necessarily a complete command e.g., the select command in example 1 is contained on two lines. Also, Quiz programs can be kept thus making them easy to modify and run at a later time.)
Combining Qedit and Quiz:
- Create a Quiz program in QEDIT by building a new file, entering the QUIZ commands as lines of text, and keeping the file. Refer to the section in this document with instructions on QEDIT if not familiar with it.
- Enter Quiz to test the program. Once in Quiz enter: USE filename.
- If there are errors in the program go back to the editor and correct them.
- Enter Quiz to retest the program (USE filename).
- Repeat steps 3 and 4 until the program is working.
LINK TO - is an extension of the ACCESS command which allows data to be gathered from more than one file on the database.
FINAL FOOTING - reports summary information on the data selected.
USE - instructs Quiz to use a program which has been created and kept with an editor.
The following program produces a report sorted on the students' names by listing the Name, ID, Class-level, Permanent Address, and Total Count of Chemistry students in the College of Arts and Sciences who are registered or pre-registered for the academic fall session 1988.
(Create the following quiz program file in QEDIT)
Type: NEW MYQUIZ
Then ADD the following lines:
SET DICT SIQDB.PROD.ADMIN :SIFILES ACCESS REG-BY-SESSION & LINK TO ADM-BY-DIV & LINK TO ADDRESS & LINK TO INQUIRY SELECT IF SESSIONRBS = "AF88" AND & (ACTIVITY-CODE = "R" OR & ACTIVITY-CODE = "P") AND & DIVISION-AV = "A" AND & COLLEGE-CODE = "1" AND & MAJOR-1-A = "1905" AND & ADDRESS-TYPE = "P" SORT ON NAME-LEGAL SET REPORT LIMIT 10 REPORT NAME-LEGAL ID ADDRESS-LINE1 CITY STATE NOREPORT "No records with the desired selection criteria were selected" FINAL FOOTING "TOTAL STUDENTS =" COUNT GO //
Then KEEP the program file. The client may or may not exit QEDIT, depending on which is preferred.)
If client exited QEDIT then access QUIZ from menu and enter the following:
>USE MYQUIZ (Quiz will run the program)
Tips and Notes:
- Because the report limit is set low for testing a full report of students will not be listed.
- Indentation, (as in the ACCESS statement), isn't necessary but makes the program easier to read.
- All the selection criteria in the SELECT command must be met for the record to be reported. Notice the "OR" above is set off by parentheses. This tells Quiz that either of the two criteria may be met for the record to be selected, whereas all other conditions must be met.
- The final footing command will cause a "COUNT" of all records selected to be listed. This count will be preceded by the title "TOTAL STUDENTS".
- The use of an editor gives the ability to change portions of the program with a minimum of effort, e.g.; To sort on ID instead of Name simply change the SORT command using QEDIT.
- When reporting the same fields in headings, report, footings, and final footings the client may wish to use the ALIGN statement. To align all like fields in the report issue the command SET REPORT ALIGN. The option also may be used with all heading and/or footing statements.
The SUBFILE option in Quiz allows the client to direct the output to a file to be used for additional database access and reporting, or to transfer to a PC if desired. The following example shows how to create a Quiz subfile.
SET DICT SIQDB.PROD.ADMIN :SIFILES ACCESS REG-BY-SESSION & LINK TO ADM-BY-DIV & LINK TO ADDRESS & LINK TO INQUIRY SELECT IF SESSIONRBS = "AF88" AND & (ACTIVITY-CODE = "R" OR & ACTIVITY-CODE = "P") AND & DIVISION-AV = "A" AND & COLLEGE-CODE = "1" AND & MAJOR-1-A = "1905" AND & ADDRESS-TYPE = "P" SORT ON NAME-LEGAL SET REPORT LIMIT 10 SET SUBFILE NAME MYSUB KEEP REPORT SUMMARY NAME-LEGAL ID CLASS-LEVEL ADDRESS-LINE1 CITY STATE GO
In the above SUBFILE command, the command NAME is included and followed by the name the client wishes to call the subfile. If the NAME is omitted (followed by name the client gives the file) the name of the subfile will default to QUIZWORK. The KEEP command is not required. If the client does not issue the KEEP command the subfile will only be a valid file during the logon period and not accessible by any other person. When the client logs off the file will be gone.
The SUMMARY command after REPORT tells Quiz not to print the information that will be stored in the subfile. If the client does not have the SUMMARY command, the data will print.
This file now can be accessed by other clients, downloaded to the PC (see SHEETMATE section) or used for more advanced functions. The following example shows the subfile MYSUB created from the student information system linking to the transcript database. The subfile in the ACCESS statement must be first and preceded by *.
ACCESS *MYSUB link ID to ID of ISU-CREDITS
When linking to a large dataset (such as ISU-CREDITS), processing time can be greatly reduced by first creating a subfile with the selected data, then linking to the larger dataset.
The client may also create indexed subfiles. Indexing creates a direct key access into the subfile. Indexed subfiles may be linked together. The following is a SUBFILE command that includes the index option. The item indexed MUST be included in the REPORT statement:
ACCESS INQUIRY SET SUBFILE NAME MYSUB INDEX ID REPORT SUMMARY NAME-LEGAL DATE-OF-BIRTH ID GO
A maximum of 16 indexes may be specified.
SET SUBFILE NAME MYSUB INDEX ID, INDEX NAME-LEGAL, INDEX DATE-OF-BIRTH, ...
Indexed subfiles can be linked together. The following is an example of linking 2 indexed subfiles.
ACCESS *MYSUB LINK ID TO SSN OF *OLDSUB
Deferred Processing and Quiz
Now with a working knowledge of Quiz the client is ready to move on to create production reports to be used by the department. This involves combining a knowledge of QEDIT, QUIZ, and STREAMX (see the appropriate sections of this manual). By adding a few MPE/iX commands to the beginning and end of the editor Quiz file a Quiz program can be run at a later time freeing the client and the terminal for other tasks.
Creating Production Reports
- Create the program file with QEDIT.
- Test the program with Quiz.
- Set the report limit to the actual number of records to be selected.
- Stream the Program (see the section STREAMX; ie. STREAMX filename).
- Pick up the printed report from Production and Reporting the next morning.
DEFINE - allows creation of specific data fields to be reported.
SET REPORT DEVICE PRINTER - tells Quiz to send the report to the printer instead of the terminal.
This program produces a printed report sorted on GPA listing the ID, Class-Level, and GPA of Biology students in the College of Arts and Sciences who are registered or pre-registered for the academic fall session 1988.
!JOB MYQUIZ,LogonUser.LogonAccount;INPRI=1 !QUIZ SET DICT SIQDB.PROD.ADMIN ;if necessary ACCESS REG-BY-SESSION LINK TO ADM-BY-DIV DEFINE CATT NUMERIC*9 = 0 IF UG-VT-CUM-ATT < 0 ELSE UG-VT-CUM-ATT DEFINE TATT NUMERIC*9 = 0 IF UG-VT-TRAN-ATT < 0 ELSE UG-VT-TRAN-ATT DEFINE CPTS NUMERIC*9 = 0 IF UG-VT-CUM-PTS < 0 ELSE UG-VT-CUM-PTS DEFINE TPTS NUMERIC*9 = 0 IF UG-VT-TRAN-PTS < 0 ELSE UG-VT-TRAN-PTS DEFINE CPSD NUMERIC*9 = 0 IF UG-VT-CUM-PSD < 0 ELSE UG-VT-CUM-PSD DEFINE TPSD NUMERIC*9 = 0 IF UG-VT-TRAN-PSD < 0 ELSE UG-VT-TRAN-PSD DEFINE TOTATT NUM*9 PIC "^^^^^^^^.^" = CATT+(TATT/10) DEFINE TOTPTS NUM*9 PIC "^^^^^^^^.^" = CPTS+(TPTS/10) DEFINE TOTPSD NUM*9 PIC "^^^^^^^^.^" = CPSD+(TPSD/10) DEFINE GPA NUM*9 PIC "^^^^^^.^^^" = TOTPTS/TOTATT*1000 SELECT IF SESSIONRBS = "AF88" AND & (ACTIVITY-CODE = "R" OR & ACTIVITY-CODE = "P") AND & DIVISION-AV = "A" AND & COLLEGE-CODE = "1" AND & MAJOR-1-A = "0401" SORT ON CLASS-LEVEL,GPA SET REPORT DEVICE PRINTER SET REPORT LIMIT 1000 REPORT ID CLASS-LEVEL GPA FINAL FOOTING "TOTAL =" COUNT GO EXIT !EOJ
Tips and Notes:
- The MPE/iX commands to submit the program for deferred processing have been added to the example.
- DEFINE statements can be difficult to work with. The 10 define commands in the example have only been included to provide a method to report cumulative grade point average. It is suggested these commands be copied when reporting GPA. This calculation of GPA combines ISU and transfer data; please contact the Computer Center if needing ISU GPA.
- Notice the report limit in the example has been set high. This is to insure all students which meet the selection criteria will be reported. When testing the program in Quiz set the report limit much lower, then reset it before submitting the program for deferred processing.
- Notice the SORT command contains two fields. When using more than one sort field, the field specified first in the command takes precedence.
- Notice 'INPRI=1' on the JOB statement. This input priority permits the job to be deferred for night processing. (See INPRIs listed elsewhere in this manual.)
Printing to the Laserjet in Quiz
To print to a laserjet, in QUIZ enter a line with USE QUIZLJ.USEPH.ADMIN, then enter the PAGE HEADING command. These statements are to be used with the laserjet and NO font cartridge. They use the default font available with the laserjet which allows PICA (10 pitch) or 16.6 pitch printing.
QUIZLJ - is a file of QUIZ statements that set the device control for the laserjet. It also has DEFINE statements to allow printing in compressed print and small print in portrait or a command to print in landscape. These are activated by using the appropriate name in the PAGE HEADING line. The following are the available commands:
COMPRESS - is used with portrait (default on laserjet). Letters are compressed slightly allowing 87 characters to print across the page in PICA (as compared to 80 normally). Include SET PAGE LENGTH 60 in the QUIZ statements.
SIZE16 - is used with portrait (default on laserjet). Letters are small (16.6) and 8 lines per inch print. This allows 128 characters to print across the page. If using this command include SET PAGE LENGTH 80 in the QUIZ statements.
LANDSCAPE - causes printing of document in landscape orientation. This allows 105 characters to print across the page. Include SET PAGE LENGTH 45 in the QUIZ statements.
The above commands are not used to print in portrait with the default of PICA, however, SET PAGE LENGTH 60 must be included in the quiz statements for printing to the laserjet.
The following is an example of how to use these statements in the PAGE HEADING line:
PAGE HEADING LANDSCAPE SKIP 1 & (rest of heading statements) PAGE HEADING COMPRESS SKIP 1 & (rest of heading statements) PAGE HEADING SIZE16 SKIP 1 & (rest of heading statements)
To reset the laserjet at the end of the quiz include a FINAL FOOTING RESETLJ statement. This will cause the laserjet to be set back to the default (it also causes a blank page to be ejected). If there are any questions on printing quiz to the laserjet contact your computer support analyst at the Computer Service Center.
To print to a local spooled printer, enter the following command:
:ISULASER (answer prompts)
To cancel printing to spooled printer, enter the following command