Re: [U2] AUTOLOGOUT and ON.ABORT

2009-03-02 Thread Mike Roosa
I created the errlog file and it does appear to be logging some messages.
 Do I have to do anything in uniadmin as I see a couple of error messages
when universe first starts up.
Sun Mar 01 01:00:11  -4701 NT AUTHORITY\system uniVerse Log Daemon started
Sun Mar 01 01:00:11  -4701 NT AUTHORITY\system Unable to read LOGS.DIR entry
from D_UV_LOGS.
Sun Mar 01 01:00:11  -4701 NT AUTHORITY\system Can't start logging, logging
inactivated in uvconfig


On Fri, Feb 27, 2009 at 5:21 PM, Jacques G. jacque...@yahoo.com wrote:

 On unix it's an empty file (size zero) we create:
 EI:

 touch errlog

 On a windows the equivalent would probably be (from dos prompt when in the
 uv account):
 copy con errlog
 ^Z

  1 file(s) copied.

 (After typing CTRL-Z you press[RETURN])  I haven't used the errlog in
 Universe for Windows though.



 - Original Message 
 From: Mike Roosa mike.ro...@gmail.com
 To: u2-users@listserver.u2ug.org
 Sent: Friday, February 27, 2009 3:55:22 PM
 Subject: Re: [U2] AUTOLOGOUT and ON.ABORT

 Ok, so I just create a type 18 file called ERRLOG in the UV account and
 restart universe?

 On Fri, Feb 27, 2009 at 11:59 AM, Martin Phillips 
 martinphill...@ladybridge.com wrote:

  Hi Mike,
 
   I was under the impression that the errlog only existed on
  unix systems. Maybe I'm wrong on this but I can't find it
  anywhere on our system.
 
 
  The errlog file is on Windows too but, just as on Unix, you need to
 create
  an empty errlog file in the UV account directory to enable the system. UV
  looks for this on entry and enables logging.
 
 
  Martin Phillips
  Ladybridge Systems Ltd
  17b Coldstream Lane, Hardingstone, Northampton, NN4 6DB
  +44-(0)1604-709200 ---
 
  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... (Mystery Solved)

2009-03-02 Thread George Gallen
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] AUTOLOGOUT and ON.ABORT

2009-03-02 Thread Eric Armstrong
We use Windows and its kept at \\Mars\UVDB\TOOLS\ERRLOG.BACKUP

Eric Armstrong
Lobel Financial
IT Dept


-Original Message-
From: Mike Roosa [mailto:mike.ro...@gmail.com]
Sent: Friday, February 27, 2009 7:32 AM
To: u2-users@listserver.u2ug.org
Subject: Re: [U2] AUTOLOGOUT and ON.ABORT


I was under the impression that the errlog only existed on unix systems.
 Maybe I'm wrong on this but I can't find it anywhere on our system.

On Fri, Feb 27, 2009 at 1:17 AM, Jacques G. jacque...@yahoo.com wrote:

 If you turn on the errlog file in /u1/uv you may get a message in there
for
 an AUTOLOGOUT.  I'm pretty sure I've seen such messages in the past.  You
 will have the user name, the PID and some text describing the error.

 The errlog file only keeps the last 1001 error messages so you might want
 to have a cron job back them up with a date time stamp periodically during
 the day.



 - Original Message 
  Our users have their AUTOLOGOUT set to 30 minutes and it looks like the
  AUTOLOGOUT process causes the ON.ABORT clause to execute.  Is there an
  easy  way using a SYSTEM() or @variable to determine that this ON.ABORT
 is the
  result of an AUTOLOGOUT?
 ---
 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/

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...

2009-03-02 Thread Eric Armstrong
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] AUTOLOGOUT and ON.ABORT

2009-03-02 Thread Jacques G.
You should read your uvconfig file (and Manual) to see if you have a flag for 
it in the Windows version of Universe.  On the Unix version, the only thing I 
need to do in order to turn on the loggin is to create the errlog file.

Your admin menu may have an option for it somewhere.



- Original Message 
From: Mike Roosa mike.ro...@gmail.com
To: u2-users@listserver.u2ug.org
Sent: Monday, March 2, 2009 9:35:11 AM
Subject: Re: [U2] AUTOLOGOUT and ON.ABORT

I created the errlog file and it does appear to be logging some messages.
Do I have to do anything in uniadmin as I see a couple of error messages
when universe first starts up.
Sun Mar 01 01:00:11  -4701 NT AUTHORITY\system uniVerse Log Daemon started
Sun Mar 01 01:00:11  -4701 NT AUTHORITY\system Unable to read LOGS.DIR entry
from D_UV_LOGS.
Sun Mar 01 01:00:11  -4701 NT AUTHORITY\system Can't start logging, logging
inactivated in uvconfig


