MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

insert header and trailer with create time and date

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Martin
Beginner


Joined: 20 Mar 2006
Posts: 133
Topics: 58

PostPosted: Thu Dec 04, 2008 1:03 pm    Post subject: insert header and trailer with create time and date Reply with quote

Hi All,

I have a requirement where in I need to insert a header ( with create time and date ) and a trailer ( with record count) into a file. Mentioned below is an example of my requirement.

File 1 : ( Detail records)

abcd
efgh
xyzs
iuyt

File 2 : ( contains the date which needs to be a part of header )

XXXXXX080810 090810 -- > Length 80 byte
<date1> <date2>
Output file

mvsforum<systemdateMMDDYYYY><HHMMSSsystemtime><date1><date2>
abcd
efgh
xyzs
iuyt
mvsforum0000006<total record count>

P.S : I did search the forum but was unable to fund any hits for this requirement.

Thanks,
Martin
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Dec 04, 2008 1:19 pm    Post subject: Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *   input file2
XXXXXX080810   090810
/*
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REMOVECC,
    BUILD=(C'Hdate1,''',7,6,C'''',80:X,/,
           C'Hdate2,''',16,6,C'''')
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD *    input file1
abcd
efgh
xyzs
iuyt
/*
//SORTOUT DD SYSOUT=*   output file
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REMOVECC,
    HEADER1=('mvsforum',DATENS=(MD4),TIMENS=(24),
     Hdate1,Hdate2),
    TRAILER1=('mvsforum',COUNT+2=(EDIT=(TTTTTTT)))
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group