View previous topic :: View next topic
|
Author |
Message |
navhin
New User
Joined: 26 Mar 2007 Posts: 5 Location: india
|
|
|
|
Hi,
I am using SYNCSORT to extract data from DB2.
In the extract there is a column of TIME data type . The format of the TIME filed is hh.mm.ss by default. the hours , minutes and seconds are delimited by period.
The following information is available in the sysout after running the SYNCSORT about the specific field.
DB2 data type : TIME
SYNCSORT data type : CH
My requirement is to print the field in the format hh:mm:ss . the hours , minutes and seconds delimited by a colon.
I have read the syncsort prog guide and DFSORT programming guide but i couldn't understand how exactly to achieve this.
I tried using the EDIT option but keep getting syntax errors.
Please help in writing the OUTREC statement where this reformatting will be done using SYNCSORT.
I have other alternatives like to use Overlay after creating extract or DB2 functions to get hours , minutes and seconds separately and concatenate but I want to learn to do it in SYNCSORT using OUTREC while extracting. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Can you show your code, please? In the Code tags.
Why are you so desperate to use OUTREC? Unless you are relying on the result of a SORT or MERGE or SUM, INREC will be fine and a more sensible place to put it.
Have you looked at the data you extracted? Is it delimited already?
As well as your code, show sample input, expected result, received result. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Bring the time already with colons by selecting:
Code: |
CHAR(MY_TIME,JIS) AS MY_NEW_TIME |
I tried all the options (ISO,USA,EUR,JIS,LOCAL)
JIS worked for me. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
After some research:
JIS stands for "Japanese industrial standard" and time is shown as hh:mm:ss |
|
Back to top |
|
|
|