Defines and temps in PH

Deskin, Bob Bob.Deskin at Cognos.COM
Tue Jan 9 12:32:06 CST 2007


Not really a bug as such, but some component differences. While I can
explain the differences, I can understand why someone might wonder.
 
The main difference is that QUIZ has a picture for formatting but QTP
does not. Unfortunately, the code used in SHOW ITEMS uses the same
display format even though the meaning is different. The *n format, as
in INTEGER*6, is supposed to indicate the number of digits you want to
deal with.
 
In QUIZ, it's also used to generate the default PICTURE. QUIZ also takes
into account the LEADING|TRAILING SIGN option, in the case, defaulted.
NUMERIC (or FLOAT) and INTEGER default to SIGNED, while ZONED defaults
to UNSIGNED. This means that for INT*6, the default PICTURE has 7
substitution characters while for ZONED*6, there are 6. Note that the *n
syntax is used to determine the default storage size and the formatting.
It does not restrict what can be physically entered into the item. It's
just that if you enter something too large, you won't see it displayed
properly.
 
With QTP, you get the same storage format defaults as QUIZ but since
there's no PICTURE or other formatting, the SHOW ITEMS display simply
shows the number of characters.
 
With either QUIZ or QTP, you can enter
 
DEFINE X INT*6 = 12345678  ; 8 digits
 
