Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 182
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: 10387
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 COB2 file processing rizwanaccy COBOL Programming 8 Tue Jan 02, 2018 1:00 pm
No new posts KSDS and Index file in cobol deepak14450 COBOL Programming 9 Fri Dec 22, 2017 9:36 am
No new posts Preserve order in Input File pshongal DFSORT/ICETOOL 13 Thu Dec 21, 2017 4:20 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us