|
Along the KISS line, what i do is this: FINRECX IF E K DISK *** External Data Structure for INRECX Header Record *** D INRecxHd_DS E DS ExtName(INRecx) D SavedRecord S Like(INRecxHD_DS) D NewRecord S Like(INRecxHD_DS) C Read INRecX C Eval SavedRecord = INRecxHd_DS C Exfmt FMT01 C Eval NewRecord = INRecxHD_DS C If SavedRecord <> NewRecord ... etc Things I like about this solution include: the ability to refresh the screen easily, the ability to compare the original record to a re-chain for update to see if the record was changed at another workstation, and the ability to send "SavedRecord" as a hidden field on a subfile so the whole record's info is immediately available _______________________ Booth Martin Booth@MartinVT.com http://www.MartinVT.com _______________________ Eric DeLong <Eric.DeLong@pmsi-services.com> Sent by: owner-rpg400-l@midrange.com 12/27/2000 08:57 AM Please respond to RPG400-L To: "\"RPG400-L@midrange.com\" " <RPG400-L@midrange.com>, "\"Jim Langston\" " <jimlangston@conexfreight.com> cc: Subject: RE: Semantics Jim, I think you will have problems doing this with based structures. If your intent is to save this record to compare against other records from this file, then the based storage probably won't be holding the first record anymore anyway. KISS rule applies here. Try: FINRECX IF E K DISK *** External Data Structure for INRECX Header Record *** D INRecxHd_DS E DS ExtName(INRecx) Prefix(HD) C Read INRecX C Eval INRecxHd_DS = INRecX Make a copy of your buffer and simply copy the record. The subfields in the INRecxHd_DS data structure will be prefixed with HD so the external data structure can be declared. hth Eric ______________________________ Reply Separator _________________________________ Subject: Semantics Author: "Jim Langston" <SMTP:jimlangston@conexfreight.com> at EXCHANGE Date: 12/26/00 5:31 PM This is just a question of semantics I guess. I need to call up the first record to a file and save it to a buffer, so that I can throw it back later, which is a header record (I didn't design the database files, I would of made them normalized myself). I could open it internally described, give it a buffer, than declare in the D specs external declarations for it being the same name as the file. But, I was hoping to open it externally described, creating a buffer variable and pointing it to the beginning of the record. My question becomes, however, where do I point the variable? That is this works for internally described: FINRECX IF F 240 DISK *** External Data Structure for INRECX Header Record *** D INRecxHd_DS E DS ExtName(INRecx) D Based(INRecxHd_DS@) D INRecxHd_DS@ S * IINRECX NS I 1 240 INRecxBuffer C Eval INRecxHd_DS@ = %Addr(INRecxBuffer) As you can see, I point INRecxHd_DS@ to the address of my buffer declared in my I specs. Doing it this way, however... FINRECX IF E DISK *** External Data Structure for INRECX Header Record *** D INRecxHd_DS S INRecxBuffer D Based(INRecxHd_DS@) D INRecxHd_DS@ S * C Eval INRecxHd_DS@ = %Addr(??????????????) I'm going to try experimenting with this, and I'm sure that I could use the first variable in the file description, but my concern is what happens in the future when someone comes and sticks a new variable up front? Or renames the variables? Then my program won't work anymore 'til fixed. And, yes, I understand that if they did that my buffer would have to be increased in size anyway. Regards, Jim Langston +--- | 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 +--- +--- | 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 +--- +--- | 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-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.