Hi!
I have a problem with SQLRPGLE and date.
I have a file, (name file1) created with DDL, that have a date with iso format YYYY-MM-DD.
Data Field Buffer Buffer Field Column
Field Type Length Length Position Usage Heading
DATUM_F DATE 10 10 1 Both DATUM_F
Date Format . . . . . . . . . . . . . . . : *ISO
Default value . . . . . . . . . . . . . . : None
Coded Character Set Identifier . . . . . : 273
In a SQLRPGLE program I have this statement:
ExecSQLselectcount(*) into :Nrad from file1
where DATUM_F = :PeFM_Datum_F;
(The PeFM_Datum_F is a field in the DSPF, date field *iso YYYY-MM-DD)
It work without problem with date between 1940-01-01 and 2039-12-31 but if I try for example 1920-01-01 I have this error:
Meddelande-ID . . . . : RNQ0114 Allvarlighet . . . . . : 99
Meddelandetyp . . . . : Frågemeddelande
Skickat, datum . . . . : 09.02.17 Skickat, tid . . . . . : 23:48:09
Meddelande . . : The year portion of a Date or Timestamp value is not in
the correct range (C G D F).
Cause . . . . . : RPG procedure PROC1 in program LIB01/PROC1 at
statement 005600 requested a conversion to a Date value, from a Timestamp or
a Date value, and the year of the source is not in the allowable range of
the target.
-- The range for a 2-digit year is 1940-2039.
-- The range for a 3-digit year is 1900-2899.
-- The range for a 4-digit year is 0001-9999.
Recovery . . . : Check the job log for more information on the cause of the
error and contact the person responsible for program maintenance.
Possible choices for replying to message . . . . . . . . . . . . . . . :
I know that a date with only 2-digit have this problem but the date in the DSPF is a *iso date YYYY-MM-DD.
I dont understand what is the problem!
Please can you help me?
Thank you very much!
I have a problem with SQLRPGLE and date.
I have a file, (name file1) created with DDL, that have a date with iso format YYYY-MM-DD.
Data Field Buffer Buffer Field Column
Field Type Length Length Position Usage Heading
DATUM_F DATE 10 10 1 Both DATUM_F
Date Format . . . . . . . . . . . . . . . : *ISO
Default value . . . . . . . . . . . . . . : None
Coded Character Set Identifier . . . . . : 273
In a SQLRPGLE program I have this statement:
ExecSQLselectcount(*) into :Nrad from file1
where DATUM_F = :PeFM_Datum_F;
(The PeFM_Datum_F is a field in the DSPF, date field *iso YYYY-MM-DD)
It work without problem with date between 1940-01-01 and 2039-12-31 but if I try for example 1920-01-01 I have this error:
Meddelande-ID . . . . : RNQ0114 Allvarlighet . . . . . : 99
Meddelandetyp . . . . : Frågemeddelande
Skickat, datum . . . . : 09.02.17 Skickat, tid . . . . . : 23:48:09
Meddelande . . : The year portion of a Date or Timestamp value is not in
the correct range (C G D F).
Cause . . . . . : RPG procedure PROC1 in program LIB01/PROC1 at
statement 005600 requested a conversion to a Date value, from a Timestamp or
a Date value, and the year of the source is not in the allowable range of
the target.
-- The range for a 2-digit year is 1940-2039.
-- The range for a 3-digit year is 1900-2899.
-- The range for a 4-digit year is 0001-9999.
Recovery . . . : Check the job log for more information on the cause of the
error and contact the person responsible for program maintenance.
Possible choices for replying to message . . . . . . . . . . . . . . . :
I know that a date with only 2-digit have this problem but the date in the DSPF is a *iso date YYYY-MM-DD.
I dont understand what is the problem!
Please can you help me?
Thank you very much!
Comment