View previous topic :: View next topic |
Author |
Message |
v_arpit Beginner
Joined: 25 Sep 2006 Posts: 10 Topics: 2
|
Posted: Thu Jun 14, 2007 1:57 pm Post subject: count records including header and trailer |
|
|
Hi,
I want to insert header and trailer records in output file.
In trailer record I want count of all records of input file including header and trailer record.
Thanks,
Arpit |
|
Back to top |
|
 |
v_arpit Beginner
Joined: 25 Sep 2006 Posts: 10 Topics: 2
|
Posted: Thu Jun 14, 2007 1:58 pm Post subject: |
|
|
Forget to mention.
I want this by using Sort card. |
|
Back to top |
|
 |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Thu Jun 14, 2007 2:03 pm Post subject: |
|
|
v_arpit wrote: | Forget to mention.
I want this by using Sort card. |
Well...you also forgot to search the forums....Just a simple search for Header/Trailer AND SORT would have got you so many posts.
Check this,
http://www.mvsforums.com/helpboards/viewtopic.php?t=5398
Thanks,
Phantom |
|
Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Thu Jun 14, 2007 2:18 pm Post subject: |
|
|
Arpit,
Please show an example of your input records and what you expect for output. _________________ 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 |
|
 |
v_arpit Beginner
Joined: 25 Sep 2006 Posts: 10 Topics: 2
|
Posted: Thu Jun 14, 2007 3:46 pm Post subject: |
|
|
Hi,
If my input file having 4 records as below
D111111
D111112
D111113
D111114
then expected output should be
D111111
D111112
D111113
D111114
T 5
Please help. |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Thu Jun 14, 2007 3:48 pm Post subject: |
|
|
v_arpit,
what about your header record? _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
v_arpit Beginner
Joined: 25 Sep 2006 Posts: 10 Topics: 2
|
Posted: Thu Jun 14, 2007 3:52 pm Post subject: |
|
|
Yes output record is like
HARPIT
D111111
D111112
D111113
D111114
T 5 |
|
Back to top |
|
 |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Thu Jun 14, 2007 4:06 pm Post subject: |
|
|
Ok...If your header record is hardcoded, then you could try the following.
Code: |
//R010 EXEC PGM=SORT
//SORTIN DD DSN=your.input.file,
// DISP=SHR
//SORTOUT DD DSN=your.output.file,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(trk,(x,y),rlse)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL HEADER1=('HARPIT'),
TRAILER1=('T ',COUNT),REMOVECC
/*
|
The REMOVECC parm in OUTFIL statement is used to Suppress the ANSI Print control characters. If you do not use this, your output file will be created as FBA with 1 byte more than your expected LRECL
Hope this helps,
Thanks,
Phantom |
|
Back to top |
|
 |
v_arpit Beginner
Joined: 25 Sep 2006 Posts: 10 Topics: 2
|
Posted: Thu Jun 14, 2007 4:46 pm Post subject: |
|
|
I tried but this give me only detail records count.
I want detail records + header and trailer count.
e.g.
HARPIT
D111111
D111112
D111113
D111114
T 6
But this gives me
HARPIT
D111111
D111112
D111113
D111114
T 4 |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu Jun 14, 2007 5:13 pm Post subject: |
|
|
v_arpit,
Try these control cards
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,
HEADER1=('HARPIT'),
TRAILER1=('T ',COUNT+2=(M10,LENGTH=8))
/*
|
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
v_arpit Beginner
Joined: 25 Sep 2006 Posts: 10 Topics: 2
|
Posted: Thu Jun 14, 2007 5:40 pm Post subject: |
|
|
Thanks.
It works.
could you please explain me the significance of M10. And what is the maximum length of trailer count. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu Jun 14, 2007 5:43 pm Post subject: |
|
|
Quote: |
could you please explain me the significance of M10. And what is the maximum length of trailer count
|
check this link for m10 edit mask
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Thu Jun 14, 2007 5:45 pm Post subject: |
|
|
M10 is one of the 27 DFSORT edit masks. It displays the count with leading zeros suppressed. The maximum length of the trailer count is 15 digits.
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html _________________ 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 |
|
 |
v_arpit Beginner
Joined: 25 Sep 2006 Posts: 10 Topics: 2
|
Posted: Thu Jun 14, 2007 6:12 pm Post subject: |
|
|
thanks alot. |
|
Back to top |
|
 |
|
|