Re: [U2] LIST reports and Fields that Do reads
Yes, the read will be done each time the record is LISTed (SORTed, SELECTed, etc). JRI -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of randyleesmith Sent: Friday, July 19, 2013 4:07 PM To: u2-users@listserver.u2ug.org Subject: [U2] LIST reports and Fields that Do reads Lets say you have a field that calls a subroutine. In this routine you do a read to lookup a description which it what is passed back. When you do a LIST to create a report with this field will the read be done each time? I was just wondering how the Universe system handle's this. Dose the system store the first read in it's in memory and just uses that instead of doing a read each time? -- View this message in context: http://cp.mcafee.com/d/5fHCNApdEIzC4T666kPtPqdQkTXETjd79J6WarZQkQjhOrhKyC_t6XdPqdQkPhO-OMMqejsGhTN68agQJeIadHv6loYKrgQJeIadHv6loYKrtsIqejhPWb_nVBUQsII9FZuVtdCVEVVZxZVVZXBHEShjlhKVOEuvkzaT0QSyrjdTdTdw0SQOXs96vzjOXs98rfuhKep76zB_EfZ3i10_-nMaxEM2iYvmH6t2-MgbyYLfgEnCjSpseGnz-EkbPmohpKNMedJFBSWv6xsxlK5LE2zVkDjUCvzPqrp7w09JCUVUSqmMCCqnjh05gQo19EwzWRoPEq8dwwq81unDEkd44OuPd40tkQgh_ka6XCNmg4PG4Da_d Sent from the U2 - Users mailing list archive at Nabble.com. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://cp.mcafee.com/d/avndygQ86QmhP2rz33apKVJ6WarZQrFCzASzt5d-Waq9EVdEThjvKztCVJ6WapEVvpood79Kl8XUz458qmDm56RLzaIundEqmDm56RLzaIundKKmd79EVZ5_HYOYqemm4Q-LsKCPsQsY-M-YY-ZORQr8FGETsVkffGhBrwqrjdFCXCXCM0pYGjFYjfNVJdIzM071dnoovaAVgtHzqptKDNErrjbJQ-d2V2Hsbvg57OFeDNc_7CQSOf00jrdNPNIQJxdcQKCy0axEM2jh17RGNDgQgr10Qg2YLfgEq89AZCq80WFEwz-EkdTdQm8A9a7I ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] LIST reports and Fields that Do reads
The READ is executed each time, but if the record being read is in virtual memory, this second "read" doesn't occur at the disk level. If the file being read is relatively small (ex.: descriptions) it will probably end up in memory quick enough and not provoke performance issues. On Fri, 19 Jul 2013 20:14:38 +, Israel, John R. wrote: Yes, the read will be done each time the record is LISTed (SORTed, SELECTed, etc). JRI -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of randyleesmith Sent: Friday, July 19, 2013 4:07 PM To: u2-users@listserver.u2ug.org Subject: [U2] LIST reports and Fields that Do reads Lets say you have a field that calls a subroutine. In this routine you do a read to lookup a description which it what is passed back. When you do a LIST to create a report with this field will the read be done each time? I was just wondering how the Universe system handle's this. Dose the system store the first read in it's in memory and just uses that instead of doing a read each time? -- View this message in context: http://cp.mcafee.com/d/5fHCNApdEIzC4T666kPtPqdQkTXETjd79J6WarZQkQjhOrhKyC_t6XdPqdQkPhO-OMMqejsGhTN68agQJeIadHv6loYKrgQJeIadHv6loYKrtsIqejhPWb_nVBUQsII9FZuVtdCVEVVZxZVVZXBHEShjlhKVOEuvkzaT0QSyrjdTdTdw0SQOXs96vzjOXs98rfuhKep76zB_EfZ3i10_-nMaxEM2iYvmH6t2-MgbyYLfgEnCjSpseGnz-EkbPmohpKNMedJFBSWv6xsxlK5LE2zVkDjUCvzPqrp7w09JCUVUSqmMCCqnjh05gQo19EwzWRoPEq8dwwq81unDEkd44OuPd40tkQgh_ka6XCNmg4PG4Da_d Sent from the U2 - Users mailing list archive at Nabble.com. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://cp.mcafee.com/d/avndygQ86QmhP2rz33apKVJ6WarZQrFCzASzt5d-Waq9EVdEThjvKztCVJ6WapEVvpood79Kl8XUz458qmDm56RLzaIundEqmDm56RLzaIundKKmd79EVZ5_HYOYqemm4Q-LsKCPsQsY-M-YY-ZORQr8FGETsVkffGhBrwqrjdFCXCXCM0pYGjFYjfNVJdIzM071dnoovaAVgtHzqptKDNErrjbJQ-d2V2Hsbvg57OFeDNc_7CQSOf00jrdNPNIQJxdcQKCy0axEM2jh17RGNDgQgr10Qg2YLfgEq89AZCq80WFEwz-EkdTdQm8A9a7I ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] LIST reports and Fields that Do reads
To poke a point, let me address the issue of the "field that does a read" If what you mean is, that you have a dictionary entry which is an I descriptor of the SUBR type then the subroutine code is only read once and stored. If the subroutine does a BASIC READ in its own code, that read will be repeated each time its accessed because the system really has no way of knowing that it's a repeat read. If your I description only does something like a TRANS command to a file, the file pointer will be read and stored once, and then ref'ed on each subsequent touch in that query. However any underlying record in that query will be read again. So you get half and half. -Original Message- From: Israel, John R. To: 'U2 Users List' Sent: Fri, Jul 19, 2013 1:15 pm Subject: Re: [U2] LIST reports and Fields that Do reads Yes, the read will be done each time the record is LISTed (SORTed, SELECTed, etc). JRI -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of randyleesmith Sent: Friday, July 19, 2013 4:07 PM To: u2-users@listserver.u2ug.org Subject: [U2] LIST reports and Fields that Do reads Lets say you have a field that calls a subroutine. In this routine you do a read to lookup a description which it what is passed back. When you do a LIST to create a report with this field will the read be done each time? I was just wondering how the Universe system handle's this. Dose the system store the first read in it's in memory and just uses that instead of doing a read each time? -- View this message in context: http://cp.mcafee.com/d/5fHCNApdEIzC4T666kPtPqdQkTXETjd79J6WarZQkQjhOrhKyC_t6XdPqdQkPhO-OMMqejsGhTN68agQJeIadHv6loYKrgQJeIadHv6loYKrtsIqejhPWb_nVBUQsII9FZuVtdCVEVVZxZVVZXBHEShjlhKVOEuvkzaT0QSyrjdTdTdw0SQOXs96vzjOXs98rfuhKep76zB_EfZ3i10_-nMaxEM2iYvmH6t2-MgbyYLfgEnCjSpseGnz-EkbPmohpKNMedJFBSWv6xsxlK5LE2zVkDjUCvzPqrp7w09JCUVUSqmMCCqnjh05gQo19EwzWRoPEq8dwwq81unDEkd44OuPd40tkQgh_ka6XCNmg4PG4Da_d Sent from the U2 - Users mailing list archive at Nabble.com. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://cp.mcafee.com/d/avndygQ86QmhP2rz33apKVJ6WarZQrFCzASzt5d-Waq9EVdEThjvKztCVJ6WapEVvpood79Kl8XUz458qmDm56RLzaIundEqmDm56RLzaIundKKmd79EVZ5_HYOYqemm4Q-LsKCPsQsY-M-YY-ZORQr8FGETsVkffGhBrwqrjdFCXCXCM0pYGjFYjfNVJdIzM071dnoovaAVgtHzqptKDNErrjbJQ-d2V2Hsbvg57OFeDNc_7CQSOf00jrdNPNIQJxdcQKCy0axEM2jh17RGNDgQgr10Qg2YLfgEq89AZCq80WFEwz-EkdTdQm8A9a7I ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
[U2] LIST reports and Fields that Do reads
Lets say you have a field that calls a subroutine. In this routine you do a read to lookup a description which it what is passed back. When you do a LIST to create a report with this field will the read be done each time? I was just wondering how the Universe system handle's this. Dose the system store the first read in it's in memory and just uses that instead of doing a read each time? -- View this message in context: http://u2-universe-unidata.1073795.n5.nabble.com/LIST-reports-and-Fields-that-Do-reads-tp41304.html Sent from the U2 - Users mailing list archive at Nabble.com. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] LIST reports and Fields that Do reads
> From: David Wolverton > In UniData we also make sure the file is opened to a COMMON > variable. Makes a huge performance difference vs doing the OPEN on > every call to the subroutine. > YMMV > From: Wjhonson > I had forgotten that one! Wow, I thought that was SOP these days across all "new" MV apps of any size. Then again we hardly ever discuss style and coding patterns in these forums so it's no surprise that patterns like this aren't as common as Design Patterns ala GOF. I never re-open a file if it's used across many programs, and I use Include items to contain the housekeeping that determines whether to open the files and to do the opening. I use named common in D3 because it keeps the files open across level pushing and between TCL executions. The pattern is: - Enter into a program - Move into the Include code - If current account is not the same as the prior account, set INIT=-1 - Check INIT flag -- If not set or -1 do all initialization, open files -- Otherwise just continue - Return to the "functional" code These patterns make for small and well organized code. It's easy to make a single change that affects the entire application (need to get them right though). Adding new modules is easier because the housekeeping is already done elsewhere. Optimizations in one place can impact the entire app. HTH T ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] LIST reports and Fields that Do reads
I had forgotten that one! -Original Message- From: David Wolverton To: U2 Users List Cc: u2-users Sent: Fri, Jul 19, 2013 10:13 pm Subject: Re: [U2] LIST reports and Fields that Do reads In UniData we also make sure the file is opened to a COMMON variable. Makes a huge performance difference vs doing the OPEN on every call to the subroutine. YMMV Sent from my iPhone. Please forgive brevity as well as any auto-corrected or fat finger spelling errors! On Jul 19, 2013, at 1:29 PM, randyleesmith wrote: > In this case it is a SUBR call. > > Ok, thanks I'm a little older school and speed was always an issue I had to > be aware of. > > Thanks for all the quick feedback. > > > > - > I used to be an Optimist until I knocked over the glass. > -- > View this message in context: > http://u2-universe-unidata.1073795.n5.nabble.com/LIST-reports-and-Fields-that-Do-reads-tp41304p41308.html > Sent from the U2 - Users mailing list archive at Nabble.com. > ___ > U2-Users mailing list > U2-Users@listserver.u2ug.org > http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] LIST reports and Fields that Do reads
In UniData we also make sure the file is opened to a COMMON variable. Makes a huge performance difference vs doing the OPEN on every call to the subroutine. YMMV Sent from my iPhone. Please forgive brevity as well as any auto-corrected or fat finger spelling errors! On Jul 19, 2013, at 1:29 PM, randyleesmith wrote: > In this case it is a SUBR call. > > Ok, thanks I'm a little older school and speed was always an issue I had to > be aware of. > > Thanks for all the quick feedback. > > > > - > I used to be an Optimist until I knocked over the glass. > -- > View this message in context: > http://u2-universe-unidata.1073795.n5.nabble.com/LIST-reports-and-Fields-that-Do-reads-tp41304p41308.html > Sent from the U2 - Users mailing list archive at Nabble.com. > ___ > U2-Users mailing list > U2-Users@listserver.u2ug.org > http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] LIST reports and Fields that Do reads
In this case it is a SUBR call. Ok, thanks I'm a little older school and speed was always an issue I had to be aware of. Thanks for all the quick feedback. - I used to be an Optimist until I knocked over the glass. -- View this message in context: http://u2-universe-unidata.1073795.n5.nabble.com/LIST-reports-and-Fields-that-Do-reads-tp41304p41308.html Sent from the U2 - Users mailing list archive at Nabble.com. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users