× 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.



No problem in your asking, Glenn. Turns out you have a difficult one here.

Here's a suggestion, since Query/400 is not handy for doing this. This solution can be used repeatedly.

1. Create a physical file (ASCFIL) that is like your target file, except that the packed fields are replaced by zoned fields.

2. FTP the ASCII file into this new physical file directly - the numeric fields will just get filled in automagically.

3. CPYF ASCFIL TGTFIL MBROPT(*REPLACE) FMTOPT(*MAP)
(or MBROPT(*ADD), as you require)
The zoned fields will get converted to packed automagically. I just verified that this works.


ASSUMPTIONS:
1. The numeric data in the ASCII file has no commas and is all positive, with leading zeroes in place.


HTH
Vern

At 02:24 PM 10/28/2004, you wrote:
It was an ASCII file I uploaded to the 400.  Our OS version is V5R2.

I am not leaving out information on purpose. It's that I'm extremely unfamiliar with the AS/400.

The source data is a string or CHAR.

Vernon Hamberg wrote:

The terms "flat file" and "externally-defined" don't usually go together in my mind, although they can. As Dan asked, what is the data type of the source? Is it a single character field? What is the formula you are using, if you are using a result field? If the source is character and needs to be substrung and then converted to numeric, this is hard in Query/400 but doable-you can use the MICROSECOND function - can tell you more if you need this ugliness. You'd be better off using an SQL query in a *QMQRY, using STRQMQRY with OUTPUT(*OUTFILE). What release of the OS are you at?

Vern


--
Glenn Thompson
Senior Analyst
American Trouser, Inc.
gthompson@xxxxxxxxxxxxxxxxxxxx


-- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.