|
I am using Scott's documentation to create IFS files. I finally have
something working, however after the first row each line has over 150
characters of extra spaces before the data. What makes it stranger is that
there isn't any consistency on how many spaces there are.
Here is a snipit of the file:
"Transaction Date","Account Desc.","Transaction
Desc","Account","Debit","Credit"
08/01/2010,"SERV CHG-SODA SALES","Ribfest-F&B Wk1 sales
J","622-49862-345130",.00,152.95
08/01/2010,"SERV CHG-CAN SODA SALES","Ribfest-F&B Wk1 sales
J","622-49862-345138",.00,9357.38
The code I use to create this is as follows:
D eof C const(x'0d25')
P WriteCsv B
D WriteCsv PI
D buffer S 256A
/free
buffer = %trim(%char(pTranDate:*usa)) + ',"' + %trim(pAcctDesc) +
'","' + %trim(pTranDesc) + '","' + %trim(pAcct) + '",' +
%trim(%editc(pDbAmt:'L')) + ',' +
%trim(%editc(pCrAmt:'L')) + eof;
if (write(fd:%addr(buffer):%size(buffer))< %size(buffer));
abEnd = *on;
return;
endif;
return;
/end-free
P WriteCsv E
In debug, the spaces are not there. Any ideas?
--
Mike Wills
http://mikewills.me
As an Amazon Associate we earn from qualifying purchases.
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.