× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Dan...

Thanks, Vern. The revised SQL looks like this:

select
/* first part */
cast('AAAA' as char(4)) concat
/* numeric part, right justify with floating left - sign */
substr(cast(' ' as char(11)),1,11-length(strip(cast(char(-11.23)
  as char(11)),b,' '))) concat strip(cast(char(-11.23) as
  char(11)),b,' ') concat
/* text */
cast('Some text' as char(20)) concat
/* CRLF */
x'0d25'
from QSYS2/QSQPTABL

With a result of

AAAA     -11.23Some text           <crlf>

Where "11" is the assumed field length based on the file sample, and
"-11.23" is the field name for the numeric data.

If the file is similar to the sample provided, you can do this with
RUNSQLSTM or the QM Query equivalent, then do a CPYTOSTMF.

HTH,
Loyd


-----Original Message-----
From: Vern Hamberg [mailto:vhamberg@centerfieldtechnology.com]
Sent: Wednesday, November 06, 2002 12:07 PM
To: midrange-l@midrange.com
Subject: RE: AS/400 app FTPs file to IFS???


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.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.