On Fri, Feb 27, 2009 at 5:21 PM, Jacques G. jacque...@yahoo.com wrote:

 On unix it's an empty file (size zero) we create:
 EI:

 touch errlog

 On a windows the equivalent would probably be (from dos prompt when in the
 uv account):
 copy con errlog
 ^Z

  1 file(s) copied.

 (After typing CTRL-Z you press[RETURN])  I haven't used the errlog in
 Universe for Windows though.



 - Original Message 
 From: Mike Roosa mike.ro...@gmail.com
 To: u2-users@listserver.u2ug.org
 Sent: Friday, February 27, 2009 3:55:22 PM
 Subject: Re: [U2] AUTOLOGOUT and ON.ABORT

 Ok, so I just create a type 18 file called ERRLOG in the UV account and
 restart universe?

 On Fri, Feb 27, 2009 at 11:59 AM, Martin Phillips 
 martinphill...@ladybridge.com wrote:

  Hi Mike,
 
   I was under the impression that the errlog only existed on
  unix systems. Maybe I'm wrong on this but I can't find it
  anywhere on our system.
 
 
  The errlog file is on Windows too but, just as on Unix, you need to
 create
  an empty errlog file in the UV account directory to enable the system. UV
  looks for this on entry and enables logging.
 
 
  Martin Phillips
  Ladybridge Systems Ltd
  17b Coldstream Lane, Hardingstone, Northampton, NN4 6DB
  +44-(0)1604-709200 ---
 
  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/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Strange happening...

2009-03-02 Thread George Gallen
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...

2009-03-02 Thread David Beaty

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...

2009-03-02 Thread Allen Egerton
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...

2009-03-02 Thread Charles_Shaffer
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...

2009-03-02 Thread Eric Armstrong
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...

2009-03-02 Thread Charles_Shaffer
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...

2009-03-02 Thread George Gallen
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...

2009-03-02 Thread Mecki Foerthmann
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...

2009-03-02 Thread Eric Armstrong
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...

2009-03-02 Thread Norman Morgan
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...

2009-03-02 Thread Jacques G.
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/


Re: [U2] DO/WHILE vs IF THEN

2009-03-02 Thread Keith Johnson [DATACOM]
Mark Johnson suggested the following change

Before
GOOD.ANS=FALSE
LOOP UNTIL GOOD.ANS DO
   PRINT ENTER 'Y' OR 'N' :;INPUT ANS
   IF ANS=Y OR ANS=N THEN GOOD.ANS=TRUE REPEAT

after
LOOP WHILE TRUE DO
   PRINT ENTER 'Y' OR 'N' :;INPUT ANS
   IF ANS=Y OR ANS=N THEN EXIT
REPEAT

These forms all work (Universe 10.2.0)  and are progressively shorter
than the above

LOOP
   PRINT ENTER 'Y' OR 'N' :;INPUT ANS
   IF ANS=Y OR ANS=N THEN EXIT
REPEAT


LOOP
   PRINT ENTER 'Y' OR 'N' :;INPUT ANS
UNTIL ANS=Y OR ANS=N DO
REPEAT


LOOP
   PRINT ENTER 'Y' OR 'N' :;INPUT ANS
UNTIL ANS=Y OR ANS=N REPEAT


LOOP PRINT ENTER 'Y' OR 'N' :;INPUT ANS
UNTIL ANS=Y OR ANS=N REPEAT


Ray Wurlod was a great proponent of the LOOP WHILE READNEXT ID format.
I believe it may not compile on some MV systems.


Regards, Keith
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] DO/WHILE vs IF THEN

2009-03-02 Thread Jacques G.
The case can be tested also if n/y are acceptable:

LOOP PRINT ENTER 'Y' OR 'N' :;INPUT ANS,1
UNTIL INDEX('NY',UPCASE(ANS),1) REPEAT

*-- P.AM will contain a boolean value  0 for N, 1 for Y --*
FOR X = 1 TO (X+1)
  PRINT ENTER 'Y' OR 'N' :;INPUT ANS,1
  FIND UPCASE(ANS) IN N:@AM:Y SETTING P.AM THEN P.AM -= 1 ; EXIT
NEXT X



- Original Message 
From: Keith Johnson [DATACOM] kei...@datacom.co.nz
To: u2-users@listserver.u2ug.org
Sent: Monday, March 2, 2009 7:38:16 PM
Subject: Re: [U2] DO/WHILE vs IF THEN

Mark Johnson suggested the following change

Before
GOOD.ANS=FALSE
LOOP UNTIL GOOD.ANS DO
   PRINT ENTER 'Y' OR 'N' :;INPUT ANS
   IF ANS=Y OR ANS=N THEN GOOD.ANS=TRUE REPEAT

after
LOOP WHILE TRUE DO
   PRINT ENTER 'Y' OR 'N' :;INPUT ANS
   IF ANS=Y OR ANS=N THEN EXIT
REPEAT

These forms all work (Universe 10.2.0)  and are progressively shorter
than the above

LOOP
   PRINT ENTER 'Y' OR 'N' :;INPUT ANS
   IF ANS=Y OR ANS=N THEN EXIT
REPEAT


LOOP
   PRINT ENTER 'Y' OR 'N' :;INPUT ANS
UNTIL ANS=Y OR ANS=N DO
REPEAT


LOOP
   PRINT ENTER 'Y' OR 'N' :;INPUT ANS
UNTIL ANS=Y OR ANS=N REPEAT


LOOP PRINT ENTER 'Y' OR 'N' :;INPUT ANS
UNTIL ANS=Y OR ANS=N REPEAT


Ray Wurlod was a great proponent of the LOOP WHILE READNEXT ID format.
I believe it may not compile on some MV systems.


Regards, Keith
---
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/