Don Cavaiani wrote:
I have put together a "free procedure" which runs as a scheduled job,
and emails out Open Order reports (in Excel format) to 200+ suppliers.
The main steps used are:
CPYSPLF
Runqry (to Select out only the detailed lines)
CALL  PGM(SENDFILE)
CPYTOIMPF
CPYTOPCD
SNDDST
This is working fine, except for one thing - many of the Suppliers
receiving the Email attachment want HEADERS. However, headers are
NOT included in my automated procedure.
I'm wondering if anyone has a workaround to automatically include the
headers?
  If the spooled data is a report [seemingly, per use of the CPYSPLF] 
where order of /detailed lines/ has already been established and should 
remain the same [perhaps not, with target as spreadsheet], then consider...
  A RUNQRY request has no guarantee of ordering without sort field 
specified, so the /detailed lines/ of data selected from a flat file 
without explicit ordering could both be retrieved from and placed into 
an output file, in a seemingly random order.  A request to OPNQRYF using 
KEYFLD(*FILE) against a non-keyed file [according to its documentation] 
however, ensures /arrival/ order, so a CPYFRMQRYF to an output file will 
have the data ordered the same as the queried file.  A request to CPYF 
with selection may be an even better choice if INCCHAR or INCREL logic 
is sufficient; i.e. eliminate query overhead for what is an inherently 
non-relational data access.  Use of CPYTOIMPF [implemented using SQL] 
reintroduces the same potential problem for ordering of the data for 
output.  CPYTOIMPF is a /database/ data export utility, and is often 
used where CPYTOSTMF is more appropriate.
Regards, Chuck
As an Amazon Associate we earn from qualifying purchases.
	
 
This mailing list archive is Copyright 1997-2025 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.