View previous topic :: View next topic
|
Author |
Message |
sivakumar M
New User
Joined: 03 Jul 2011 Posts: 8 Location: india
|
|
|
|
I have an input file which lot of numeric data in it. Using Sort I am doing some arithmetic operation and writing to the output file. At the end of the process, I do need to add a string which represents the process got over.
Is there any way to do this using Trailer in JCL SORT?
Input file:
xyz 01
XYZ 01
ABC 05
BBC 02
ABC 02
Output file:
XYZ 02
ABC 07
BBC 02
***End of process*** --> Please suggest how to add this string at this position. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
yes, search for TRAILER1
Gerry |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
It's difficult to give you the exact control statements since we don't know if you're using SUM or OUTFIL to get the totals, but you could add a trailer record with a DFSORT OUTFIL statement like this:
Code: |
OUTFIL REMOVECC,TRAILER1=('***end of process***')
|
If you're already using OUTFIL, then add that to your OUTFIL statement.
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/support/docview.wss?rs=114&uid=isg3T7000080 |
|
Back to top |
|
|
sivakumar M
New User
Joined: 03 Jul 2011 Posts: 8 Location: india
|
|
|
|
Hi Frank,
Thanks for your suggestion. As you mentioned, I am already using OUTFIL statement in my SORT. When I use HEADER1 with TRAILER1, it is working fine. But when I use the combination of HEADER1,TRAILER1,HEADER2 in the SORT, I am getting error. Can you please suggest ? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
But when I use the combination of HEADER1,TRAILER1,HEADER2 in the SORT, I am getting error. |
And why is the error not posted. . .
Telling us "it didn't work" is probably the biggest waste of time / space on the forum.
You need to post the complete diagnostic information from the problem run along with the jcl and sort control statements. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Can you show the cards you have used and the messages you got/data you created which shows what did not work, including clear indication of what was not working.
All in the Code tags, please. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Thanks for your suggestion. As you mentioned, I am already using OUTFIL statement in my SORT. When I use HEADER1 with TRAILER1, it is working fine. But when I use the combination of HEADER1,TRAILER1,HEADER2 in the SORT, I am getting error. Can you please suggest ? |
HEADER1, TRAILER1 and HEADER2 is a valid combination for OUTFIL so you most likely have a syntax error. Since I can't see what you're doing or read your mind, I can't suggest how to fix the error. You'd have to show me what your control statements look like for me to do that. |
|
Back to top |
|
|
|