× 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.



Birgitta,

Got it. Thanks for the explanation. My error was testing it in STRSQL
without casting the value before...

Regards,

Luis Rodriguez
IBM Certified Systems Expert — eServer i5 iSeries
--



On Tue, Jun 21, 2011 at 10:08 AM, Birgitta Hauser <Hauser@xxxxxxxxxxxxxxx>wrote:

If you are using a numeric expression it is assumed being an integer value
and converted into 10,0 i.e. 00201106021.
When using a character timestamp without separators with function date it
must be formatted as YYYYMMDDHHMMSS, your string will be 2 characters
longer
and in this way it will not work.
That's why I wrote, I assume the numeric field is defined as 8,0.
When converting the numeric expression into 8,0 the statement will work:
*select Char(Date(Digits(Dec(20110621, 8, 0)) concat '000000'), ISO)
from sysibm/sysdummy1*

Or
With x as (Select Cast(20110621 as Dec(8, 0)) NumDate
From SysIbm/Sysdummy1)
Select Char(Date(Digits(NumDate) concat '000000'), ISO)
From x

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"


-----Ursprüngliche Nachricht-----
Von: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von Luis Rodriguez
Gesendet: Tuesday, 21. June 2011 16:17
An: Midrange Systems Technical Discussion
Betreff: Re: sql in strsql and something like editc or editw

Birgitta,

I tried your statement and got an invalid data result (+++). My test:

*select Char(Date(Digits(20110621) concat '000000'), ISO)
from sysibm/sysdummy1*

What I'm doing wrong (running V5R3)?

Thanks,

Luis Rodriguez
IBM Certified Systems Expert — eServer i5 iSeries
--



On Tue, Jun 21, 2011 at 9:09 AM, Birgitta Hauser
<Hauser@xxxxxxxxxxxxxxx>wrote:

Assumed your date is defined as 8,0 in the format YYYMMDD, you may try
the
following:

Char(Date(Digits(NumDate) concat '000000'), ISO)

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training
them
and keeping them!"

-----Ursprüngliche Nachricht-----
Von: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von
franz400@xxxxxxxxxxxx
Gesendet: Tuesday, 21. June 2011 15:27
An: midrange-l@xxxxxxxxxxxx
Betreff: sql in strsql and something like editc or editw

Sometime I run quick sql's for users and give a print key. They want the
dates (numeric 8.0) to not look like 20,110,622.
Would prefer 2011-06-22 or even 20110622.
Forget that this is a date (same problem w/ssn, etc) how to simply (in a
few
seconds)apply edit codes to numbers in sql select.
Jim Franz
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.