×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
On 12-May-2016 12:16 -0500, Jeff Crosby wrote:
Does anyone happen to know if I do a:
RTVSYSVAL SYSVAL(QDAY) RTNVAR(&DAY)
and it's the first 9 days of the month, what will &DAY have?
For example, on the first day of the month, will it be
'01' or
' 1' or
'1 '
I assume it will have '01' but don't know.
That is indeed the effect; i.e. always with the leading zero for
values less than ten, so the string '01' as the result in that scenario
of first day of the month. Note: The effect will be the same as how
QMONTH functions, for which currently, per the month of May, the value
should be '05'.
Note also that this effect is the same as, is consistent with, how
casting from numeric to character functions in CL; i.e. casting, using
the Change Variable (CHGVAR), leading zeroes are included [as is a
leading minus sign if casting from a negative number, and for which a
receiver too small gives an effective overflow per msg CPF0819 if the
sign character does not fit].
Today is the 12th. I don't really want to wait till June to test it.
:)
FWiW: Having used the cast to numeric capabilities of the CL, which
of those three character string values were the effect would be moot, as
long as any references to the retrieved values were made instead, with
the result stored in the numeric variable.
/* code ¡assumes! anything _other than_ QDATFMT=JUL */
dcl (&day2) *char 2
dcl (&numday) *dec 2
rtvsysval qday &day2
/* So instead of: if (&day2 *gt '01'), use numeric: */
chgvar &numday &day2
if (&numday *gt 1) …
As an Amazon Associate we earn from qualifying purchases.