Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Change timestamp to CURRENT TIMESTAMP in a dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Fri Mar 06, 2009 3:34 pm    Post subject: Change timestamp to CURRENT TIMESTAMP in a dataset
Reply with quote

Hi,

I have a dataset like this with lot of timestamps.
For testing, i need to convert this timestamp to current timestamp.
How to do it.....

Code:
    2008-03-02-05.19.06.018646
    2007-03-07-07.19.08.330066
    2006-03-14-03.19.16.381274


Thank You In Advance,
Sushanth
Back to top
View user's profile Send private message

sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Fri Mar 06, 2009 5:16 pm    Post subject:
Reply with quote

Can this be done using DFSORT...

Sushanth
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2287
Location: @my desk

PostPosted: Fri Mar 06, 2009 5:36 pm    Post subject:
Reply with quote

Sushanth,

If you are not bothered about the millisecond part, here's a job which does the same.
Code:
//STEP1    EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD *                                       
DUMMY RECORD                                           
DUMMY RECORD                                           
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                       
 INREC BUILD=(&DATE=(4MD-),C'-',&TIME=(24.),C'.000001')
 SORT FIELDS=COPY   

SORTOUT
Code:
2009-03-06-04.04.55.000001
2009-03-06-04.04.55.000001
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Fri Mar 06, 2009 6:02 pm    Post subject:
Reply with quote

Arun,

The JCL & Timestamps are working well. The timestamp is starting from column1. How can i get them to start from column 5.

Because, i have a dataset which is unloaded from the DB2 tablespace. The table has 2 columns ID(integer) & TS(timestamp).

For testing, i have to put the current timestamp, in the TS place.
The thing is in the unload dataset, when you view it. The integer numbers are not visible as in the first post, that's why 4 spaces in the beginning. That 4 spaces can't be even edited in the edit-mode.

When i run the above JCL, its completly getting replaced and the timestamp is getting started from the first column.

Thank You,
Sushanth Bobby
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2287
Location: @my desk

PostPosted: Fri Mar 06, 2009 6:07 pm    Post subject:
Reply with quote

Sushanth,

Change your INREC statement to the below one.
Code:
INREC OVERLAY=(5:&DATE=(4MD-),C'-',&TIME=(24.),C'.000001')
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Fri Mar 06, 2009 6:31 pm    Post subject:
Reply with quote

Thank You Arun, It works wonderfully.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Mar 06, 2009 11:25 pm    Post subject:
Reply with quote

Note that you can do this more easily using DFSORT's DATE4 parameter:

Code:

  INREC OVERLAY=(5:DATE4,C'.000001')   
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Comparision with current time arunsoods DFSORT/ICETOOL 5 Thu Nov 09, 2017 10:37 am
This topic is locked: you cannot edit posts or make replies. Comparing current time with the time ... arunsoods SYNCSORT 1 Mon Oct 30, 2017 4:07 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us