|
Alan, What I am trying to do is this: We are trying to keep track of all changes that are made in our master files. Currently we are journaling these files (Data Mirror). I create a file of all changes to a file using the DSPJRN *OUTFILE cmd. I then create a file using the DSPFFD *OUTFILE cmd on the file the user wants to see what changes were made. I use the DSPFFD file to find out how to substring the data that came from the DSPJRN cmd to create a "|" delimited file. The problem comes when some of the data from the DSPJRN are packed. This is because one of the files we are journaling has a field that is packed. I am hoping that I don't have to do what Scott and Bob suggest and that would be to use the MI instruction. if that is the only way to accomplish this then that's what I will do, but wondering if there is another way. I want to keep this a generic as possible so anyone can select a file and a date/time range and get a delimited file of the changes that were made. Thanks for all the suggestions so far. Curt ------------------------------ message: 4 date: Tue, 30 May 2006 16:17:03 -0400 from: Alan Shore <AlanShore@xxxxxxxx> subject: Re: Moving Packed Data Curt - I believe some more information is required. Does the packed data start and end in the same place for each character string? If so, can you supply a breakdown of the initial character string? If not, how is the packed data delineated from the non-packed data? Alan Shore NBTY, Inc (631) 244-2000 ext. 5019 AShore@xxxxxxxx message: 5 date: Tue, 30 May 2006 15:20:52 -0500 from: Booth Martin <booth@xxxxxxxxxxxx> subject: Re: Moving Packed Data Does this work? eval fieldp = %dec(%subst(longfield: 12: 10) (where 12 & 10 are the starting position and length)? and, could you eval your result field with %editc(fieldp: 'Z') ? --------------------------------- Booth Martin http://www.Martinvt.com --------------------------------- message: 7 date: Tue, 30 May 2006 15:33:10 -0500 (CDT) from: Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx> subject: Re: Moving Packed Data Use the _LBCPYNV MI builtin to convert the packed data to zoned decimal. --- Scott Klement http://www.scottklement.com message: 9 date: Tue, 30 May 2006 15:36:27 -0500 from: "Bob Cozzi" <cozzi@xxxxxxxxx> subject: RE: Moving Packed Data Curt, Try this: H BNDDIR('XTOOLS/XTOOLS') /copy xtools/qcpysrc,numtochar eval %char(numToNum(%subst(myData:3:4) : 'P' : 7 : 2)) This requires RPG xTools, however. If you don't have xTools, look up the LBCPYNV MI instruction, which is what I use under the covers. -Bob Cozzi www.iSeriesTV.com iPod your industry news instead of reading it. Coming June 2006 Ask your friends to tune into iSeriesTV.com -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Curt Vancalster Sent: Tuesday, May 30, 2006 2:46 PM To: rpg400-l@xxxxxxxxxxxx Subject: Moving Packed Data I am working in RPG IV. I am trying to substringing out of a character field, packed data. I am trying to put this packed data back into another character field, but I don't want it packed, I want to see the actual value. How do I accomplish this? I tried substringing into a character field and then moved that into a signed field, but that does not work. I get a decimal data error. I don't want to create a data structure either cause the format of the initial character field could change. Any suggestions? Curt VanCalster Lead Programmer Smithfield Beef Group., - Green Bay, WI (920) 406-1174 curt.vancalster@xxxxxxxxxx
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.