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: 2239
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: 2239
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 Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts JCL to get submitted once dataset has... vinu78 JCL & VSAM 17 Thu Feb 16, 2017 7:32 am
No new posts Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am


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