Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Divide Operation

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Divide Operation
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    Post subject:
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 Moderator


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

PostPosted: Sat Sep 05, 2009 5:53 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm
No new posts Joinkeys operation betwen VB and FB file Susanta SYNCSORT 4 Sun Sep 25, 2016 9:49 pm
No new posts how to eliminate records from operati... PUMA DFSORT/ICETOOL 5 Tue Dec 23, 2014 4:42 pm
No new posts Operation with 3 files sun_job DFSORT/ICETOOL 5 Wed Oct 15, 2014 6:46 pm
No new posts File operation sakthikumarT CICS 6 Sun Oct 12, 2014 10:03 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us