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

Author Message
Anu Narayanan

New User

Joined: 12 Sep 2005
Posts: 20
Location: USA

 Posted: Mon Aug 28, 2006 11:06 pm    Post subject: Obtaining Remainder and quotient using eztrieve Hi, Is there a way to obtain a remainder during a divide statement using eztrieve like we have in Cobol or any other language? I am trying to find whether a year is leap year and hence further calculation goes on.

IQofaGerbil

Active User

Joined: 05 May 2006
Posts: 183
Location: Scotland

 Posted: Tue Aug 29, 2006 3:28 pm    Post subject: Re: Obtaining Remainder and quotient using eztrieve Try using the INTEGER function which drops any fraction from a number ie RESULT W 5 N 2 TESTIT W 5 N 2 code RESULT = YEAR/4 TESTIT INTEGER = RESULT IF RESULT = TESTIT then you have a leap year ELSE you don't have a leap year ENDIF
vijayarockiarajkp

New User

Joined: 18 Jul 2006
Posts: 7
Location: USA

 Posted: Tue Sep 19, 2006 6:48 pm    Post subject: Hi, Please find the below code i believe it will work FILE FILE1 YEAR1 1 4 N * FILE FILE2 YEAR2 1 4 N LEAP 6 11 A * WS-LEAP W 10 A VALUE 'LEAPYEAR' WS-NLEAP W 11 A VALUE 'NOTLEAPYEAR' WS-QUOTE W 4 N WS-QUOTE1 W 4 N WS-REM W 4 N * * JOB INPUT ( FILE1 ) * WS-QUOTE = YEAR1 / 4 WS-QUOTE1 = WS-QUOTE * 4 IF WS-QUOTE1 = YEAR1 YEAR2 = YEAR1 LEAP = WS-LEAP ELSE YEAR2 = YEAR1 LEAP = WS-NLEAP END-IF PUT FILE2 *
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am Obtaining file information pahiker COBOL Programming 25 Tue Sep 27, 2016 7:25 pm Obtaining a signed value when updatin... Shrikant Kumar DFSORT/ICETOOL 2 Wed Dec 24, 2014 11:04 pm Obtaining the address of Pointer in C... oerdgie COBOL Programming 7 Thu Oct 23, 2014 2:57 pm Please Help me How to achieve in reco... srinivasulu.p CA Products 5 Tue Jan 28, 2014 12:52 am

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