EnterApp

Web Services Council

Enterprise Applications
User Guide

Quiz

Quiz Session

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:
>:SIFILES

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.

EXAMPLE 1:

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:

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:

Other Commands:

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.

EXAMPLE 2:

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:

Quiz Advanced Features

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.

EXAMPLE 3:

	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

Contact your computer support analyst for additional help in creating, using, and linking indexed subfiles.

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

Additional Commands

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.

EXAMPLE 3:

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:

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

:ISULASER RESET=Y