simple request/complex solution

dmaclary@wellmanage.com dmaclary@wellmanage.com
Mon, 10 Aug 1998 08:21:34 -0400


If the values are not ranges, then you might try something like...

1. Prompt for Employee Numbers (EMP-NO) and write them to a subfile
   (subfilee).

2. Prompt for Pay Periods (PAY-PERIOD-NO) and write them to an indexed
   subfile (subfilep), where the index always has a value of 1.

3. Prompt for Account Numbers (ACCT-NO) and write them to an indexed
   subfile (subfilea), where the index always has a value of 1.

Using these subfiles, you can...

ACCESS *SUBFILEE &
  LINK (1) TO *SUBFILEP &
  LINK (1) TO *SUBFILEA &
  LINK (EMP-NO        OF SUBFILEE + &
        PAY-PERIOD-NO OF SUBFILEP + &
        ACCT-NO       OF SUBFILEA)  &
    TO EMP-KEY OF GL-HISTORY

...

Regards,
David Maclary
PowerHouse Consultant

> ----------
> From: 	Pablo Grim[SMTP:grim@gorge.net]
> Sent: 	Friday, August 07, 1998 5:43 PM
> To: 	powerh-l@lists.swau.edu
> Subject: 	re:simple request/complex solution
> 
> I'm sorry.  I made those first parameters look like ranges.  They are not.
> They are 1 or more individual values, not 1 through N.
> 
> thanks Ian
> 
> >ACCESS EMP-MASTER link EMP-KEY to EMP-KEY of GL-HISTORY
> >temp emp-no-from  char*6  parm "Enter Employee Number from: "
> >temp emp-no-to    char*6  parm "Enter Employee Number to:   "
> >temp pay-no-from  char*6  parm "Enter Pay Period from:      "
> >temp pay-no-to    char*6  parm "Enter Pay Period to:        "
> >temp acct-no-from char*20 parm "Enter Account Number from:  "
> >temp acct-no-to   char*20 parm "Enter Account Number to:    "
> >
> >Select EMP-MASTER if EMP-KEY[1:6]   >= emp-no-from  and EMP-KEY[1:6]   <=
> >emp-no-to &
> >		     and EMP-KEY[7:6]   >= pay-no-from  and EMP-KEY[7:6]
> ><= pay-no-to &
> >                 and EMP-KEY[13:20] >= acct-no-from and EMP-KEY[13:20] <=
> >acct-no-to
> >
> >etc
> >
> >This way you are only reading sequentially through the EMP-MASTER Master
> >dataset and linking to GL-HISTORY for those employees that you actually
> >need.
> >
> >Regards
> >
> >Ian Rawnsley
> >Auckland
> >New Zealand
> >
> >> -----Original Message-----
> >> From: owner-powerh-l@sphere.swau.edu
> >> [mailto:owner-powerh-l@sphere.swau.edu]On Behalf Of Pablo Grim
> >> Sent: Friday, 7 August 1998 12:17
> >> 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.
> 
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
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.