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



Bill, I may have an idea. But first, another finding - if the numeric field has an even number of digits, 2 spaces are added. Plus the space for the sign. Yikes!

But the good news - use the CPY command twice. This assumes that you have no packed fields, and that there are no negative values in the numeric columns.

First, copy the PF to a stream file in *BINARY format, keeping the CCSID of your job (probably 37, EBCDIC).

CPY OBJ('/qsys.lib/yourlib.lib/yourfile.file/yourmbr.mbr') TOOBJ('testebcdic.txt') FROMCCSID(*JOBCCSID) TOCCSID(*JOBCCSID) DTAFMT(*BINARY)

Second, copy the resulting stream file to the final ASCII format - *PCASCII is Windows, *STDASCII is DOS - using *TEXT format.
CPY OBJ('testebcdic.txt') TOOBJ('testascii.txt') FROMCCSID(*OBJ) TOCCSID(*PCASCII) DTAFMT(*TEXT)


In these examples the stream files are in my home directory.

You can add REPLACE(*YES) to either command, if needed.

If you have negative numbers, the last digit will not be a number, since the left-hand half-byte is where the sign is kept. E.g., -7 comes through as the letter P.

This double-clutch gets around the need to use a source PF when DTAFMT(*TEXT) is set.

HTH
Vern

At 09:33 AM 10/15/2004, you wrote:
That's what I thought, but how do I get a 7/0 filed to transfer as 7/0.

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Vernon Hamberg
Sent: Friday, October 15, 2004 9:38 AM
To: Midrange Systems Technical Discussion
Subject: Re: Moving data to the IFS


Bill

I wonder if this is for the sign. If all your values are non-negative,
you'll have a blank in there, and a minus sign otherwise.

Maybe?
Vern

At 07:28 AM 10/15/2004, you wrote:
>I'm having a problem moving data to the IFS and having the record
>layout of the IFS file match its source file in DB2/400.  This is the
>scenario: I have a file in DB2/400 that has to be moved to a PC
>shareable drive.  For security reasons we do not want to FTP the file.
>If I use the CPYTOIMPF command alpha fields move fine but numeric
>fields have an additional byte added to them (In DB2/400 the field is
>defined 11 bytes with 0 decimal positions zoned) and when it gets to
>the IFS the record layout is shifted 1 byte for each numeric field
>sent. If I copy the DB2/400 file data to a source file and use the
>CPYTOSTMF command, the resulting file is shifted one byte. Any
>suggestions?
>
>Bill Erhardt
>Baldwin Hardware
>
>
>
>-----------------------------------------
>This message was scanned for viruses.
>--
>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.

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

-----------------------------------------
This message was scanned for viruses.

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