SETSYSTEMVAL Problem

Neil Harvey neil@nha.co.za
Fri, 29 Oct 1999 12:21:02 +0200


Randy's solution is a good one - add a trailing space.

Of course, another really powerful function is GETSYSTEMVALUE, 
as in define y char*2 = getsystemvalue('sysv_comp')

Very useful to pass parameters into qz/qtp/quick

Neil


-----Original Message-----
From: Schleicher, Randy (Windsor HQ) [mailto:SchleR01@unisourcelink.com]
Sent: 28 October 1999 10:48
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.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
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.