Testing DATE element for spaces
David Frederick (714)969-4600 x4109
David_Frederick@WYCLIFFE.ORG
Fri, 23 Jan 1998 15:56:04 +0000 (GMT)
On 23-Jan-1998 Discussion list for the PowerH wrote:
>(sorry for posting to both lists, but I am not yet confident that all of
>the "wisdom" has moved to the new list already <g>)
>
>On the HP3000, PowerHouse 7.09:
>
>I have an element defined as a DATE and stored as ZONED*6. Some of the data
>is spaces and some is 000000. What test(s) could I apply to determine what
>I have.
>
>If I use ASCII (ELEM,6), I get 000000 either way
>
>If I use ASCII (ELEM), I get 0 either way
>
>If I use SIZE ASCII (ELEM), I get 1 (one) either way
>
>SIZE (ELEM) gives an error: The datatype of the item ELEM is incorrect in
>this context
>
>INDEX (ELEM) gives the same error
>
>I suspect that MATCHPATTERN (ELEM, " ") will give the same error.
>
>Thanks,
>
>====================
>Leonard S. Berkowitz
>(work) Leonard_Berkowitz@hphc.org
>(home) lberkowitz@earthlink.net
>
I'm on the OpenVMS platform, so I'm not sure if this solution will work on HP...
anyway, if you can do this, make a redefinition of the item as character.
Then, use the character item to check for spaces vs zeroes.
Another possibility is the use of the CHAR function -- CHAR(ELEM). That
function will basically treat ELEM as a character without doing any
numeric-to-character conversion.
Anyway, hopefully one of those two options will work for you.
Thanks,
David Frederick
Programmer/Analyst
Wycliffe Bible Translators USA
Internet: David.Frederick@wycliffe.org
----
Disclaimer: Opinions expressed may not reflect those of my employer.