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

Arithematic operations using SORT


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

New User


Joined: 03 Feb 2006
Posts: 41
Location: Hyderabad

PostPosted: Thu Sep 25, 2008 8:56 pm
Reply with quote

Hi,

I have a requirement to use aritematic operations using SORT utility. I am using syncsort.

My file looks something like this:

00014
00015
00016
00017
00018

I need to subtract all these columns with 13.

Please assist.

Thanks
Amith
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Sep 25, 2008 9:18 pm
Reply with quote

Take a look at the OUTFIL FIELDS parameter, It has arithmetic functions....
SyncSort for z/OS 1.3 Programmer’s Guide wrote:
The arithmetic functions of minimum and maximum (MIN and MAX) are performed before the arithmetic operators (MUL, DIV, MOD, ADD, SUB). Within the arithmetic operators, multiplication (MUL), division (DIV), and modulus (MOD) are performed before addition (ADD) and subtraction (SUB). Operations within the same precedence level are performed from left to right.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Thu Sep 25, 2008 10:28 pm
Reply with quote

Try this:
Code:
//SYSIN  DD *
   SORT FIELDS=COPY                     
   OUTREC FIELDS=(1,5,ZD,SUB,+13,M11,LENGTH=5)
   END
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top