In joblog there should be a error message CPF5035 - Data mapping error on member TESTFILE1
Cause . . . . . : A data mapping error occurred on field DATAORA in record
number 0, record format REC1, member number 1, in member TESTFILE in library YOURLIBRARY ,
because of error code 17. The error code
17 -- The format of the data in a date, time, or timestamp field is not
valid.
if you add CTL-OPT ALWNULL(*UsrCtl) ;
To allow a null value to your rpg prgram with write and update then your DDS specification should work.
You do not indicate whate timestamp filed is used for.
If it is as audit field for when record was update you may want to consider
SQL ALTER TABLE TESTFILE1 statement with
ADD COLUMN AUDIT_TIME FOR "AUDITTIME" TIMESTAMP
FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP NOT NULL ;
If audit useage is true you may want to see
https://www.rpgpgm.com/2017/01/using-auditing-columns-to-audit-data.htmlI find these audit field extremely useful and a great addition.
https://www.ibm.com/docs/en/i/7.3?topic=language-creating-auditing-columns------------------------------
Glenn Gross
------------------------------
Original Message:
Sent: Thu March 03, 2022 04:38 AM
From: Andy Malo
Subject: Adding Timestamp column
Hi Paolo,
(Sorry in advance for my Bad english -_-')
Like Mark said, you should try to modernise your PF (DDS to SQL). If you need documentation, don't hesitate to Ask.
Another solution (which IS very dirty) : directly in SQL, you can add SQL column type on a PF DDS, something like this :
Alter table xxx add column data timestamp default on row update etc...
It's Dirty because you will mix DDS définition and SQL DDL to reverse your object. Also, if you do so, you should rewrite your PGM with only SQL...
So I recommand you to modernise your PF. For 1 table without tool, you Can Do it on 1-2 days
------------------------------
Andy Malo
CAFAT
New-Caledonia
Original Message:
Sent: Tue March 01, 2022 11:57 AM
From: Paolo Salvatore
Subject: Adding Timestamp column
Hi all,
many thanks for your answer, I open a case in IBM and now I'm waiting for an answer from IBM support.
I try with a simple case to replicate my problem, this are the dds:
R REC1 CONTATORE 9B 0 CAMPOTEST 100 VARLEN K CONTATORE
And this is my rpgle:
**free Dcl-F TestFile1 Usage(*Input :*Output :*Update); Contatore = 1; CampoTest = 'Prova numero : ' + %Char(Contatore); Write Rec1; *inlr = *On;
Then I add a timestamp to my pf:
R REC1 CONTATORE 9B 0 CAMPOTEST 100 VARLEN DATAORA Z K CONTATORE
So I made the chgpf:
CHGPF FILE(MYLIB/TESTFILE1) SRCFILE(MYLIB/QDDSSRC)
and running my program without recompiling it I obtain this error:
Data mapping error on member TESTFILE1.
Data mapping error on member TESTFILE1.
? C
Data mapping error on member TESTFILE1.
? C
I/O error CPF5029 was detected in file TESTFILE1.
I/O error CPF5029 was detected in file TESTFILE1 (C G D F).
? C
I/O error CPF5029 was detected in file TESTFILE1 (C G D F).
? C
Application error. RNX1299 unmonitored by TESTFILE1 at statement
0000000011, instruction X'0000'.
my job have dateformat: *YMD, dateseperator: '-' timesep: '.'
------------------------------
Paolo Salvatore
Original Message:
Sent: Mon February 28, 2022 07:32 AM
From: Mark Soulje
Subject: Adding Timestamp column
Paolo,
1. Make sure your timestamp definitions (the one you have defined in your file and the one you are trying to write to it/read from it), match up. In other words, make sure they have the same format, number of microseconds, delimiters etc...
2. Consider spending a little extra time and do a DDS -> DDL conversion. The end result should be a set of older logicals that have no idea about the new column(s) and therefore no recompiles necessary. If you need to make the new column available to a program, create a new logical or a view to access it.
Hope this helps,
Mark.
------------------------------
Mark Soulje
Original Message:
Sent: Fri February 25, 2022 12:27 PM
From: Paolo Salvatore
Subject: Adding Timestamp column
Hi,
I want to add a timestamp column at the end of file, the file is level check no.
I hoped than adding a column without recompiling all my programs it can work,
but if a program made a write it goes in error, message code is: RNQ1299
I try with an alfa column an there is no problem, Is there a way to put a current timestamp to this column without having to recompile all the programs who are using that file? about 200 (the great part only in read).
Many thanks
------------------------------
Paolo Salvatore
------------------------------