View previous topic :: View next topic
|
Author |
Message |
nazia.lalani Warnings : 1 New User
Joined: 20 Mar 2009 Posts: 25 Location: hyderabad
|
|
|
|
I have file in which therre are two fileds
A - PIC s9(9) COMP
B - PIC s9(9) COMP
I want the addition of field A and Field B fro each record in C filed
Is it possible using JCL?
Outout File
A B C |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
Is it possible using JCL? |
No, it is not possible. All JCL can do is execute programs.
Now, if you had asked about doing it via SORT or another program .... |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
nazia.lalani,
Assuming your first field A is at pos 1 and B is at pos 10, the following control cards would put the sum of A and B in pos 20
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTREC OVERLAY=(20:1,4,FI,ADD,10,4,FI,FI,LENGTH=4)
/* |
|
|
Back to top |
|
|
nazia.lalani Warnings : 1 New User
Joined: 20 Mar 2009 Posts: 25 Location: hyderabad
|
|
|
|
Thanks Kolusu.........Its working fine.... |
|
Back to top |
|
|
|