Weird logic problem in a menu screen.

Fry, Mark Mark.Fry@COGNOS.com
Wed, 30 Jan 2002 16:39:50 -0000


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C1A9AC.BC5F5D40
Content-Type: text/plain;
	charset="iso-8859-1"

Hi Guy,

The clue is in the warning QDESIGN gives you when you use the name
SIGNONUSER for your temporary item.  This is a reserved word in PowerHouse,
which returns the username you logged in as.  Try changing the name of your
temporary item to something else, and you should find it works fine.

Best regards,

Mark Fry
Cognos Limited
email: Mark.Fry@Cognos.com

Cognos Limited
Registered in England, number 1635598.  Registered office:  Westerly Point,
Market Street, Bracknell, Berkshire, RG12 1QB


-----Original Message-----
From: Guy Werry [mailto:guy.werry@hbms.ca]
Sent: 30 January 2002 15:28
To: PH Mailing List (E-mail)
Subject: Weird logic problem in a menu screen.


It's either "ask the list" or "throw a massive temper tantrum" time.
Environment: HP-Ux 10.2, Ph 7.33.D3.

I have a menu screen where I want to allow one user to run a sub-screen,
without the other users being aware that the choice is available to them.
I'm using the environment variable HPUSER to hold the user's logon name.

Here is the ENTIRE screen, from a compile listing:

		Q D E S I G N   (7.33.D3)
		Copyright 1997 COGNOS INCORPORATED
		Licensed PH-DEVELOPMENT for customer: 0011380001 HUDSON BAY
MINING & SMELTING 
		UNIX

		> SCREEN $execpath/pjr943kc MENU
		> ;
		> ;
***************************************************************
		> ; SCREEN-ID : PJR943KC
		> ; SOURCE-ID : PJR943KS
		> ; DATE      : MAY 91
		> ;
		> ; PURPOSE:  Employee TRAINING MENU
		> ;
		> ;
		> ; PROCESSING:
		> ;
		> ;
		> ; 1997 Feb 20, GLW, Pr4829.
		> ;     Added a menu selection so that we can access a
scheduler
		> ;     inquiry menu.
		> ;
		>
;****************************************************************
		> ;
		> 
		> DEF RCS-INFO  CHAR * 80 =     &
		>       "$Header: pjr943ks.qks,v 2.1 98/01/20 15:00:33
manffhdv Exp $"
		> 
		> DEFINE D-DATE DATE = SYSDATE
		> 
		> ; DEFINE SIGNONUSER CHAR *8 =
UPSHIFT(GETSYSTEMVAL("HPUSER"))
		> TEMP SIGNONUSER CHAR *8
		*W* The data name SIGNONUSER may conflict with the
machine-specific keyword 
		SIGNONUSER.
		> define authuser char *8 = "BMORRELL"
		> 
		> ;
		> HILITE MESSAGE AUDIBLE INVERSE BLINKING
		> ;
		> TITLE "Human Resources Information System" AT 1,29
		> ;
		> ALIGN (,,70)
		> FIELD D-DATE PREDISPLAY FORMAT YYYYMMMDD SEPARATOR " "
		> ;
		> TITLE "PJR943KC" AT 2,1
		> TITLE "5.0"      AT 3,4
		> HILITE TITLE INVERSE
		> TITLE "TRAINING MAIN MENU" AT 4,31
		> HILITE TITLE OFF
		> ;
		> DRAW THICK 3,20 TO 5,60
		> ;
		> SKIP TO 7
		> ;
		> ALIGN (19,22)
		> SUBSCREEN   $execpath/pjr944kc
&
		>             LABEL "PJR944  Training Inquiry Menu"
		> SUBSCREEN   $execpath/pjr916kc
&
		>             LABEL "PJR916  Training Reports Menu"
		> SKIP
		> TITLE "03 PSR897KC Scheduler Inquiry Menu"
&
		>       AT ,19
		> 
		> COMMAND "SHOWJOB JOB = @.FFHRIS"
&
		>       LABEL "        Who's On System Now?" CLEAR ALL
RESPONSE         &
		>       ID 04
		> 
		> procedure designer 03
		>    begin
		>       if not setsystemval("execpath","../../payrol/pub")
		>         then error &
		>          "Cannot set execpath system variable. Please
contact I.T."
		>       run command "quick 'auto=../qkgos/schdlrinq.qkg'"
refresh screen
		>       if not setsystemval("execpath","../pub")
		>         then error &
		>          "Cannot set execpath system variable. Please
contact I.T."
		>    end
		> ;
		> 
		> procedure entry
		> begin
		>       let signonuser = upshift(getsystemval("HPUSER"))
		>       if authuser = signonuser
		>         then run screen $execpath/pjr897kc
		> end
		> 
		> 
		> BUILD
		MODE:x ACTION:xxxxxxxxx     Human Resources Information
