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

Author Message
murugan_mf

Active User

Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

Posted: Tue Mar 17, 2009 8:48 pm    Post subject: How to find if the decimal part contains a non zero value

Hi,

My requirement is to find out whether the decimal part contains a non zero value. I am using the below logic to find this and it works fine.
But I am certain, there must be a better way to do this.

Example:

 Code: field1 pic 9(2)v9(2)  field2 pic 9(2)v9(2)  Compute field1 Rounded = field2  If field1 not = field2     some process  End-if

Craq Giegerich

Senior Member

Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

Posted: Tue Mar 17, 2009 9:11 pm    Post subject:

Just redefine field1 as
 Code: 03 field1 pic 9(2)v9(2)  03 field2 redefines field1.       04      pic xx.       04 field2-dec pic 99. if field2-dec Not = 0     some process end-if.

This avoids the extra processing for the compute.
murugan_mf

Active User

Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

 Posted: Tue Mar 17, 2009 9:23 pm    Post subject: Craq, Thanks a lot!!!
CICS Guy

Senior Member

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

Posted: Tue Mar 17, 2009 9:46 pm    Post subject:

Or:
 Code: field1 pic 9(2)v9(2) if field1(3:2) Not = Zeros     some process end-if.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Copying part of the report using SARBCH Aedulla CA Products 1 Tue Oct 24, 2017 9:24 am Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am Command to find TMEMBER name for a TPIPE Siva NKK Kothamasu IMS DB/DC 0 Wed Aug 16, 2017 6:08 pm RMM: scratching a volume that RMM thi... Hervey Martinez IBM Tools 0 Mon May 15, 2017 8:51 pm

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