|
Murali, That's what Bob was suggesting. Using DDS create another version of the file but instead define the fields as zoned and not packed and give them the same names. Then use CPYF FROMFILE(original_file) TOFILE(new_zoned_file) MBROPT(*REPLACE) FMTOPT(*MAP) and you should get what you want. Jonathan -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of murali dhar Sent: 26 August 2006 04:36 To: RPG programming on the AS400 / iSeries Subject: RE: change data type Iam sending the file to down stream systems which can read only zoned not packed. Due to this business requirements I have to send zoned file. But the file which was created due to a process has packed data in various locations because of multiple layouts and very much scattered. I wanted to create something which should search out these packed fields in the record and convert them to zoned and then write a new record to different file.This new file which is having zoned data will be sent to the systems that can read only zoned. I felt Rob solution is suitable. Bob Cozzi <cozzi@xxxxxxxxx> wrote: Murali, Why not create a physical file with the data layout of the file as it currently exists. Then create a second physical file with the new, unpacked layout. Then do CPYF with FMTOPT(*MAP) from the first file to the second. -Bob Cozzi www.iSeriesTV.com Ask your Manager to watch iSeriesTV.com -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jerry Adams Sent: Friday, August 25, 2006 9:11 AM To: RPG programming on the AS400 / iSeries Subject: Re: change data type Rob gave a good explanation of the TESTx opcodes and how they work. However, I'm still in the dark as to exactly what it is you're trying to accomplish. Why are you proposing to unpack the fields? What are you trying/hoping to accomplish with the TESTx opcodes? * Jerry C. Adams *IBM System i5/iSeries Programmer/Analyst B&W Wholesale Distributors, Inc.* * voice 615.995.7024 fax 615.995.1201 email jerry@xxxxxxxxxxxxxxx murali dhar wrote:
Hi All, I have a flat file with packed data occupied in different positions of each record.I want to identify the packed fields and convert them to zoned and
create a new record with the unpacked data. Iam not worried if file length gets changed.
Iam looking at some of the op codes like TESTN/TESTB etc Request you to propose some suggestions to handle this requirement. Thanks a lot Murali. --------------------------------- Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+
countries) for 2¢/min or less.
-- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
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.