View previous topic :: View next topic
|
Author |
Message |
shaktieswararao.Hazaru
New User
Joined: 25 Sep 2010 Posts: 20 Location: Hyderabad
|
|
|
|
Hi,
We have a requirement for adding the current timestamp for each record at the end.
ex: aaa2012-01-26-07.33.54.312189.
I have tried using the sort card as below
//JS010 EXEC PGM=SORT
//SORTIN DD *
AAAA
BBBB
CCCC
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,4,5:&DATE4)
/*
But i'm able to get result as below
AAAA2012-09-26-00.25.03
BBBB2012-09-26-00.25.03
CCCC2012-09-26-00.25.03
I need the timestamp of 26 for each record.
Please advice.
Thanks,
Shakti. |
|
Back to top |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
Depending on which PTF's you have installed, there is a DATE5 keyword which will give you micro-seconds. |
|
Back to top |
|
|
shaktieswararao.Hazaru
New User
Joined: 25 Sep 2010 Posts: 20 Location: Hyderabad
|
|
|
|
Any idea on the utlity that can generate timestamp. |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
If you have z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026, you can use DATE5 option for the same.
From the manual,
Quote: |
A new DATE5 option can be used to generate a timestamp constant of the form 'yyyy-mm-dd-hh.mm.ss.nnnnnn' with the year, month, day, hours, minutes, seconds and microseconds for the run. |
|
|
Back to top |
|
|
ezio vin
New User
Joined: 16 Aug 2012 Posts: 44 Location: india
|
|
|
|
Code: |
//*********************************************
//MERGE EXEC PGM=SORT
//*********************************************
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABC
DEF
GHI
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,3,X,DATE1(/),X,TIME2(:))
/* |
Output
Code: |
ABC 2012/09/26 05:23
DEF 2012/09/26 05:23
GHI 2012/09/26 05:23 |
try this code |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Code: |
ABC 2012/09/26 05:23 |
and ... apart the formatting, what is the difference from the data posted by the TS ?
the TS wants also the seconds and the milli/micro/whatever part also
even if for a batch process the milli/micro/whatever is IMO pretty useless |
|
Back to top |
|
|
|