View previous topic :: View next topic
|
Author |
Message |
rosmi joseph
New User
Joined: 17 Sep 2007 Posts: 68 Location: Kochi
|
|
|
|
Hi,
I have two input files with s9(11)v9999 COMP-3 variables.
I have to sum up both the numbers are write it to the SORT out file.
Record format: FB
Record length: 80
Both the numbers are at the first postion in both the files.
Please let me know how to do this using JCL sort.
Thanks. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
rosmi,
Quote: |
Please let me know how to do this using JCL sort. |
You can use DFSORT for your requirement. DFSORT has many ways to edit a PD field using the edit masks available (M0 - M26).
First convert the PD fields to the required format and then do the arithmetic operation on that. |
|
Back to top |
|
|
rosmi joseph
New User
Joined: 17 Sep 2007 Posts: 68 Location: Kochi
|
|
|
|
Hi,
I am not sure abt the syntax. Could anyone please assist me.
Thanks. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
rosmi joseph
SORT JCL for your requirement is as follows
Code: |
//*******************************************************
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD I/P-FILE-1 (FB/80)
// DD I/P-FILE-2 (FB/80)
//SORTOUT DD O/P-FILE (FB/80)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(1:TOT=(1,8,PD,TO=PD))
/*
|
If you want the i/p file records in your o/p then remove NODETAIL from the OUTFIL statement. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
rosmi joseph,
Note that Krisprems DFSORT job will produce an 8-byte PD total. If you want the total in a displayable form you can use DFSORT edit masks, e.g.
TRAILER1=(TOT=(1,8,PD,M10))
would give you a 15-digit total with leading zeros suppressed, e,g.
For more information on using DFSORT edit masks, see:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG20/2.4.8?DT=20060615173822
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:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
|