System command, dreport and data transfer

Jay R. Ashworth jra at baylink.com
Tue Jan 30 09:46:30 PST 2007


On Tue, Jan 30, 2007 at 12:35:11PM -0500, Dan Snyder wrote:
> I need help doing the following...
> ----------------------------------
> 1. Lookup a group of records in a file (file1-jobs).  This file could have
> multiple records with the same part number.
> 2. For each unique part number in file1, lookup related records in another
> file (file2-bill_of_materials).  File2 may have multiple records for each
> part # which I would need to loop through. 
> 3. For each record found in file2, create new records in a third file
> (file3-temp_working_file).  Multiple records will be created in file3 for
> each record in file2.  File3 is used for "whatif" calculations and
> reporting.
> 
> Can anyone confirm that the system command does or doesn't work in output
> processing?

Sure it would.  But it's not your solution.

> Does anyone have a suggestion on how I could accomplish my objective listed
> above?

You don't say, though, the context in which you're doing this.  I'm
going to assume, from the way you phrase 1), that this is going to
happen from an active record in dclerk.

You're going to need to do all the looping yourself, right there in the
input table.  Run a lookup with lookup and getnext over file1.  Every
time you get a hit, call a subroutine that loops similarly over file2,
creating the necessary records in file3.

Be careful with your dummy variable names: your subroutine will be in
the input table's namespace.

You *could* do this by calling dreport with system (make sure it's on
the path, or use a full pathname to the binary), and passing the part
number into it using -pm, but unless the processing's *really* hirsute,
it's probably not worth the problem.

If my underlying assumption was incorrect, please clarify.

Cheers,
-- jra
-- 
Jay R. Ashworth                                                jra at baylink.com
Designer                          Baylink                             RFC 2100
Ashworth & Associates        The Things I Think                        '87 e24
St Petersburg FL USA      http://baylink.pitas.com             +1 727 647 1274


More information about the Filepro-list mailing list