Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Converting *char to *dec in CL prog?

682 views
Skip to first unread message

DAVID SMITH

unread,
Oct 10, 1997, 3:00:00 AM10/10/97
to

While you should be careful to ensure that only numeric data is in the
*char field, you should be able to use a CHGVAR command to change the value
of a temp numeric work field to the value of the *char field.

James Tyrrell <jtyr...@eclipse1.demon.co.uk> wrote in article
<34165eca...@news.demon.co.uk>...
> How would I go about converting a variable that is of the type *char
> into a type *dec so that I can compare two values? I have some dates
> that I have converted into a number representing the day of the year,
> I need to compare these to see if one is older than the other but they
> are both of the type *char? How would I go about this?
>
> Thanks in advance.
>
> James Tyrrell.
>

Dean Boyle

unread,
Oct 10, 1997, 3:00:00 AM10/10/97
to James Tyrrell

There are some useful TAATOOLS for date comparisons/checks etc. (ADDDAT,
CMPDAT, CLCDATTIM) that we have used for comparing 2 date fields. Have a
look and see if they may apply to your situation.

Dean Boyle.

Kevin & Amanda Young

unread,
Oct 11, 1997, 3:00:00 AM10/11/97
to

James Tyrrell wrote:
>
> How would I go about converting a variable that is of the type *char
> into a type *dec so that I can compare two values? I have some dates
> that I have converted into a number representing the day of the year,
> I need to compare these to see if one is older than the other but they
> are both of the type *char? How would I go about this?
>
> Thanks in advance.
>
> James Tyrrell.
I am not sure of the method you're using for your date fields but CVTDAT
allows several types of date conversion that you could use. My
recommendation stay away from TAATOOLS especially if you're thinking of
upgrading to a RISC machine in the future.

Paul Nicolay

unread,
Oct 14, 1997, 3:00:00 AM10/14/97
to

Hi James,

If both of them have the same size, you can just compare them
alphabetically. Comparing a string with '00100' with '01234' will tell you
that the first one is smaller. The only important thing is that they've
the same size and are right aligned. (leading zeros is not even an issue)

Regards,
Paul
_______________


James Tyrrell <jtyr...@eclipse1.demon.co.uk> wrote in article
<34165eca...@news.demon.co.uk>...

> How would I go about converting a variable that is of the type *char
> into a type *dec so that I can compare two values? I have some dates
> that I have converted into a number representing the day of the year,
> I need to compare these to see if one is older than the other but they
> are both of the type *char? How would I go about this?
>
> Thanks in advance.
>
> James Tyrrell.
>


The contents of this message express only the sender's opinion.
This message does not necessarily reflect the policy or views of
my employer, Merck & Co., Inc. All responsibility for the statements
made in this Usenet posting resides solely and completely with the
sender.

0 new messages