|
Loyd
You can right-justify (generally) by
substr(cast(' ' as char(n)), 1, n - length(strip(fieldname,b,' ')) ||
strip(fieldname,b,' ')
where "fieldname" could also be "char(numericfieldname)" or any other
expression that yields a string.
The
At 11:39 AM 11/6/2002 -0600, you wrote:
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
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.