Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
birdy K

New User

Joined: 05 Mar 2008
Posts: 72
Location: chennai

 Posted: Fri Sep 04, 2009 2:47 pm    Post subject: Divide Operation 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?

Escapa

Senior Member

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

Posted: Fri Sep 04, 2009 4:22 pm    Post subject:

 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.
Frank Yaeger

DFSORT Moderator

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

Posted: Sat Sep 05, 2009 5:53 am    Post subject:

 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.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Utility for search operation Gopalakrishna551 TSO/ISPF 11 Wed Jan 03, 2018 11:07 am Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm Joinkeys operation betwen VB and FB file Susanta SYNCSORT 4 Sun Sep 25, 2016 9:49 pm how to eliminate records from operati... PUMA DFSORT/ICETOOL 5 Tue Dec 23, 2014 4:42 pm Operation with 3 files sun_job DFSORT/ICETOOL 5 Wed Oct 15, 2014 6:46 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us