×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Yep me too.
But we aren’t talking about rpg here.

Thanks for the input.
Jay

On Apr 4, 2019, at 12:50 PM, Mark Murphy <jmarkmurphy@xxxxxxxxx> wrote:

I always put CTL-OPT DATFMT(*ISO) TIMFMT(*ISO); in my RPG, and then if I am
using embedded SQL, I also add EXEC SQL SET OPTION DATFMT = *ISO, TIMFMT =
*ISO; That way the two are always in sync, and can handle the full date
range. I only use other date formats in display or printer files. Or in
database files depending on the definition, but database files get *iso as
well if I get to define them.

On Thu, Apr 4, 2019 at 11:39 AM Jay Vaughn <jeffersonvaughn@xxxxxxxxx>
wrote:

I do to in sqlrpgle, along with a few others.

Jay

On Apr 4, 2019, at 10:48 AM, Rob Berendt <rob@xxxxxxxxx> wrote:

In my RPG code I have that as a standard /include

You might want to have that in your templates. See also:

http://ibmsystemsmag.com/ibmi/administrator/systemsmanagement/create-your-own-templates/

-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
Jay Vaughn
Sent: Thursday, April 4, 2019 10:44 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx

Subject: Re: date UDF

that got me fixed up - hate I missed that - thanks guys!

jay

On Thu, Apr 4, 2019 at 10:38 AM Jay Vaughn <jeffersonvaughn@xxxxxxxxx>
wrote:

yes let me try that

On Thu, Apr 4, 2019 at 10:35 AM Rob Berendt <rob@xxxxxxxxx> wrote:

Can you add SET OPTION in your function to set your date format to
*ISO?

-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
Rob Berendt
Sent: Thursday, April 4, 2019 10:34 AM
To: Midrange Systems Technical Discussion
<midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: date UDF

Because your job date is *MDY and not *ISO

Sample:
STRSQL
F13=Services
1. Change session attributes
Date format *ISO
values date('2043-04-04')

....+....1
VALUES
2043-04-04
******** End of data ********

Now, if I use F13 and change my date format to *MDY ....+...
VALUES
++++++++
******** End of data ********


-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
Jay Vaughn
Sent: Thursday, April 4, 2019 10:24 AM
To: Midrange Systems Technical Discussion
<midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: date UDF

why is my UDF considering '2019-04-04' a valid date but not
'2043-04-04'?

---
create or replace function
lscnvtools/IsValidDate (i_dateField varchar(10)
,i_dateValue varchar(10)
,i_rowKey varchar(10)
,i_rowVal varchar(50)
)
returns char (1)
language sql
returns null on null input
modifies sql data

begin

declare g_charDate date;

declare continue handler for SQLState '22007'

begin
insert into cnverr (erpgmid
,errowkey
,errowval
,ersrccol
,ermsgtxt)
values ('CNVPFSQLR'
,i_rowKey
,i_rowVal
,i_dateField concat ' ' concat i_dateValue
,'Invalid Date Value');
return 'N';
end;

if i_dateValue is null then
return 'N';
end if;

set g_charDate = Date(i_dateValue);
return 'Y';

end

TIA

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

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: https://amazon.midrange.com
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: https://amazon.midrange.com
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: https://amazon.midrange.com


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

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com

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

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2026 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.