IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Addition using jcl


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nazia.lalani
Warnings : 1

New User


Joined: 20 Mar 2009
Posts: 25
Location: hyderabad

PostPosted: Mon Aug 24, 2009 4:52 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Mon Aug 24, 2009 5:03 pm
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Aug 24, 2009 9:23 pm
Reply with quote

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
View user's profile Send private message
nazia.lalani
Warnings : 1

New User


Joined: 20 Mar 2009
Posts: 25
Location: hyderabad

PostPosted: Tue Aug 25, 2009 11:44 am
Reply with quote

Thanks Kolusu.........Its working fine....
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Addition of two records on 2 fields SYNCSORT 8
No new posts Performing addition using JCL sort card DFSORT/ICETOOL 14
No new posts Cobol addition with comma delimited i... COBOL Programming 2
No new posts Addition and subtraction of dates in ... COBOL Programming 8
No new posts Addition operation is not working wit... DFSORT/ICETOOL 2
Search our Forums:

Back to Top