Page 1 of 1

Formatting a Date to write to a sequential file

Posted: Wed Apr 25, 2007 2:38 pm
by kuppleca
I am attempting to write a date, as well as other information, from an Oracle table to a seq file.

The field is defined as DATE in the Oracle table and VARCHAR(10) on the seq file. Without any date functions, etc., the date written to the file is the internal date, for example, 17995. When I use the DATE.TAG function, I get "2017-04-07", instead of "2007-04-17". I am inserting the date into the BATCH table by using "to_date('#parmDATECARDDT#', 'YYYY-MM-DD).

INSERT INTO BATCH(batch_oid, batch_dte, input_src, input_batch_type)
VALUES (9998, TO_DATE('#parmDATECARDDT#', 'YYYY-MM-DD'),
'#parmInputSource#','Q')

I can select the field from teh database using:
to_char(batch_dte, 'YYYY-MM-DD'),


Any help would be appreciated.

Posted: Wed Apr 25, 2007 3:16 pm
by kuppleca
I looked some more on the forum and found my answer!!!! :)

I did a to_char(batch_dte, 'YYYY-MM-DD') in the SQL to obtain the field, then in the Transformer, I did a DATE.TAG(batch_dte) as the derivation.

The date came out in the file as 2007-04-17, instead of 2017-04-07.

Thanks to the forum and all its postings. It sure helped!!!!