INT*6 defaults to a storage of INTEGER SIZE 4 which easily holds
12345678. However, when you display the value in QUIZ, you get
crosshatches (#) because the generated picture is too small.
 
In QUIZ, with a picture large enough to hold the leading sign, you can
actually use all of the substitution characters for digits. So you can
show 7 digits without a sign or 6 with a leading sign. QUIZ has always
been this way.
 
Bob

	-----Original Message-----
	From: Peter.Hofstaetter at hpa.com.au
[mailto:Peter.Hofstaetter at hpa.com.au] 
	Sent: January 8, 2007 5:06 PM
	To: Deskin, Bob
	Cc: fernando.olmos at hpa.com.au
	Subject: RE: Defines and temps in PH
	
	
	Hi Bob,
	 
	We are using Powerhouse 8.43.D1 on Sun UNIX.
	 
	Under Quiz:
	 
	define quiz_num num*6 = 1
	define quiz_int int*6 = 1
	define quiz_zoned zoned*6 = 1
	report summary all
	set subfile name quiz_test keep
	go
	 
	Accessing the subfile from Quiz and do a show items gives:
	 
	                                             INPUT OUTPUT
	QUIZ_TEST                               TYPE SCALE SCALE  DEC
PICTURE
	  QUIZ_NUM                              NUM     0     0    0
^^^^^^^
	  QUIZ_INT                              NUM     0     0    0
^^^^^^^
	  QUIZ_ZONED                            NUM     0     0    0
^^^^^^
	 
	Under QTP do the same thing to a subfile:
	 
	access invoice_number
	define qtp_num num*6 = 1
	define qtp_int int*6 = 1
	define qtp_zoned zoned*6 = 1
	temp tqtp_num num*6
	temp tqtp_int int*6
	temp tqtp_zoned zoned*6
	subfile qtp_test keep include
qtp_num,qtp_int,qtp_zoned,tqtp_num,tqtp_int,tqtp_zoned
	go
	 
	Check subfile in Quiz and show items gives:
	 
	                                             INPUT OUTPUT
	QTP_TEST                                TYPE SCALE SCALE  DEC
PICTURE
	  QTP_NUM                               NUM     0     0    0
^^^^^^
	  QTP_INT                               NUM     0     0    0
^^^^^^
	  QTP_ZONED                             NUM     0     0    0
^^^^^^
	  TQTP_NUM                              NUM     0     0    0
^^^^^^
	  TQTP_INT                              NUM     0     0    0
^^^^^^
	  TQTP_ZONED                            NUM     0     0    0
^^^^^^
	 
	 
	It seems that for consistency sake the num and int types in Quiz
are not the same as all others in Quiz and QTP when it comes to the
default picture created. I have not shown it here but if you do the same
in Quick it acts the same as QTP. Looks like it is only Quiz that is at
fault if in fact the default picture of "^^^^^^" is correct. You could
argue that as numbers could be signed it should have a default picture "
^^^^^^" with the leading space to allow for the negative sign.
	 
	Cheers,
	Peter Hofstaetter
	MIS Project Leader
	 
	HPA
	Direct:    (02) 9311 9783
	Fax:       (02) 9311 9921
	www.hpa.com.au <http://www.hpa.com.au/>  
	 

________________________________

	From: Fernando Olmos 
	Sent: Tuesday, 9 January 2007 8:20 AM
	To: Peter Hofstaetter
	Subject: FW: Defines and temps in PH
	
	
	Peter,
	 
	Bob is one of the developers of Powerhouse at COGNOS.
	 
	Could you please respond and Cc me as well?
	 
	Thanks
	 
	-----Original Message-----
	From: Bob.Deskin at Cognos.COM [mailto:Bob.Deskin at Cognos.COM] 
	Sent: Tuesday, 9 January 2007 2:08 AM
	To: Fernando Olmos; powerh-l at lists.sowder.com
	Subject: RE: Defines and temps in PH
	
	
	Please post sample source code for each case. Also, what version
is this in and what platform. I'd like to try it.
	 
	Bob

		-----Original Message-----
		From:
powerh-l-bounces+bob.deskin=cognos.com at lists.sowder.com
[mailto:powerh-l-bounces+bob.deskin=cognos.com at lists.sowder.com] On
Behalf Of fernando.olmos at hpa.com.au
		Sent: January 7, 2007 6:21 PM
		To: powerh-l at lists.sowder.com
		Subject: Defines and temps in PH
		
		
		Hi guys.
		 
		My colleague below discovered what we believe is a bug
in PH. Any insight as to why QTP would define numeric's differently than
QUIZ?
		 
		Thanks
		 
		-----Original Message-----
		From: Peter Hofstaetter 
		Sent: Monday, 8 January 2007 10:18 AM
		To: Fernando Olmos
		Subject: Defines and temps in PH
		
		
		Hi Fernando,
		 
		QTP and Quick are the same. If you define a Numerical
temp as *6 you can only enter 6 digits i.e. 123456 or -12345. In Quiz it
allows 7 digits i.e. 1234567 or -123456. Nice consistency!
		 
		Cheers,
		Peter Hofstaetter
		MIS Project Leader
		 
		HPA
		Direct:    (02) 9311 9783
		Fax:       (02) 9311 9921
		www.hpa.com.au <http://www.hpa.com.au/>  

		 

	
**********************************************************************
		IMPORTANT
		The contents of this e-mail and its attachments are
confidential and intended
		solely for the use of the individual or entity to whom
they are addressed.  If
		you received this e-mail in error, please notify the HPA
Postmaster, postmaster at hpa.com.au,
		then delete  the e-mail.
		This footnote also confirms that this e-mail message has
been swept for the
		presence of computer viruses by Ironport. Before opening
or using any
		attachments, check them for viruses and defects.
		Our liability is limited to resupplying any affected
attachments.
		HPA collects personal information to provide and market
our services. For more
		information about use, disclosure and access see our
Privacy Policy at
		www.hpa.com.au
	
**********************************************************************

	 
	     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. 
	
**********************************************************************
	IMPORTANT
	The contents of this e-mail and its attachments are confidential
and intended
	solely for the use of the individual or entity to whom they are
addressed.  If
	you received this e-mail in error, please notify the HPA
Postmaster, postmaster at hpa.com.au,
	then delete  the e-mail.
	This footnote also confirms that this e-mail message has been
swept for the
	presence of computer viruses by Ironport. Before opening or
using any
	attachments, check them for viruses and defects.
	Our liability is limited to resupplying any affected
attachments.
	HPA collects personal information to provide and market our
services. For more
	information about use, disclosure and access see our Privacy
Policy at
	www.hpa.com.au
	
**********************************************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sowder.com/pipermail/powerh-l/attachments/20070109/586d71b6/attachment.html


More information about the powerh-l mailing list