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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to add timestamp at the end of each record in the file
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: 176
Location: UK

PostPosted: Wed Sep 26, 2012 2:02 pm    Post subject:
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    Post subject: Reply to: How to add timestamp at the end of each record in
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: 788
Location: Chennai, India

PostPosted: Wed Sep 26, 2012 2:41 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Wed Sep 26, 2012 3:16 pm    Post subject: Reply to: How to add timestamp at the end of each record in
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


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