IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to add timestamp at the end of each record in the file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shaktieswararao.Hazaru

New User


Joined: 25 Sep 2010
Posts: 20
Location: Hyderabad

PostPosted: Wed Sep 26, 2012 1:02 pm
Reply with quote

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
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 199
Location: UK

PostPosted: Wed Sep 26, 2012 2:02 pm
Reply with quote

Depending on which PTF's you have installed, there is a DATE5 keyword which will give you micro-seconds.
Back to top
View user's profile Send private message
shaktieswararao.Hazaru

New User


Joined: 25 Sep 2010
Posts: 20
Location: Hyderabad

PostPosted: Wed Sep 26, 2012 2:11 pm
Reply with quote

Any idea on the utlity that can generate timestamp. icon_sad.gif
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Wed Sep 26, 2012 2:41 pm
Reply with quote

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
View user's profile Send private message
ezio vin

New User


Joined: 16 Aug 2012
Posts: 44
Location: india

PostPosted: Wed Sep 26, 2012 2:51 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Sep 26, 2012 3:16 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top