|
I come close with this SQL:
select
cast('AAAA' as char(4)) concat
cast(char(-11.23) as char(11)) concat
cast('Some text' as char(20)) concat
x'0d25'
from QSYS2/QSQPTABL
gives
String Expression
AAAA-11.23 Some text <crlf>
Substitute your file and field names...
I didn't see how to right jusify the number, however...
Once this works, you could to a CPYTOSTMF as suggested.
HTH,
Loyd
-----Original Message-----
From: Dan [mailto:dbcemid@yahoo.com]
Sent: Wednesday, November 06, 2002 10:21 AM
To: midrange-l@midrange.com
Subject: RE: AS/400 app FTPs file to IFS???
A followup: The representation of negative numbers is a problem. The
negative sign must float on the left of the number. I.e.:
AS/400 file (CODE=4A, AMOUNT=8,2S, DESC=20A)
CODE AMOUNT DESC
<--><------><------------------>
AAAA00012378just a test
BBBB0000987Rthis has a neg amt.
CCCC00000001just a penny
Required resulting pc text file:
AAAA 123.78just a test <crlf>
BBBB -98.79this has a neg amt. <crlf>
CCCC .01just a penny <crlf>
Note that the <crlf> is fixed after the entire description field.
Unless someone has an idea, it's looking more like an RPG program and using
John Carr's "write-to-IFS" RPG solution.
Still hoping, Dan
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.