Martin Beginner

Joined: 20 Mar 2006 Posts: 133 Topics: 58
|
Posted: Thu Dec 04, 2008 1:03 pm Post subject: insert header and trailer with create time and date |
|
|
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 |
|
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Thu Dec 04, 2008 1:19 pm Post subject: |
|
|
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 |
|