|
Easiest way I can think of. Build another DDS file with the correct mapping for the file including the packed field. When you open the file in your program open it like this: FARFILE UF F 222 DISK D FileNM_DS E DS ExtName(ARFileNM) D Based(FileNM_DS@) D Prefix(NM_) D FileNM_DS@ S * IARFile NS I 1 222 ARBuffer C *InzSR BegSR C C Eval FileNM_DS@ = %Addr(ARBuffer) C C EndSr Where: ARFILE = Your existing file with data ARFileNM = Your new empty file with correct DDS Other than this, you are going to have to repair your file with the correct DDS. To do that, I create a new file with new DDS and then do a CPYF FMTOPT(*NOCHK) then make sure I can get to the data correctly with UPDDTA. If all is fine I then copy this over the original physical file. Logicals usually get in the way and I have to recompile all of them. A big pain. Then I have to recompile all the programs that use this file externally described. Regards, Jim Langston "Shrader, Patrick" wrote: > > I am trying to use an external physical file that in one program has been > used as an internally defined file. While this is normally not a problem, > about 12 years ago someone decided to remap a character filler field, length > 3, to an packed numeric length of 1. DFU and DBU cannot maintain the file > because of the type conflict. > > How can I access the field inside an RPG program without defining it > internally? Unfortunately, the information encoded in the field is very > important to my current program. Redesigning this payroll application to > make everything externally defined would be very difficult, and not an > option since I am hoping to completely replace it soon. > > Thanks! > > Patrick Shrader > +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.