SETSYSTEMVAL Problem

Schleicher, Randy (Windsor HQ) SchleR01@unisourcelink.com
Thu, 28 Oct 1999 17:53:47 -0400


Actually I think it's an MPE default and that Powerhouse is simply
constructing a SETVAR command internally and executing it.  If you :SETVAR A
16, MPE by default assigns the variable as a numeric expression.  Enclose
the value in quotes  :SETVAR A "16" and the variable is created as a string.
Powerhouse must be interrogating the value part of the SETSYSTEMVAL function
and inserting the quotes into its internal SETVAR command when it encounters
a non-numeric character.  My Powerhouse 7.29 manuals do not state anything
about special meta-characters that could be used to trigger a string
variable be created from numeric data.  At least I have not found it yet.


> ----------
> From: 	Schleicher, Randy (Windsor HQ)
> Sent: 	Thursday, October 28, 1999 4:48 PM
> To: 	powerh-l@lists.swau.edu
> Subject: 	RE: SETSYSTEMVAL Problem
> 
> This is a very interesting question since I never knew this function
> existed.  Anyway, I simply added one space between the final digit of the
> number value and the terminating quote, and the CI variable created was as
> a string.  
> 
> DEFINE X INTEGER = 1 IF SETSYSTEMVAL('SYSV_COMP', '01 ') ELSE 0
> 
> :SETVAR TEST SYS_COMP + "END"
> :SHOWVAR TEST
>  TEST = 01 END
> 
> The string created still contains the trailing space so you'll still have
> to take that into consideration.  Perhaps the trailing space within the
> number should be replaced with a special character like a "$".  Your
> programs could key off of this as a type of string terminator.  
> 
> DEFINE X INTEGER = 1 IF SETSYSTEMVAL('SYSV_COMP', '01$') ELSE 0
> 
> :SHOWVAR SYS_COMP
>  SYS_COMP = 01$
> 
> 
> I have also tried using double quotes in an attempt to signify a string be
> created, and it did just that, but the string value created  included both
> double quotes.
> 
> DEFINE X INTEGER = 1 IF SETSYSTEMVAL('SYSV_COMP', '"01"') ELSE 0
> 
> :SHOWVAR SYS_COMP
>  SYS_COMP = "01"
> 
> I would think there would be a special meta-character that could be used
> within the SETSYSTEMVAL function that would tell MPE to make the variable
> a string.  Anyway, I hope this helps. I am still looking into this.  
> 
> 
> 	----------
> 	From: 	James J. Kanihan[SMTP:JimK@nacs-inc.com]
> 	Sent: 	Thursday, October 28, 1999 11:58 AM
> 	To: 	powerh-l@lists.swau.edu
> 	Subject: 	SETSYSTEMVAL Problem
> 
> 	Hello everyone,
> 	 
> 	Can anyone explain to me why PowerHouse (7.29 C6 and 8.19 C4 on
> MPE/iX) insists on setting system variables as numeric values even when
> they are defined in the program to be character strings?
> 	 
> 	Check out the following example which shows how SETSYSTEMVAL differs
> from the MPE SETVAR command:
> 	 
> 	:QTP
> 	 
> 	Q T P   (PowerHouse  8.19.C4)
> 	Copyright 1999 COGNOS INCORPORATED
> 	NACS
> 	 
> 	> ACC COMP-M
> 	> CHOOSE COMPCTRL '01'
> 	> DEFINE X INTEGER = 1 IF SETSYSTEMVAL('SYSV_COMP', '01') ELSE 0
> 	> DEFINE Y INTEGER = 1 IF SETSYSTEMVAL('SYSV_DATE', '00000000') ELSE
> 0
> 	> SUBFILE TEMPSF INCLUDE X, Y
> 	> GO
> 	 
> 	Executing request 1 ...
> 	 
> 	Records read:
> 	  COMP-M                                   1
> 	 
> 	Transactions processed:                    1
> 	 
> 	Records processed:                     Added    Updated 
> Unchanged    Deleted
> 	  TEMPSF                                   1          0         
> 0          0
> 	 
> 	Finished.
> 	> E
> 	 
> 	END OF PROGRAM
> 	:SHOWVAR SYSV@
> 	SYSV_COMP = 1
> 	SYSV_DATE = 0
> 	 
> 	:SETVAR SYSV_COMP '01'
> 	:SETVAR SYSV_DATE '00000000'
> 	:SHOWVAR SYSV@
> 	SYSV_COMP = 01
> 	SYSV_DATE = 00000000
> 	:
> 	 
> 	Any help with this will be greatly appreciated.
> 	 
> 	Thanks,
> 	 
> 	Jim Kanihan
> 	jimk@nacs-inc.com
> 	 
> 
> 
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.