Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Addition using jcl

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Addition using jcl
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: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Mon Aug 24, 2009 5:03 pm    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Performing addition using JCL sort card Shaheen Shaik DFSORT/ICETOOL 14 Fri May 06, 2016 12:25 pm
No new posts Cobol addition with comma delimited i... rajaseelan j COBOL Programming 2 Thu Apr 05, 2012 11:43 am
No new posts Addition and subtraction of dates in ... dejunzhu COBOL Programming 8 Thu Mar 15, 2012 12:26 pm
No new posts Addition operation is not working wit... sureshmurali DFSORT/ICETOOL 2 Fri Jan 27, 2012 10:26 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us