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

To add a time stamp in header and trailer record


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
manikandanjs

New User


Joined: 02 Jun 2006
Posts: 27
Location: Blue Bell, PA

PostPosted: Tue Dec 19, 2006 5:02 pm
Reply with quote

Could you please provide a solution to the below problem?

1. I have 5 files each with n number of records.
2. These 5 files needs to be concatenated.
3. Need to add header and trailer which includes the time stamp (date and current time).
4. Need to insert the count in the trailer record (including the total number of combined records).

J Manikandan
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Dec 19, 2006 9:17 pm
Reply with quote

Assuming all of the files are VB, or FB with the same LRECL, you can use a DFSORT job like the following to do what you asked for. You can change the formatting of the date, time and count appropriately depending on what you want them to look like.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file1
//       DD DSN=...  input file2
//       DD DSN=...  input file3
//       DD DSN=...  input file4
//       DD DSN=...  input file5
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REMOVECC,HEADER1=(DATE=(4MD/),X,TIME=(24:)),
    TRAILER1=(DATE=(4MD/),X,TIME=(24:),X,COUNT=(M11,LENGTH=8))
/*


SORTOUT might look like this:

Code:

2006/12/19 07:38:32                       
record
...                         
2006/12/19 07:38:32 00000011               


I assumed you wanted the count of just the input records. If you want the count of the input records + 2 for the header and trailer record, use:

Code:

COUNT+2=(M11,LENGTH=8)
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts To get the the current time DFSORT/ICETOOL 13
Search our Forums:

Back to Top