View previous topic :: View next topic
|
Author |
Message |
shaktiprasad
New User
Joined: 20 Aug 2006 Posts: 34 Location: chennai
|
|
|
|
Can anybody please tell me how to get the CURRENT TIMESTAMP upto milliseconds using either SORT/DFSORT/ICETOOL.
If I use any of formats like TIME1/TIME2/TIME3 it gives only upto seconds. |
|
Back to top |
|
|
gabriel.ryoga
New User
Joined: 07 Jun 2007 Posts: 31 Location: Spain
|
|
|
|
I think that DFSORT's TIME instruction, only will return you a seconds precision.
I think that if you only need to identify any output record in a unique way. You could use this job:
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
100 ABCAXY
300 BCDASY
200 DBFDSA
100 ADBSAD
150 DFGSFS
//TOOLIN DD *
SORT FROM(IN) TO(T1) USING(CTL1)
//T1 DD SYSOUT=*
//CTL1CNTL DD *
INREC OVERLAY=(12:DATE=(4MD-),C'-',TIME=(24.))
SORT FIELDS=COPY
OUTREC OVERLAY=(31:C'.',32:SEQNUM,6,ZD,RESTART=(30,2))
/*
|
It will generate a timestamp format variable and number it from 000001 to 999999.
restarting everytime the seconds change.
It can give you duplicate timestamps when the seqnum arrives to 999999 and the seconds have not change.
But I hope this can be useful for you.
|
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
AFAIK, DFSORT does NOT have any built-in functions for getting the microsecond part dynamically, however as you just said mili-seconds, try this:
Code: |
//sort1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC BUILD=(1:DATE4,C'.000000') |
|
|
Back to top |
|
|
shaktiprasad
New User
Joined: 20 Aug 2006 Posts: 34 Location: chennai
|
|
|
|
Hi ,
Thanks for the reply. Actually I wanted to use it for a unique number generation only.But it seems it will give me duplicate records if the time doesn't change within a span.So I am going by Program to generate the unique number.
Anyway thanks for the quick reponse again.
Thanks
Shakti |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
shaktiprasad wrote: |
Thanks for the reply. Actually I wanted to use it for a unique number generation only. |
Quote: |
Can anybody please tell me how to get the CURRENT TIMESTAMP upto milliseconds using either SORT/DFSORT/ICETOOL. |
Your first post, in this thread, and the latest post are by far in no relation! How would I know, what do yuou want - and for that matter, how the sort would know!?
Suggest you start over and tell us what exactly you are looking for... |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
For uniqueness, consider seqnum... |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
shaktiprasad,
As cicsguy pointed out you can use the seqnum to generate the microseconds portion unique. However note that the microseconds is only 6 digits so you can only generate a max of 999,999 unique values
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC BUILD=(1:DATE4,C'.',SEQNUM,6,ZD)
//* |
|
|
Back to top |
|
|
|