IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Syncsort OUTREC Convert Time to format hh:mm:ss


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
navhin

New User


Joined: 26 Mar 2007
Posts: 5
Location: india

PostPosted: Mon Aug 24, 2015 6:24 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Aug 24, 2015 8:26 pm
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Aug 25, 2015 1:18 pm
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Aug 25, 2015 1:27 pm
Reply with quote

After some research:
JIS stands for "Japanese industrial standard" and time is shown as hh:mm:ss
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
Search our Forums:

Back to Top