View Full Version : 2004-06-23 is an invalid *ISO date???
06-30-2004, 05:48 AM
Doug, Looks like your code should work. I suspect the problem is elsewhere. Are you sure that your DS is overlaying the Buffer in the Right place? The Offset to the new record image (in positions 65-68 of the First Trigger Parm) is Zero based. So you'll need to add 1 for the starting position of the Overlay. Also make sure that you've defined the Parm large enough to accept the Header Info, Before and After Record Images and the Null Maps. Just so you can compare, I've included the D specs that we use for defining Trigger parms in one of our Trigger pgms. Mike <hr width=50 align=left>Code ('http://www.mcpressonline.com/mc/showcode@@.6aec7026/0')
06-30-2004, 06:25 AM
Given this code... EnteredDate = %char(New.ELENTERED:*usa); Where New.ELENTERED (an *ISO date datatype field) contains d'2004-06-23' in *ISO format, and EnteredDate is a 10-char alpha field. This line is crashing with an "Invalid Date, Time or Timestamp" error. Why? 2004-06-23 seems like a valid date to me. Some other facts... - This is a V5R2 *AFTER *INSERT system trigger program. - New.ELENTERED is in a qualified DS that overlays the trigger buffer's new image area. - The triggered file was created with CREATE TABLE, where ELENTERED is a DATE datatype. - This is not an SQLRPGLE program. RPGLE only. - datfmt(*iso) is specified in the H-Specs. - This program uses native i/o to access another table (CREATE TABLE) that has a date field. The i/o fails on READE with the same "Invalid Date, Time or Timestamp" error, even though that date field contains a valid date. I'm obviously missing something simple. What is it?
06-30-2004, 06:25 AM
The buffers are laid out correctly. Everything was fine once I moved the date to a field not in a qualified data structure. It looks like %CHAR cannot handle date fields in a qualified data structure (BASED or otherwise). All sorts of wonky things happen. I'm probably missing a PTF - you wouldn't happen to know the PTF number off hand, would you?
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.