RE: [U2] Strange happening... (Mystery Solved)
Well, Apparantly the problem was a item ID was in the file. Also, in looking at this example (not expecting a blank Item ID) SELECT FILENAME LOOP READNEXT ID ELSE EXIT WHILE ID DO CODE CODE with GOSUB CODE CODE REPEAT SELECT FILENAME LOOP WHILE READNEXT ID CODE... CODE with GOSUB CODE CODE REPEAT These two example are not the same. The second example would not have ended the loop, since the While is testing the status of the READNEXT action, whereas the original coding (top example), the While is testing the status of ID variable. What we really needed was: SELECT FILENAME LOOP WHILE READNEXT ID IF NOT(ID) THEN CONTINUE CODE REPEAT RAID was quite helpful, especially with having the program be able to trigger jumping into it, then being able to single step through the program, and query the values of the variables. At least now I know why removing the WHILE/DO statement fixed the problem, although it actually didn't fix it, but rather allowed a corrupt record to pass throught the body of the program (which could have been worse than having it stop short. Although it would have been better if an error message was displayed...ie. Item ID not of expected length ':@ID:' ; INPUT XX: ; CONTINUE But, those are the joys you can get sifting through multiple programmer Code. George -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2- us...@listserver.u2ug.org] On Behalf Of Jacques G. Sent: Friday, February 27, 2009 12:27 PM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Strange happening... In the example of code you have, the loop will exit if your key (variable ID) is equal to an empty string or a string that can be evaluated to zero for example values like these: 0E1,0E10, 0E100 (on Universe) (empty string) --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Strange happening...
Allen, Regarding your loop structure below. What happens if the ID is empty string? Won't it bail out before all the ids are read! Eric Armstrong Lobel Financial IT Dept -Original Message- From: Allen Egerton [mailto:aeger...@pobox.com] Sent: Friday, February 27, 2009 8:37 AM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Strange happening... As for the loop structure, I tend to like this: SELECT FILENAME LOOP WHILE READNEXT ID CODE CODE CODE with GOSUB CODE CODE REPEAT It's clean, it's concise, it's easy to read... And I wish I could remember who taught me that you could combine the LOOP and READNEXT in that manner... -- Allen Egerton aegerton at pobox dot com PGP Key ID 0x8EA57261 --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ LOBEL FINANCIAL PRIVACY NOTICE: This communication may contain confidential company information that is protected by federal law. Federal regulations prohibit the disclosure (or re-disclosure) of confidential information without the written consent of the person(s) to whom it pertains. Additionally, the views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Strange happening...
It shouldn't, at least not to a empty ID because the condition test is on the READNEXT, not the ID. However, it will pass an empty ID to the coding, which could be worse, if there aren't constraint checks on the ID. George -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2- us...@listserver.u2ug.org] On Behalf Of Eric Armstrong Sent: Monday, March 02, 2009 11:28 AM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Strange happening... Allen, Regarding your loop structure below. What happens if the ID is empty string? Won't it bail out before all the ids are read! Eric Armstrong Lobel Financial IT Dept -Original Message- From: Allen Egerton [mailto:aeger...@pobox.com] Sent: Friday, February 27, 2009 8:37 AM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Strange happening... As for the loop structure, I tend to like this: SELECT FILENAME LOOP WHILE READNEXT ID CODE CODE CODE with GOSUB CODE CODE REPEAT It's clean, it's concise, it's easy to read... And I wish I could remember who taught me that you could combine the LOOP and READNEXT in that manner... -- Allen Egerton aegerton at pobox dot com PGP Key ID 0x8EA57261 --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] Strange happening...
I tend to use: SELECT FILENAME EOF = @FALSE LOOP READNEXT ID ELSE EOF = @TRUE UNTIL EOF DO CODE CODE CODE with GOSUB CODE CODE REPEAT The advantage here is that it allows you to bail out of the loop of you want to by setting EOF David -- From: George Gallen ggal...@wyanokegroup.com Sent: Monday, March 02, 2009 6:01 PM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Strange happening... It shouldn't, at least not to a empty ID because the condition test is on the READNEXT, not the ID. However, it will pass an empty ID to the coding, which could be worse, if there aren't constraint checks on the ID. George -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2- us...@listserver.u2ug.org] On Behalf Of Eric Armstrong Sent: Monday, March 02, 2009 11:28 AM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Strange happening... Allen, Regarding your loop structure below. What happens if the ID is empty string? Won't it bail out before all the ids are read! Eric Armstrong Lobel Financial IT Dept -Original Message- From: Allen Egerton [mailto:aeger...@pobox.com] Sent: Friday, February 27, 2009 8:37 AM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Strange happening... As for the loop structure, I tend to like this: SELECT FILENAME LOOP WHILE READNEXT ID CODE CODE CODE with GOSUB CODE CODE REPEAT It's clean, it's concise, it's easy to read... And I wish I could remember who taught me that you could combine the LOOP and READNEXT in that manner... -- Allen Egerton aegerton at pobox dot com PGP Key ID 0x8EA57261 --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] Strange happening...
Eric Armstrong wrote: Allen, Regarding your loop structure below. What happens if the ID is empty string? Won't it bail out before all the ids are read! Eric Armstrong Lobel Financial IT Dept Nope. It's running off of an active select list, it'll process the record. Since I'm selecting the file pointer, rather than executing a SELECT, I'm going on the assumption that I want to process every record in the file. If, as stated in another response to this thread, the poster doesn't want the record that has a null-id to be processed, then I'd probably do something like this: SELECT FILENAME LOOP WHILE READNEXT ID IF (ID) THEN CODE CODE CODE with GOSUB CODE CODE END ELSE Error handling code END REPEAT -- Allen Egerton aeger...@pobox.com 860-912-8067 PGP Key ID 0x8EA57261 --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Strange happening...
I never thought about a ID. Is this something you would do deliberately for some reason or is it something that would happen accidently? Can you write a record with a null ID? What would it hash to? Regarding your loop structure below. What happens if the ID is empty string? Won't it bail out before all the ids are read! Charles Shaffer Senior Analyst NTN-Bower Corporation --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Strange happening...
It happens accidently with us, and Universe writes the record just fine. Eric Armstrong Lobel Financial IT Dept -Original Message- From: charles_shaf...@ntn-bower.com [mailto:charles_shaf...@ntn-bower.com] Sent: Monday, March 02, 2009 10:47 AM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Strange happening... I never thought about a ID. Is this something you would do deliberately for some reason or is it something that would happen accidently? Can you write a record with a null ID? What would it hash to? LOBEL FINANCIAL PRIVACY NOTICE: This communication may contain confidential company information that is protected by federal law. Federal regulations prohibit the disclosure (or re-disclosure) of confidential information without the written consent of the person(s) to whom it pertains. Additionally, the views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] Strange happening...
I use LOOP READNEXT ID ELSE ID = '' UNTIL ID = '' Do Stuff REPEAT I thought this was a safe way to check for the end of the list. I just used the ID as a flag and I wasn't sure what the value would be at the end of a list. I guess I was assuming that a SELECT list would not contain an ID of ''. Now I am wondering if this is a good idea. David said I tend to use: SELECT FILENAME EOF = @FALSE LOOP READNEXT ID ELSE EOF = @TRUE UNTIL EOF DO CODE CODE CODE with GOSUB CODE CODE REPEAT Charles Shaffer Senior Analyst NTN-Bower Corporation --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Strange happening...
Depends If you want to try to put a stealthy record in a file, you it's deliberate. Most times, it accidental due to a Write who's ID for whatever reason had a value of and it will come back to bite you if you don't consider it, case in point I didn't even consider that to be the problem I was having, even though I've been bit before. George -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2- us...@listserver.u2ug.org] On Behalf Of charles_shaf...@ntn-bower.com Sent: Monday, March 02, 2009 1:47 PM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Strange happening... I never thought about a ID. Is this something you would do deliberately for some reason or is it something that would happen accidently? Can you write a record with a null ID? What would it hash to? Regarding your loop structure below. What happens if the ID is empty string? Won't it bail out before all the ids are read! Charles Shaffer Senior Analyst NTN-Bower Corporation --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] Strange happening...
And the disadvantage is that you still have an active select list when you set EOF to TRUE. David Beaty wrote: I tend to use: SELECT FILENAME EOF = @FALSE LOOP READNEXT ID ELSE EOF = @TRUE UNTIL EOF DO CODE CODE CODE with GOSUB CODE CODE REPEAT The advantage here is that it allows you to bail out of the loop of you want to by setting EOF David -- From: George Gallen ggal...@wyanokegroup.com Sent: Monday, March 02, 2009 6:01 PM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Strange happening... It shouldn't, at least not to a empty ID because the condition test is on the READNEXT, not the ID. However, it will pass an empty ID to the coding, which could be worse, if there aren't constraint checks on the ID. George -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2- us...@listserver.u2ug.org] On Behalf Of Eric Armstrong Sent: Monday, March 02, 2009 11:28 AM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Strange happening... Allen, Regarding your loop structure below. What happens if the ID is empty string? Won't it bail out before all the ids are read! Eric Armstrong Lobel Financial IT Dept -Original Message- From: Allen Egerton [mailto:aeger...@pobox.com] Sent: Friday, February 27, 2009 8:37 AM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Strange happening... As for the loop structure, I tend to like this: SELECT FILENAME LOOP WHILE READNEXT ID CODE CODE CODE with GOSUB CODE CODE REPEAT It's clean, it's concise, it's easy to read... And I wish I could remember who taught me that you could combine the LOOP and READNEXT in that manner... -- Allen Egerton aegerton at pobox dot com PGP Key ID 0x8EA57261 --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Strange happening...
I have had to abandon that as well. Eric Armstrong Lobel Financial IT Dept -Original Message- From: charles_shaf...@ntn-bower.com [mailto:charles_shaf...@ntn-bower.com] Sent: Monday, March 02, 2009 11:18 AM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Strange happening... I use LOOP READNEXT ID ELSE ID = '' UNTIL ID = '' Do Stuff REPEAT I thought this was a safe way to check for the end of the list. I just used the ID as a flag and I wasn't sure what the value would be at the end of a list. I guess I was assuming that a SELECT list would not contain an ID of ''. Now I am wondering if this is a good idea. David said I tend to use: SELECT FILENAME EOF = @FALSE LOOP READNEXT ID ELSE EOF = @TRUE UNTIL EOF DO CODE CODE CODE with GOSUB CODE CODE REPEAT Charles Shaffer Senior Analyst NTN-Bower Corporation --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ LOBEL FINANCIAL PRIVACY NOTICE: This communication may contain confidential company information that is protected by federal law. Federal regulations prohibit the disclosure (or re-disclosure) of confidential information without the written consent of the person(s) to whom it pertains. Additionally, the views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Strange happening...
We have found out the hard way that an unintentional empty string record ID can also produce some VERY strange record lock situations. It seems like everyone who tries to access the file winds up queued for a record lock on the bad ID. (UD/SB+/Prelude) Norman Morgan nmor...@brake.com http://www.brake.com Laissez les bon temps rouler! I use LOOP READNEXT ID ELSE ID = '' UNTIL ID = '' Do Stuff REPEAT I thought this was a safe way to check for the end of the list. I just used the ID as a flag and I wasn't sure what the value would be at the end of a list. I guess I was assuming that a SELECT list would not contain an ID of ''. Now I am wondering if this is a good idea. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] Strange happening...
As a rule of thumb, one shouldn't use a string as a boolean unless it's intended to be a boolean like a 0 or a 1. I've encountered many bugs because a test would do: IF VARIABLE THEN Instead of: IF VARIABLE NETHEN ... or IF LEN(VARIABLE) 0 - Original Message From: Timothy Snyder tsnyd...@us.ibm.com To: u2-users@listserver.u2ug.org Sent: Monday, March 2, 2009 2:38:33 PM Subject: Re: [U2] Strange happening... If, as stated in another response to this thread, the poster doesn't want the record that has a null-id to be processed, then I'd probably do something like this: SELECT FILENAME LOOP WHILE READNEXT ID IF (ID) THEN CODE CODE CODE with GOSUB CODE CODE END ELSE Error handling code END REPEAT Be careful with that! If there's a valid ID of 0 or 000 or 0 it would hit the error-handling code. I suggest checking ID against an empty string, since that's the actual error condition.. Tim Snyder Consulting I/T Specialist U2 Lab Services Information Management, IBM Software Group --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
[U2] Strange happening...
ok...I found this code snipit (REALITY FLAVOR) SELECT FILENAME LOOP READNEXT ID ELSE EXIT WHILE ID DO CODE CODE with GOSUB CODE CODE REPEAT What was happening was the loop was exiting early, but it was exiting after the CODE with GOSUB line was executed. What struck me was why there was a While DO as well as an EXIT in the loop? while nothing in the CODE or GOSUBs modified the ID, would having both the WHILE/DO and EXIT cause some kind of problem? After I removed (commented out) the WHILE/DO line, the program ran as expected and processed the 100,000 records, (whereas before it stopped after 6). George --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Strange happening...
If the ID equates to false it will exit - i.e. a record with ID 00 Edward -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2-us...@listserver.u2ug.org] On Behalf Of George Gallen Sent: 27 February 2009 14:26 To: Ardent Subject: [U2] Strange happening... ok...I found this code snipit (REALITY FLAVOR) SELECT FILENAME LOOP READNEXT ID ELSE EXIT WHILE ID DO CODE CODE with GOSUB CODE CODE REPEAT What was happening was the loop was exiting early, but it was exiting after the CODE with GOSUB line was executed. What struck me was why there was a While DO as well as an EXIT in the loop? while nothing in the CODE or GOSUBs modified the ID, would having both the WHILE/DO and EXIT cause some kind of problem? After I removed (commented out) the WHILE/DO line, the program ran as expected and processed the 100,000 records, (whereas before it stopped after 6). George --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- Please remember to recycle wherever possible. Reduce, reuse, recycle, think do you need to print this e-mail? --- This e-mail and any attachment(s), is confidential and may be legally privileged. It is intended solely for the addressee. If you are not the addressee, dissemination, copying or use of this e-mail or any of its content is prohibited and may be unlawful. If you are not the intended recipient please inform the sender immediately and destroy the e-mail, any attachment(s) and any copies. All liability for viruses is excluded to the fullest extent permitted by law. It is your responsibility to scan or otherwise check this email and any attachment(s). Unless otherwise stated (i) views expressed in this message are those of the individual sender (ii) no contract may be construed by this e-mail. Emails may be monitored and you are taken to consent to this monitoring. Civica Services Limited, Company No. 02374268; Civica UK Limited, Company No. 01628868 Both companies are registered in England and Wales and each has its registered office at 2 Burston Road, Putney, London, SW15 6AR. --- --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Strange happening...
that wasn't the case. The id was combination of 13 letters and numbers. The strange part was where the while/do seemed to kick in. The item was read from the file without a problem 3-4 lines of code execute as expected it then executed a gosub, but when it returned, it dropped out of the loop the id variable was never modified. Strange. George -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2- us...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: Friday, February 27, 2009 9:39 AM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Strange happening... If the ID equates to false it will exit - i.e. a record with ID 00 Edward -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2-us...@listserver.u2ug.org] On Behalf Of George Gallen Sent: 27 February 2009 14:26 To: Ardent Subject: [U2] Strange happening... ok...I found this code snipit (REALITY FLAVOR) SELECT FILENAME LOOP READNEXT ID ELSE EXIT WHILE ID DO CODE CODE with GOSUB CODE CODE REPEAT What was happening was the loop was exiting early, but it was exiting after the CODE with GOSUB line was executed. What struck me was why there was a While DO as well as an EXIT in the loop? while nothing in the CODE or GOSUBs modified the ID, would having both the WHILE/DO and EXIT cause some kind of problem? After I removed (commented out) the WHILE/DO line, the program ran as expected and processed the 100,000 records, (whereas before it stopped after 6). George --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- Please remember to recycle wherever possible. Reduce, reuse, recycle, think do you need to print this e-mail? --- This e-mail and any attachment(s), is confidential and may be legally privileged. It is intended solely for the addressee. If you are not the addressee, dissemination, copying or use of this e-mail or any of its content is prohibited and may be unlawful. If you are not the intended recipient please inform the sender immediately and destroy the e-mail, any attachment(s) and any copies. All liability for viruses is excluded to the fullest extent permitted by law. It is your responsibility to scan or otherwise check this email and any attachment(s). Unless otherwise stated (i) views expressed in this message are those of the individual sender (ii) no contract may be construed by this e-mail. Emails may be monitored and you are taken to consent to this monitoring. Civica Services Limited, Company No. 02374268; Civica UK Limited, Company No. 01628868 Both companies are registered in England and Wales and each has its registered office at 2 Burston Road, Putney, London, SW15 6AR. --- --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Strange happening...
I would follow it line-by-line with the debugger. Thanks, David A. Green www.dagconsulting.com (480) 813-1725 -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2-us...@listserver.u2ug.org] On Behalf Of George Gallen Sent: Friday, February 27, 2009 8:21 AM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Strange happening... that wasn't the case. The id was combination of 13 letters and numbers. The strange part was where the while/do seemed to kick in. The item was read from the file without a problem 3-4 lines of code execute as expected it then executed a gosub, but when it returned, it dropped out of the loop the id variable was never modified. Strange. George -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2- us...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: Friday, February 27, 2009 9:39 AM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Strange happening... If the ID equates to false it will exit - i.e. a record with ID 00 Edward -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2-us...@listserver.u2ug.org] On Behalf Of George Gallen Sent: 27 February 2009 14:26 To: Ardent Subject: [U2] Strange happening... ok...I found this code snipit (REALITY FLAVOR) SELECT FILENAME LOOP READNEXT ID ELSE EXIT WHILE ID DO CODE CODE with GOSUB CODE CODE REPEAT What was happening was the loop was exiting early, but it was exiting after the CODE with GOSUB line was executed. What struck me was why there was a While DO as well as an EXIT in the loop? while nothing in the CODE or GOSUBs modified the ID, would having both the WHILE/DO and EXIT cause some kind of problem? After I removed (commented out) the WHILE/DO line, the program ran as expected and processed the 100,000 records, (whereas before it stopped after 6). George --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- Please remember to recycle wherever possible. Reduce, reuse, recycle, think do you need to print this e-mail? --- This e-mail and any attachment(s), is confidential and may be legally privileged. It is intended solely for the addressee. If you are not the addressee, dissemination, copying or use of this e-mail or any of its content is prohibited and may be unlawful. If you are not the intended recipient please inform the sender immediately and destroy the e-mail, any attachment(s) and any copies. All liability for viruses is excluded to the fullest extent permitted by law. It is your responsibility to scan or otherwise check this email and any attachment(s). Unless otherwise stated (i) views expressed in this message are those of the individual sender (ii) no contract may be construed by this e-mail. Emails may be monitored and you are taken to consent to this monitoring. Civica Services Limited, Company No. 02374268; Civica UK Limited, Company No. 01628868 Both companies are registered in England and Wales and each has its registered office at 2 Burston Road, Putney, London, SW15 6AR. --- --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Strange happening...
What was strange, is the code worked fine during other runs (with different files being read), but it was consistant that is always stopped with that one file at the 6th record. I didn't use the debugger, but when I get a chance, I'll uncomment the line and retest it, and use the debugger to get more information. From what I saw, it shouldn't have dropped out with out an error being displayed Thanks George -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2- us...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: Friday, February 27, 2009 10:52 AM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Strange happening... It looks like it's already been followed within the debugger to get the information given by George below. One possibility is that the gosub'd code is doing a CLEARSELECT under some circumstances, or something else that destroys the list? Possibly also the gosub'd code has a GO that's destroying the call stack? Of course these assume that the removal of the UNTIL ID DO line is a red herring and the cause is elsewhere... I'd try reducing the code around the loop - see if a minimal test case gives the same result? If so then it looks like a bug in the compiler. Edward --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Strange happening...
It looks like it's already been followed within the debugger to get the information given by George below. One possibility is that the gosub'd code is doing a CLEARSELECT under some circumstances, or something else that destroys the list? Possibly also the gosub'd code has a GO that's destroying the call stack? Of course these assume that the removal of the UNTIL ID DO line is a red herring and the cause is elsewhere... I'd try reducing the code around the loop - see if a minimal test case gives the same result? If so then it looks like a bug in the compiler. Edward -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2-us...@listserver.u2ug.org] On Behalf Of David A. Green Sent: 27 February 2009 15:33 To: u2-users@listserver.u2ug.org Subject: RE: [U2] Strange happening... I would follow it line-by-line with the debugger. Thanks, David A. Green www.dagconsulting.com (480) 813-1725 -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2-us...@listserver.u2ug.org] On Behalf Of George Gallen Sent: Friday, February 27, 2009 8:21 AM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Strange happening... that wasn't the case. The id was combination of 13 letters and numbers. The strange part was where the while/do seemed to kick in. The item was read from the file without a problem 3-4 lines of code execute as expected it then executed a gosub, but when it returned, it dropped out of the loop the id variable was never modified. Strange. George -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2- us...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: Friday, February 27, 2009 9:39 AM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Strange happening... If the ID equates to false it will exit - i.e. a record with ID 00 Edward -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2-us...@listserver.u2ug.org] On Behalf Of George Gallen Sent: 27 February 2009 14:26 To: Ardent Subject: [U2] Strange happening... ok...I found this code snipit (REALITY FLAVOR) SELECT FILENAME LOOP READNEXT ID ELSE EXIT WHILE ID DO CODE CODE with GOSUB CODE CODE REPEAT What was happening was the loop was exiting early, but it was exiting after the CODE with GOSUB line was executed. What struck me was why there was a While DO as well as an EXIT in the loop? while nothing in the CODE or GOSUBs modified the ID, would having both the WHILE/DO and EXIT cause some kind of problem? After I removed (commented out) the WHILE/DO line, the program ran as expected and processed the 100,000 records, (whereas before it stopped after 6). George --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- Please remember to recycle wherever possible. Reduce, reuse, recycle, think do you need to print this e-mail? --- This e-mail and any attachment(s), is confidential and may be legally privileged. It is intended solely for the addressee. If you are not the addressee, dissemination, copying or use of this e-mail or any of its content is prohibited and may be unlawful. If you are not the intended recipient please inform the sender immediately and destroy the e-mail, any attachment(s) and any copies. All liability for viruses is excluded to the fullest extent permitted by law. It is your responsibility to scan or otherwise check this email and any attachment(s). Unless otherwise stated (i) views expressed in this message are those of the individual sender (ii) no contract may be construed by this e-mail. Emails may be monitored and you are taken to consent to this monitoring. Civica Services Limited, Company No. 02374268; Civica UK Limited, Company No. 01628868 Both companies are registered in England and Wales and each has its registered office at 2 Burston Road, Putney, London, SW15 6AR. --- --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] Strange happening...
George Gallen wrote: ok...I found this code snipit (REALITY FLAVOR) SELECT FILENAME LOOP READNEXT ID ELSE EXIT WHILE ID DO CODE CODE with GOSUB CODE CODE REPEAT What was happening was the loop was exiting early, but it was exiting after the CODE with GOSUB line was executed. What struck me was why there was a While DO as well as an EXIT in the loop? while nothing in the CODE or GOSUBs modified the ID, would having both the WHILE/DO and EXIT cause some kind of problem? After I removed (commented out) the WHILE/DO line, the program ran as expected and processed the 100,000 records, (whereas before it stopped after 6). While the code itself is less than elegant, I strongly suspect that the exiting lies in what's being done in the GOSUB. Perhaps it's doing a SELECT or a CLEARSELECT, or something else that corrupts the active select list. I recently saw a piece of code where the active select list was trashed because the code opened a file, then executed a create-file on the opened file... Took us a while to figure that one out. As for the loop structure, I tend to like this: SELECT FILENAME LOOP WHILE READNEXT ID CODE CODE CODE with GOSUB CODE CODE REPEAT It's clean, it's concise, it's easy to read... And I wish I could remember who taught me that you could combine the LOOP and READNEXT in that manner... -- Allen Egerton aegerton at pobox dot com PGP Key ID 0x8EA57261 --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] Strange happening...
George, Edward, Just a shot in the dark - prompted by Edwards comment something else that destroys the list. We found on UniData that, when a SELECT statement creates a list outside of the program issuing the SELECT, any other SELECT statement issued by the same user in the same or any other program destroys the previously active list. The solution was to EXECUTE the SELECT statement with a RTNLIST to an internal list var and then READNEXT the items FROM the list var within the program. This way you can have as many lists as you wish without stepping on any other list as long as the list var names are unique. hth, Dave Dave Taylor Sysmark Information Systems, Inc. Authorized IBM Business Partner 49 Aspen Way Rolling Hills Estates, CA 90274 (O) 800-SYSMARK (800-797-6275) (F) 310-377-3550 (C) 310-561-5200 www.sysmarkinfo.com - Original Message - From: Edward Brown ebr...@civica.co.uk To: u2-users@listserver.u2ug.org Sent: Friday, February 27, 2009 7:52 AM Subject: RE: [U2] Strange happening... It looks like it's already been followed within the debugger to get the information given by George below. One possibility is that the gosub'd code is doing a CLEARSELECT under some circumstances, or something else that destroys the list? Possibly also the gosub'd code has a GO that's destroying the call stack? Of course these assume that the removal of the UNTIL ID DO line is a red herring and the cause is elsewhere... I'd try reducing the code around the loop - see if a minimal test case gives the same result? If so then it looks like a bug in the compiler. Edward -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2-us...@listserver.u2ug.org] On Behalf Of David A. Green Sent: 27 February 2009 15:33 To: u2-users@listserver.u2ug.org Subject: RE: [U2] Strange happening... I would follow it line-by-line with the debugger. Thanks, David A. Green www.dagconsulting.com (480) 813-1725 -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2-us...@listserver.u2ug.org] On Behalf Of George Gallen Sent: Friday, February 27, 2009 8:21 AM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Strange happening... that wasn't the case. The id was combination of 13 letters and numbers. The strange part was where the while/do seemed to kick in. The item was read from the file without a problem 3-4 lines of code execute as expected it then executed a gosub, but when it returned, it dropped out of the loop the id variable was never modified. Strange. George -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2- us...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: Friday, February 27, 2009 9:39 AM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Strange happening... If the ID equates to false it will exit - i.e. a record with ID 00 Edward -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2-us...@listserver.u2ug.org] On Behalf Of George Gallen Sent: 27 February 2009 14:26 To: Ardent Subject: [U2] Strange happening... ok...I found this code snipit (REALITY FLAVOR) SELECT FILENAME LOOP READNEXT ID ELSE EXIT WHILE ID DO CODE CODE with GOSUB CODE CODE REPEAT What was happening was the loop was exiting early, but it was exiting after the CODE with GOSUB line was executed. What struck me was why there was a While DO as well as an EXIT in the loop? while nothing in the CODE or GOSUBs modified the ID, would having both the WHILE/DO and EXIT cause some kind of problem? After I removed (commented out) the WHILE/DO line, the program ran as expected and processed the 100,000 records, (whereas before it stopped after 6). George --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- Please remember to recycle wherever possible. Reduce, reuse, recycle, think do you need to print this e-mail? --- This e-mail and any attachment(s), is confidential and may be legally privileged. It is intended solely for the addressee. If you are not the addressee, dissemination, copying or use of this e-mail or any of its content is prohibited and may be unlawful. If you are not the intended recipient please inform the sender immediately and destroy the e-mail, any attachment(s) and any copies. All liability for viruses is excluded to the fullest extent permitted by law. It is your responsibility to scan or otherwise check this email and any attachment(s). Unless otherwise stated (i) views expressed in this message are those of the individual sender (ii) no contract may be construed by this e-mail. Emails may be monitored and you are taken to consent to this monitoring. Civica Services Limited, Company
RE: [U2] Strange happening...
-Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2- us...@listserver.u2ug.org] On Behalf Of Allen Egerton Sent: Friday, February 27, 2009 11:37 AM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Strange happening... While the code itself is less than elegant, I strongly suspect that the exiting lies in what's being done in the GOSUB. Perhaps it's doing a SELECT or a CLEARSELECT, or something else that corrupts the active select list. The subroutine uses a bunch of IF-THENS, but nothing that would effect the selectlist nor does any file IO. Even if something in the subroutine trashed the selected list or corrupted the variable in the Do/While expression, it shouldn't drop out of the loop until it comes back around to the Do/While check? Or is that incorrect? As for the LOOP WHILE READNEXT ID, I've used this, and have not had issues. Thanks George I recently saw a piece of code where the active select list was trashed because the code opened a file, then executed a create-file on the opened file... Took us a while to figure that one out. As for the loop structure, I tend to like this: SELECT FILENAME LOOP WHILE READNEXT ID CODE CODE CODE with GOSUB CODE CODE REPEAT It's clean, it's concise, it's easy to read... And I wish I could remember who taught me that you could combine the LOOP and READNEXT in that manner... -- Allen Egerton --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
Re: [U2] Strange happening...
In the example of code you have, the loop will exit if your key (variable ID) is equal to an empty string or a string that can be evaluated to zero for example values like these: 0E1,0E10, 0E100 (on Universe) (empty string) Will make the loop end: SELECT FILENAME LOOP READNEXT ID ELSE EXIT WHILE ID DO CODE CODE with GOSUB CODE CODE REPEAT Try: SELECT FILENAME LOOP WHILE READNEXT ID CODE... REPEAT - Original Message From: George Gallen ggal...@wyanokegroup.com To: u2-users@listserver.u2ug.org u2-users@listserver.u2ug.org Sent: Friday, February 27, 2009 10:21:19 AM Subject: RE: [U2] Strange happening... that wasn't the case. The id was combination of 13 letters and numbers. The strange part was where the while/do seemed to kick in. The item was read from the file without a problem 3-4 lines of code execute as expected it then executed a gosub, but when it returned, it dropped out of the loop the id variable was never modified. Strange. George -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2- us...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: Friday, February 27, 2009 9:39 AM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Strange happening... If the ID equates to false it will exit - i.e. a record with ID 00 Edward -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2-us...@listserver.u2ug.org] On Behalf Of George Gallen Sent: 27 February 2009 14:26 To: Ardent Subject: [U2] Strange happening... ok...I found this code snipit (REALITY FLAVOR) SELECT FILENAME LOOP READNEXT ID ELSE EXIT WHILE ID DO CODE CODE with GOSUB CODE CODE REPEAT What was happening was the loop was exiting early, but it was exiting after the CODE with GOSUB line was executed. What struck me was why there was a While DO as well as an EXIT in the loop? while nothing in the CODE or GOSUBs modified the ID, would having both the WHILE/DO and EXIT cause some kind of problem? After I removed (commented out) the WHILE/DO line, the program ran as expected and processed the 100,000 records, (whereas before it stopped after 6). George --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- Please remember to recycle wherever possible. Reduce, reuse, recycle, think do you need to print this e-mail? --- This e-mail and any attachment(s), is confidential and may be legally privileged. It is intended solely for the addressee. If you are not the addressee, dissemination, copying or use of this e-mail or any of its content is prohibited and may be unlawful. If you are not the intended recipient please inform the sender immediately and destroy the e-mail, any attachment(s) and any copies. All liability for viruses is excluded to the fullest extent permitted by law. It is your responsibility to scan or otherwise check this email and any attachment(s). Unless otherwise stated (i) views expressed in this message are those of the individual sender (ii) no contract may be construed by this e-mail. Emails may be monitored and you are taken to consent to this monitoring. Civica Services Limited, Company No. 02374268; Civica UK Limited, Company No. 01628868 Both companies are registered in England and Wales and each has its registered office at 2 Burston Road, Putney, London, SW15 6AR. --- --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] Strange happening...
Can You SELECT File TO 1 To assign the selection to a list number, as the default list number is 0 it would cut down on the chances of the list being used by something else? Just make sure at the end you PERFORM DELETE.LIST 1 so it's not hanging around. Jeffrey Lettau ERP Systems Manager polkaudio -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2-us...@listserver.u2ug.org] On Behalf Of Jacques G. Sent: Friday, February 27, 2009 12:27 PM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Strange happening... In the example of code you have, the loop will exit if your key (variable ID) is equal to an empty string or a string that can be evaluated to zero for example values like these: 0E1,0E10, 0E100 (on Universe) (empty string) Will make the loop end: SELECT FILENAME LOOP READNEXT ID ELSE EXIT WHILE ID DO CODE CODE with GOSUB CODE CODE REPEAT Try: SELECT FILENAME LOOP WHILE READNEXT ID CODE... REPEAT - Original Message From: George Gallen ggal...@wyanokegroup.com To: u2-users@listserver.u2ug.org u2-users@listserver.u2ug.org Sent: Friday, February 27, 2009 10:21:19 AM Subject: RE: [U2] Strange happening... that wasn't the case. The id was combination of 13 letters and numbers. The strange part was where the while/do seemed to kick in. The item was read from the file without a problem 3-4 lines of code execute as expected it then executed a gosub, but when it returned, it dropped out of the loop the id variable was never modified. Strange. George -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2- us...@listserver.u2ug.org] On Behalf Of Edward Brown Sent: Friday, February 27, 2009 9:39 AM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Strange happening... If the ID equates to false it will exit - i.e. a record with ID 00 Edward -Original Message- From: owner-u2-us...@listserver.u2ug.org [mailto:owner-u2-us...@listserver.u2ug.org] On Behalf Of George Gallen Sent: 27 February 2009 14:26 To: Ardent Subject: [U2] Strange happening... ok...I found this code snipit (REALITY FLAVOR) SELECT FILENAME LOOP READNEXT ID ELSE EXIT WHILE ID DO CODE CODE with GOSUB CODE CODE REPEAT What was happening was the loop was exiting early, but it was exiting after the CODE with GOSUB line was executed. What struck me was why there was a While DO as well as an EXIT in the loop? while nothing in the CODE or GOSUBs modified the ID, would having both the WHILE/DO and EXIT cause some kind of problem? After I removed (commented out) the WHILE/DO line, the program ran as expected and processed the 100,000 records, (whereas before it stopped after 6). George --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- Please remember to recycle wherever possible. Reduce, reuse, recycle, think do you need to print this e-mail? --- This e-mail and any attachment(s), is confidential and may be legally privileged. It is intended solely for the addressee. If you are not the addressee, dissemination, copying or use of this e-mail or any of its content is prohibited and may be unlawful. If you are not the intended recipient please inform the sender immediately and destroy the e-mail, any attachment(s) and any copies. All liability for viruses is excluded to the fullest extent permitted by law. It is your responsibility to scan or otherwise check this email and any attachment(s). Unless otherwise stated (i) views expressed in this message are those of the individual sender (ii) no contract may be construed by this e-mail. Emails may be monitored and you are taken to consent to this monitoring. Civica Services Limited, Company No. 02374268; Civica UK Limited, Company No. 01628868 Both companies are registered in England and Wales and each has its registered office at 2 Burston Road, Putney, London, SW15 6AR. --- --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ Disclaimer: This email may contain confidential and/or privileged information. It is intended only for the person or persons to whom it is addressed. Any unauthorized review, use, or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email or telephone and destroy all