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

Divide Operation


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
birdy K

New User


Joined: 05 Mar 2008
Posts: 72
Location: chennai

PostPosted: Fri Sep 04, 2009 2:47 pm
Reply with quote

Can we do the divide operation in sort? For ex, I have to divide the numeric column by 4 for particular record. How to perform this?
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Sep 04, 2009 4:22 pm
Reply with quote

Quote:
You can do arithmetic with numeric fields and decimal constants (+n and −n) using the operators MIN (minimum), MAX (maximum), DIV (division), MUL (multiplication), MOD (modulus), ADD (addition) and SUB (subtraction). The order of evaluation precedence for the operators is as follows, but can be changed by using parentheses: 1. MIN and MAX 2. MUL, DIV and MOD 3. ADD and SUB

This is from DFSORT getting started...

Read DFSORT Getting started from these docs first

If you are seeking for some specific help, show us some records from input file and desired output for the same.
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: Sat Sep 05, 2009 5:53 am
Reply with quote

Quote:
Can we do the divide operation in sort? For ex, I have to divide the numeric column by 4 for particular record.


You should have given more details. However, as an example, if you want to divide the ZD value in positions 11-15 by 4, you could use DFSORT control statements like this:

Code:

    OPTION COPY
    INREC OVERLAY=(11,5,ZD,DIV,+4,TO=ZD,LENGTH=5)


This will give you a 5-byte ZD integer result. For example if you divided 00021/4 the result would be 00005.

If you need more specific help, you need to give more details of what you want to do exactly.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts An write operation error - ABENDED S0... COBOL Programming 3
No new posts Divide and edit the sum - OutRec DFSORT/ICETOOL 5
No new posts Utility for search operation TSO/ISPF 11
No new posts Joinkeys operation when key1 and key2... DFSORT/ICETOOL 5
No new posts Joinkeys operation betwen VB and FB file SYNCSORT 4
Search our Forums:

Back to Top