Help with VARCHAR needed

Edis, Robert Robert.Edis@blistex.com
Tue, 25 Mar 2003 12:04:21 -0600


Sorry.  Chris is right about subfiles being fixed length.  I believe this is
because of the way the subfile dictionary identifies where fields begin and
end.  

On OpenVMS an RMS file doesn't have to be fixed length but it does on some
other platforms and I guess Cognos made the SFD to be platform independent.

So as the only file output options available to Quiz are either report or
subfile and both will produce fixed length fields there is no advantage to
using VARCHAR in Quiz.  Concatenating the fields into a single defined item
after trimming the excess blanks seems to be the only way to go.

A 2 byte field length is the MINIMUM for a VARCHAR field, one byte to
indicate the length of the value and the other having a NULL (if no data
entered).  The MAXIMUM field length will be whatever SIZE the designer
designates.

I am more familiar with how a RDBMS handles VARCHAR columns than how an
operating/file system does.  Is VARCHAR a valid data type in RMS?

Regards,
Blue

-----Original Message-----
From: Chris Sharman [mailto:chris.sharman@ccagroup.co.uk]
Sent: Tuesday, March 25, 2003 9:55 AM
To: powerh-l@lists.swau.edu
Subject: Re: Help with VARCHAR needed


Edis, Robert wrote:
> As Quiz is meant to provide formatted output, especially to a printer, I
> would not expect what you see to be anything less than either the size of
> the longest value or the max potential size of the field.

Yes.

> Generally VARCHAR is used to A) conserve storage space as the actual
amount
> used will be the length of the value plus 1 byte and B) for better data
> comparison as you don't need to worry about trailing blanks.

2 byte length (on VMS) actually.
I'd be surprised if it conserves storage space: the 'normal' 
implementation is to allocate the maximum permanently. It's possible 
that PH deallocates & reallocates heap every time the length changes, 
but I doubt it.

> The big difference between outputting a CHAR vs. VARCHAR will occur in a
> subfile.  I expect a CHAR will be right padded with spaces to the size of
> the field whereas VARCHAR will not thereby reducing the overall size of
the
> subfile.

Subfiles are always fixed length (VMS), with fields at fixed positions.
Again, I'd be very surprised if that's not the case across all 
platforms. That sort of variable union is hard to handle in most languages.



-----------------------------------------------------------------------

Any views expressed in this message are those of the sender and not
necessarily those of CCA Group.  The unauthorized use, disclosure,
copying or alteration of this message is forbidden.  The contents of
this message may be confidential and/or privileged, copyright CCA Group
and are intended solely for the use of the individual or entity to whom
they are addressed.  Whilst this message has been scanned, CCA Group
cannot guarantee that it is virus free or compatible with your systems
and accepts no responsibility for any loss or damage arising from its
use. The recipient is advised to run their own anti-virus software. If
you receive this message in error please contact
postmaster@ccagroup.co.uk immediately, destroy any copies and delete it
from your computer systems.
= = = = = = = = = = = = = = = = = = = = = = = = = = = =
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.