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
 

 

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: 2284
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: 2284
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 Browse dataset cvnlynn CLIST & REXX 4 Tue Jul 18, 2017 3:52 am
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am


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