|
Tim Truax wrote: > > Hello all; > As a new AS400 person I have a quick question that requires your > opinions: > > On Subfiles (they're very neat!) If I have a file that just contains a > Key say.. account number. eg) 12345 and then a sequencing part of the > key..say eg) 001 002 003....etc > Ergo-- > 12345001 Hi Billy here is text line 1 > 12345002 Here is text line number 2 > 12345003 thisr line > etc.....etc..... > > If I am updating and adding to this file using an interactive screen > job, should I use the SFLINZ and initialize my subfile with blank > records then CHAIN back to it and update the blank records with existing > text records. > (OR) > Would you recommend using the SFLCLR and then reading the existing text > and WRITING them to the subfile and then WRITING some blank records > after your done reading the existing records, to provide the user with > some useable keying text lines. > first, you do not need to chain to the subfile record and update it with existing data. After SFLINZ, (use SFLRNA too) you can WRITE directly to the subfile (remembering to increment rrn from 1 to xxx). It will only activatate the records you WRITE, or those they key into. you could even use the rrn as the second key field for your file (bonus!) Since it appears, from your example, that there will be little or no editing of fields entered, your first option would probably be the way to go. The trick will be using SFLNXTCHG appropriately - If you are going to simply update your file with whatever they key in, don't use SFLNXTCHG, and the READC opcode will only read the records they change. If you do any input editing, you will need to READC and UPDAT with SFLNXTCHG in effect. This allows you to read all changed records once for editing purposes and once again for updating. hth, rick +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to "MIDRANGE-L@midrange.com". | To unsubscribe from this list send email to MIDRANGE-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.