System       xxxxxxxxxxx
		PJR943KC
		   5.0             *****************************************
		                   *          TRAINING MAIN MENU           *
		                   *****************************************
		 
		                  01 PJR944  Training Inquiry Menu
		                  02 PJR916  Training Reports Menu
		                  03 PSR897KC Scheduler Inquiry Menu
		                  04         Who's On System Now?
		 
		  
		0 ERRORS  1 WARNINGS. Delete old screen
../pub/pjr943kc.qkc?y
		> EXIT

I figured it was pretty basic, sort of a no-brainer, eh!  Well, I've tried
two ways of doing this: a designer procedure and (currently) entry
procedure.  In both cases, the IF statement fails, even though I can prove
that the two data items that I'm testing are equal!  Below is a screen shot
of the actual debugger code, with the offending IF statement high-lighted.

				0074  procedure entry
				0075  begin
				0076    let signonuser =
upshift(getsystemval("HPUSER"))
				0077    if authuser = signonuser
				0078      then run screen $execpath/pjr897kc
				0079  end
				0080  
				0081  
				0082  PROCEDURE APPEND
				0083  DISABLE
				0084  
				0085  PROCEDURE PATH
				0086  NULL
				0087  PROCEDURE FIND
				0088  NULL
				Trap encountered at line: 79
				> d authuser
				AUTHUSER = "BMORRELL"
				> d signonuser
				SIGNONUSER = "BMORRELL"

Any help will be much appreciated!

G.L. (Guy) Werry 
Senior Systems Analyst
Hudson Bay Mining & Smelting
Ph:  204-687-2374
Fax: 204-687-2771
guy.werry@hbms.ca

= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l@lists.swau.edu
Subscribe: "subscribe" in message body to powerh-l-request@lists.swau.edu
Unsubscribe: "unsubscribe" in message body to
powerh-l-request@lists.swau.edu
http://lists.swau.edu/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.

This message may contain privileged and/or confidential information.  If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.  Thank you.

------_=_NextPart_001_01C1A9AC.BC5F5D40
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">



RE: Weird logic problem in a menu screen.



Hi Guy,

The clue is in the warning QDESIGN gives you when you = use the name SIGNONUSER for your temporary item.  This is a = reserved word in PowerHouse, which returns the username you logged in = as.  Try changing the name of your temporary item to something = else, and you should find it works fine.

Best regards,

Mark Fry
Cognos Limited
email: Mark.Fry@Cognos.com

Cognos Limited
Registered in England, number 1635598.  = Registered office:  Westerly Point, Market Street, Bracknell, = Berkshire, RG12 1QB


-----Original Message-----
From: Guy Werry [mailto:guy.werry@hbms.ca]
Sent: 30 January 2002 15:28
To: PH Mailing List (E-mail)
Subject: Weird logic problem in a menu = screen.


It's either "ask the list" or "throw a = massive temper tantrum" time.
Environment: HP-Ux 10.2, Ph 7.33.D3.

I have a menu screen where I want to allow one user = to run a sub-screen,
without the other users being aware that the choice = is available to them.
I'm using the environment variable HPUSER to hold = the user's logon name.

Here is the ENTIRE screen, from a compile = listing:

        =         Q D E S I G = N   (7.33.D3)
        =         Copyright = 1997 COGNOS INCORPORATED
        =         Licensed = PH-DEVELOPMENT for customer: 0011380001 HUDSON BAY
MINING & SMELTING
        =         UNIX

        =         > SCREEN = $execpath/pjr943kc MENU
        =         > ;
        =         > ;
***************************************************************=
        =         > ; = SCREEN-ID : PJR943KC
        =         > ; = SOURCE-ID : PJR943KS
        =         > ; = DATE      : MAY 91
        =         > ;
        =         > ; = PURPOSE:  Employee TRAINING MENU
        =         > ;
        =         > ;
        =         > ; = PROCESSING:
        =         > ;
        =         > ;
        =         > ; 1997 = Feb 20, GLW, Pr4829.
        =         > = ;     Added a menu selection so that we can access = a
scheduler
        =         > = ;     inquiry menu.
        =         > ;
        =         >
;**************************************************************= **
        =         > ;
        =         >
        =         > DEF = RCS-INFO  CHAR * 80 =3D     &
        =         >       "$Header: = pjr943ks.qks,v 2.1 98/01/20 15:00:33
manffhdv Exp $"
        =         >
        =         > DEFINE = D-DATE DATE =3D SYSDATE
        =         >
        =         > ; DEFINE = SIGNONUSER CHAR *8 =3D
UPSHIFT(GETSYSTEMVAL("HPUSER"))
        =         > TEMP = SIGNONUSER CHAR *8
        =         *W* The data = name SIGNONUSER may conflict with the
