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

Arithmetic computation in JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rohinitotey

New User


Joined: 02 May 2006
Posts: 7

PostPosted: Tue Dec 23, 2008 1:50 am
Reply with quote

Hi,

I have a 10 large files. Around 30 fields in each of these files need to be multiplied by -1. Can I do this using JCL?

Appreciate any help!

Rohini
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Tue Dec 23, 2008 1:57 am
Reply with quote

If you want to run a batch job, you will do that "using JCL", but you can do that in foreground ( online ) without JCL.

Please please please, in any case you will do that with a program ( utility named or not ).

Now ask for an easytrieve, a dfsort, a syncsort, a Cobol, a RPG, a Assembler, a Edit macro, a REXX, ....
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Dec 23, 2008 2:04 am
Reply with quote

Quote:
Can I do this using JCL?
No, JCL does nothing except run programs (IDCAMS, SORT, SAS, COBOL compiles, COBOL programs, PL/I compiles, etc).

What you want can easily be done in a SAS program, COBOL program, PL/I program, and in many other ways -- but all the JCL is going to do is run the program you provide.
Back to top
View user's profile Send private message
rohinitotey

New User


Joined: 02 May 2006
Posts: 7

PostPosted: Tue Dec 23, 2008 2:14 am
Reply with quote

Sorry for not being very specific.

I have 10 large files with fields f1, f2, ...... f100.

What I want to do is :
if f1 = 3 , multiply f30, f31..f90 by -1.

I need to do this processing for all 10 files and the formats and the fields are different for each of them.

If I do this using a cobol program, I will have to spell out each and every field for multiplication. I will need to write a big lengthy program or else multiple programs with same processing.
I wanted to know if I cna do this using a SORT utility or is there any other easier way?
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Dec 23, 2008 2:30 am
Reply with quote

Quote:
If I do this using a cobol program, I will have to spell out each and every field for multiplication
The above part will be more or less the same for any other methodology as well. In some way or the other you'll have to let the system know which are the fields to be processed.

Quote:
if f1 = 3 , multiply f30, f31..f90 by -1
Do you have around 60 fields or different numeric formats that has to be multiplied by -1?
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Tue Dec 23, 2008 2:31 am
Reply with quote

Sorry, be sure, I don't want to be rude gratis, but is this a real difficulty to achieve what you want?
Have you already tried something?

You joined the forum in 2006. You certainely have learned something during that time?

I suppose you are paid for that now. You are in the business now, you are professional !

I repeat : did you already try something?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Dec 23, 2008 2:38 am
Reply with quote

rohinitotey,

You can use DFSORT's IFTHEN/OVERLAY/MUL functions to do this kind of thing. But if you want more specific help, you need to give the starting position, length and format of the relevant fields (f1, f30, etc).

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Dec 23, 2008 3:05 am
Reply with quote

Hello,

Quote:
I wanted to know if I cna do this using a SORT utility or is there any other easier way?
How might anything handle the logic and the arithmetic if the "code" is not told where the fields are and their format icon_confused.gif

Possibly i misunderstand what you are asking, but it sounds like you want some magic bullet that will be able to do what you want without being provided any detailed information. . .
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 Arithmetic division using Syncsort SYNCSORT 6
No new posts Help this REXX Rookie-Bad arithmetic ... CLIST & REXX 7
No new posts Bad arithmetic conversion when assign... CLIST & REXX 4
No new posts HEADER1 with Date arithmetic DFSORT/ICETOOL 4
No new posts Performing arithmetic on input field DFSORT/ICETOOL 37
Search our Forums:

Back to Top