View previous topic :: View next topic |
Author |
Message |
sivafdms Intermediate
Joined: 29 May 2007 Posts: 165 Topics: 77
|
Posted: Mon Apr 21, 2008 4:30 am Post subject: Insert Header and Tralier records into File |
|
|
Hi ,
I need to insert Header and Tralier records in to the file X.Y.Z which already have some data init. Let take an example
file X.Y.Z has following records with FB/80
Siva FCMS
Subhash TCS
Madhu Cylocops
I need the same file following format with header having the name of the file and total length of record and trailer having the description of total no of records.
File:X.Y.Z Length : 80---------------------> Header
Siva FCMS
Subhash TCS
Madhu Cylocops
Total Number of records : 03----------------------> Trailer
Thanks
Siva |
|
Back to top |
|
 |
DaPlaze Beginner
Joined: 29 Mar 2007 Posts: 9 Topics: 2
|
Posted: Mon Apr 21, 2008 7:04 am Post subject: |
|
|
Hi,
I'm not one of the best to answer this, but you don't write anything about language or anything.
In my head, with the knowledge I have, I would write a simple program to read the records, and create a new header and trailer for the file. Then I would write the header first and then move each of the records to the new file, having a counter so that I could make the trailer like you want it..
Don't know if it helps you anything but that's my 2 cents for thougts. |
|
Back to top |
|
 |
sivafdms Intermediate
Joined: 29 May 2007 Posts: 165 Topics: 77
|
Posted: Mon Apr 21, 2008 7:53 am Post subject: |
|
|
Hi DaPlaze,
Initially i thought to write simple program but my client doesn't want that.I could like to do this through ICETOOL or Syncsort.
Thanks,
Siva |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Mon Apr 21, 2008 9:50 am Post subject: |
|
|
sivafdms,
The following DFSORT JCL will give you the desired results
Code: |
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
SIVA FCMS
SUBHASH TCS
MADHU CYLOCOPS
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,
HEADER1=(C'X.Y.Z LENGTH : 80'),
TRAILER1=('TOTAL NUMBER OF RECORDS : ',COUNT)
/*
|
Hope this helps...
Cheers _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
sivafdms Intermediate
Joined: 29 May 2007 Posts: 165 Topics: 77
|
Posted: Tue Apr 29, 2008 4:51 am Post subject: |
|
|
Thanks Kolusu... |
|
Back to top |
|
 |
|
|