Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Syncsort OUTREC Convert Time to format hh:mm:ss

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
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    Post subject: Syncsort OUTREC Convert Time to format hh:mm:ss
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Mon Aug 24, 2015 8:26 pm    Post subject: Reply to: Syncsort OUTREC Convert Time to format hh:mm:ss
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: 1219
Location: Israel

PostPosted: Tue Aug 25, 2015 1:18 pm    Post subject: Reply to: Syncsort OUTREC Convert Time to format hh:mm:ss
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: 1219
Location: Israel

PostPosted: Tue Aug 25, 2015 1:27 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 5 Fri Dec 02, 2016 9:47 am
This topic is locked: you cannot edit posts or make replies. Get a job submitted itself every time... arunsoods JCL & VSAM 3 Tue Nov 22, 2016 4:05 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us