machine-specific keyword
        =         SIGNONUSER.
        =         > define = authuser char *8 =3D "BMORRELL"
        =         >
        =         > ;
        =         > HILITE = MESSAGE AUDIBLE INVERSE BLINKING
        =         > ;
        =         > TITLE = "Human Resources Information System" AT 1,29
        =         > ;
        =         > ALIGN = (,,70)
        =         > FIELD = D-DATE PREDISPLAY FORMAT YYYYMMMDD SEPARATOR " "
        =         > ;
        =         > TITLE = "PJR943KC" AT 2,1
        =         > TITLE = "5.0"      AT 3,4
        =         > HILITE = TITLE INVERSE
        =         > TITLE = "TRAINING MAIN MENU" AT 4,31
        =         > HILITE = TITLE OFF
        =         > ;
        =         > DRAW = THICK 3,20 TO 5,60
        =         > ;
        =         > SKIP TO = 7
        =         > ;
        =         > ALIGN = (19,22)
        =         > = SUBSCREEN   $execpath/pjr944kc
&
        =         >          = ;   LABEL "PJR944  Training Inquiry = Menu"
        =         > = SUBSCREEN   $execpath/pjr916kc
&
        =         >          = ;   LABEL "PJR916  Training Reports = Menu"
        =         > = SKIP
        =         > TITLE = "03 PSR897KC Scheduler Inquiry Menu"
&
        =         >       AT ,19
        =         >
        =         > COMMAND = "SHOWJOB JOB =3D @.FFHRIS"
&
        =         >       LABEL = "        Who's On System = Now?" CLEAR ALL
RESPONSE         = &
        =         >       ID 04
        =         >
        =         > = procedure designer 03
        =         >    begin
        =         >       if not = setsystemval("execpath","../../payrol/pub")
        =         >         then = error &
        =         >          = "Cannot set execpath system variable. Please
contact I.T."
        =         >       run command = "quick 'auto=3D../qkgos/schdlrinq.qkg'"
refresh screen
        =         >       if not = setsystemval("execpath","../pub")
        =         >         then = error &
        =         >          = "Cannot set execpath system variable. Please
contact I.T."
        =         >    end
        =         > ;
        =         >
        =         > = procedure entry
        =         > = begin
        =         >       let signonuser =3D = upshift(getsystemval("HPUSER"))
        =         >       if authuser =3D = signonuser
        =         >         then run = screen $execpath/pjr897kc
        =         > = end
        =         >
        =         >
        =         > = BUILD
        =         MODE:x = ACTION:xxxxxxxxx     Human Resources = Information
System       = xxxxxxxxxxx
        =         PJR943KC
        =            = 5.0           &nb= sp; *****************************************
        =                   &nb= sp;        = *          TRAINING MAIN = MENU           = *
        =                   &nb= sp;        = *****************************************
        =         
        =                   &nb= sp;       01 PJR944  Training = Inquiry Menu
        =                   &nb= sp;       02 PJR916  Training = Reports Menu
        =                   &nb= sp;       03 PSR897KC Scheduler Inquiry = Menu
        =                   &nb= sp;       = 04         Who's On System = Now?
        =         
        =           =
        =         0 = ERRORS  1 WARNINGS. Delete old screen
../pub/pjr943kc.qkc?y
        =         > = EXIT

I figured it was pretty basic, sort of a no-brainer, = eh!  Well, I've tried
two ways of doing this: a designer procedure and = (currently) entry
procedure.  In both cases, the IF statement = fails, even though I can prove
that the two data items that I'm testing are = equal!  Below is a screen shot
of the actual debugger code, with the offending IF = statement high-lighted.

        =         =         =         0074  = procedure entry
        =         =         =         0075  = begin
        =         =         =         0076    let signonuser =3D
upshift(getsystemval("HPUSER"))
        =         =         =         0077    if authuser =3D signonuser
        =         =         =         0078      then run screen = $execpath/pjr897kc
        =         =         =         0079  = end
        =         =         =         0080  =
        =         =         =         0081  =
        =         =         =         0082  = PROCEDURE APPEND
        =         =         =         0083  = DISABLE
        =         =         =         0084  =
        =         =         =         0085  = PROCEDURE PATH
        =         =         =         0086  = NULL
        =         =         =         0087  = PROCEDURE FIND
        =         =         =         0088  = NULL
        =         =         =         Trap = encountered at line: 79
        =         =         =         > d = authuser
        =         =         =         AUTHUSER =3D = "BMORRELL"
        =         =         =         > d = signonuser
        =         =         =         SIGNONUSER = =3D "BMORRELL"

Any help will be much appreciated!

G.L. (Guy) Werry
Senior Systems Analyst
Hudson Bay Mining & Smelting
Ph:  204-687-2374
Fax: 204-687-2771
guy.werry@hbms.ca

=3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D = =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D =3D
Mailing list: powerh-l@lists.swau.edu
Subscribe: "subscribe" in message body to = powerh-l-request@lists.swau.edu
Unsubscribe: "unsubscribe" in message body = to powerh-l-request@lists.swau.edu
http://lists.swau.edu/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you = must be a subscriber.

This message may contain privileged and/or = confidential information.  If you have received this e-mail in = error or are not the intended recipient, you may not use, copy, = disseminate or distribute it; do not open any attachments, delete it = immediately from your system and notify the sender promptly by e-mail = that you have done so.  Thank you.

------_=_NextPart_001_01C1A9AC.BC5F5D40--