Hello all,

I'm hoping the awesome folks here on the MIDRANGE-L board can help me.
I'm working on a program whose goal is to copy a subset of data out of an
ERP system. Here are the steps I'm currently employing to do this:

- Do a DSPFD of all the files in a given library and put this data in an
OUTFILE we will call FILEA
- In a CL program, do a DSPFFD on all the files named in FILEA and put
this data to an OUTFILE we will call FILEB
- Via a RCVF loop, read FILEB, looking for fields beginning with certain
characters which we will say are "ABC". If a field named this way is
found, do a CPYF of the file containing this field, using the INCREL
keyword to only include the subset of data needed. This CPYF uses the
CRTFILE(*YES) keyword as well.

Here's where I'm running into a problem. These steps work, but for some
reason (I'm guessing it's because of combining the CRTFILE(*YES) keyword
and the INCREL keyword, but I don't know this) I'm getting ALL the files
copied that have a field beginning with "ABC", including the ones that have
the subset of data I need. My end goal is to just have the files copied
that have my subset of data, so the files with no data are not needed.

Is there a more elegant way of achieving this than what I've described?
Hopefully this isn't completely confusing. Any input would be much
appreciated. Thanks!


This thread ...


Return to Archive home page | Return to MIDRANGE.COM home page