simple request/complex solution?

Rohde Dirk (Van) dirk.rohde@artioslink.com
Fri, 7 Aug 1998 07:26:46 -0700


You'll probably need to do a selection with DEFINEs that have the PARM
parameter in a SELECT statement.  Multiple items will need to be
specified as a comma-delimited list.  For example, just using the
ACCT-NO field to select on:

define d_ACCT_NO_SEL char*80 = parm prompt "Enter Account Number(s) "
select GL-HISTORY if d_ACCT_NO_SEL = " " or &
        d_ACCT_NO_SEL = "@" or &
       0 <> index(truncate(d_ACCT_NO_SEL) + ",", truncate(ACCT-NO) +
",")

The addition of the commas in the index statement ensures that partial
values are not selected (e.g., specifying account number "2" does not
select account "25").  Since input is done from a quick screen, you can
do verification and remove embedded blanks or set up the comma-delimited
list from a repeating list of items before submitting the job.  You
should be able to set it up to do a choose on the first part of the key
(EMP-NO) to improve performance.

> -----Original Message-----
> From:	Pablo Grim [SMTP:grim@gorge.net]
> Sent:	Thursday, August 06, 1998 5:17 PM
> To:	powerh-l@lists.swau.edu
> Subject:	simple request/complex solution?
> 
> Hey folks,
> 
> I have a simple request from a user.  She wants to be able to retrieve
> data
> from a gl history file on a regular basis with the following selection
> criteria:  employees 1-N,  account numbers 1-N, and a single range of
> pay
> periods 1-4.
> 
> All of the necessary information is contained in the GL-HISTORY file.
> The
> file has a data structure like so:
> 
>     Record:             GL-HISTORY
>     of File:            GL-HISTORY
>     Organization:       INDEXED
> 
> -- Record Contents --
>     Item                                 Type            Size  Occ
> Offset
>     EMP-KEY                              CHARACTER         32
> 0
>     .EMP-NO                              CHARACTER          6
> 0
>     .PAY-PERIOD-NO                       CHARACTER          6
> 6
>     .ACCT-NO                             CHARACTER         20
> 12
>     PAY-AMOUNT                           INTEGER SIGNED     8
> 44
> 
>  ** EMP-KEY is a 32 byte  REPEATING PRIMARY ASCENDING  index **
> 
>     Segment                              Type            Size
>     EMP-KEY                              CHARACTER         32
> 
>  ** GL-KEY is a 26 byte  REPEATING ALTERNATE ASCENDING  index **
> 
>     Segment                              Type            Size
>     ACCT-NO                              CHARACTER         20
>     EMP-NO                               CHARACTER          6
> 
> This report will take a long time to run, so it must execute in batch.
> Input of selection criteria will be done from a quick screen, which
> will
> then create and submit the batch job.
> 
> Now if i were to simply do a CHOOSE EMP-KEY PARM thing, the user would
> be
> forced to enter all of the combinations (permutations?) of the
> selection
> criteria values, and I believe (my discrete mathmatics is rusty) that
> this
> could be an exponential amount of data entry, hmmm, or actually
> something
> like N1 * N2 * 2.  In other words, not acceptable.
> 
> The only way I can think of doing this is to create some kind of
> intermediate works files and some nested while loops to load them with
> all
> of the possible combinations of data values.  Then use the work file
> to
> link to the gl-history file.
> 
> Seems like kind of a lot of work for a simple request.
> 
> ideas?
> 
> thanks for hangin' in this far
> 
> p
> 
> 
> 
> = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> = = =
> Subscribe: "subscribe powerh-l" in message body to
> majordomo@lists.swau.edu
> Unsubscribe: "unsubscribe powerh-l" in message to
> majordomo@lists.swau.edu
> powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
> 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
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.