FW: Powerhouse Quiz - Stumbling block.

Maloney, Charlie Charlie.Maloney@Cognos.com
Fri, 4 Aug 2000 18:26:46 -0400


If you don't have QTP here's a QUIZ example.

We're dependent upon your statment that 
"each reported line statement" is literally true.  So...
This example works ONLY if a 'file' occupies a SINGLE LINE
This example was tested in PowerHouse 8.21.D for Windows-NT
;
; three pass quiz report
; to divide records into 10 roughly equal slices.
; 
; first pass
; count records
; mpeix users must choose a reasonable report limit
;
cancel clear
set default
set verify errors noverify delete
;
access orders
set report nolimit
define x = 1
sorted on x
rep summary x subtotal
set subfile at x
go
;
; second pass
; calculate page length
; take into account
;   1:  number of records read in first pass
;   2:  number of lines used by page/column headings and footings
;       the default is 5 if the column headings use two lines, and
;                      4 if the column headings use only one line,
;                      etc.
;                      your mileage will vary
;   3:  subtract 1 if you want an EXTRA page with up to 9 records on it
;   4:  do nothing if you want the 10th page to have up to 9 fewer records
on it
;
;       We've chosen to have the tenth page with slightly fewer records
;       (it's your choice) 
;   5:  write the "set page length" command out to a disc file.
;
access *quizwork
define y = ceiling (x/10) + 5 
set report device disc name setcomm
final footing tab 1 "set page len" y
set nosubfile
set nostatistics
set nowarnings
set nohead
set page length 1
go
;
; third pass
; 'use' your report program.  Here we just 'access orders' again
; mpeix users must choose a resonable report limit
; finally 'use' the set command written in the second pass
; mpeix users don't need the .txt extension
;
cancel clear
set default
set verify errors noverify delete
;
access orders
report count order_no
set report nolimit
set report device printer
set page width 79 ; (our printer isn't 132)
use setcomm.txt
go
;
; go to the printer and pick up the report
; each logical page could span physical pages
; it's dependent upon your paper stock
;
; our sample orders table contains 1,211 records
; so each logical page spans two physical pages
;
; hand each logical page to a different person


-----Original Message-----
From: Pickering, John (NORBORD) [mailto:PICKERIJ@norbord.com] 
Sent: Friday, August 04, 2000 3:50 PM
To: 'Jean Huot'
Cc: 'Powerhouse List'
Subject: RE: Powerhouse Quiz - Stumbling block.


If it doesn't matter which records go in which tenth of the report then
create a Qtp pass which splits the source data up into ten indentical
subfiles -- first record in subfile one, second in subfile two, etc. Then
report each of the ten subfiles with the same Quiz report creating ten spool
files.

I'd split then using something like:

>temp t-count int*5
>item t-count count
>subfile sf1 if 1 = mod(t-count,10) inc stuff
>subfile sf2 if 2 = mod(t-count,10) inc stuff
; etc up to 9, use 0 for the 10th
>subfile sf0 if 0 = mod(t-count,10) inc stuff

You could do it all with Quiz for that matter but it would be more I/O.
First pass just to number the records then ten passes through the results to
select a tenth of the data.


Regards,
JWP

> -----Original Message-----
> From:	Jean Huot [SMTP:bcnord@BCN.QC.CA]
> Sent:	Friday, August 04, 2000 5:32 PM
> To:	HP3000-L@RAVEN.UTC.EDU
> Subject:	Powerhouse Quiz -  Stumbling block.
> 
>  Here is the problem.
> 
> Take a quiz report which has x lines to be reported. amongst 10 people.
> It is not known ahead of time what the value of x will be, but is
> dependant upon how many records will be selected.  The report is to be
> split evenly amongst the employees.  The idea behind this is:  each
> reported line statement is a file an agent has to work on.  To split the
> work evenly amongst 10 people, I have to split the report from the work
> that needs to be carried on.
> 
> Any bright idea floating around???
> 
> Jean Huot
> Northern Credit Bureaus Inc.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.