When I mention "work file", I mean just create a PF in qtemp.

For the situation you mentioned, I would feel "comfortable" using a work
file as a solution.  Create a PF with all the fields needed for the
subfile.  Then create a LF over the PF you created with keys on the
SALESMAN & CSTNBR.  Don't use the SELECT option in the LF for SALESMAN.
Before you run the subfile program CRTDUPOBJ of the PF and LF in QTEMP and
use OVRDBF.  Now your subfile program is ready to use the PF to dynamically
load the subfile.  The program will load the work file with the data needed
for the subfile, then use the logical over the work file to actually load
the subfile.

IMHO, I think the above method is pretty easy.  I like to keep it simple
;-).

hth,

Frank






"Douglas W. Palme" <dpalme@xxxxxxxxxxxxxxxxxxxxx>@midrange.com on
03/29/2005 08:27:28 AM

Please respond to RPG programming on the AS400 / iSeries
       <rpg400-l@xxxxxxxxxxxx>

Sent by:    rpg400-l-bounces@xxxxxxxxxxxx


To:    RPG programming on the AS400/iSeries <rpg400-l@xxxxxxxxxxxx>
cc:

Subject:    Re: Arrays


I have never used work files, so I would have to do some research on that,
not that I am opposed to such a venture, but I was hoping to resuse some of
my existing skills.

The whole reason behind this question is that I have to create a subfile
that will display based on what salesman number the user enters, YTD
hardgood sales (which is contained within the customer master file) and
then
Cylinder rent which would be a cumulative amount from the line item file
(which contains 1.3 million records) and then a calculated field showing
the
total, this has to be done for each different customer number assigned to
the salesman, and to top it off, I need the data displayed in descending
order LOL

Pulling the info from the customer master is easy enough, but I would have
to loop through the line item file hundreds or even thousands of times to
get the totals.

I thought about creating a logical file for each salesman in customer order
but maintenance would be heavy, as each time we add a new salesman I have
to
create a new logical file and then modify the code.

I suppose I could create a logical joined file with the pertinent info and
then key in on the salesman and then customer, but I am not sure if that is
the best answer.

I am open ears to anyone with any suggestions :)





As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.