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
 

 

Obtaining Remainder and quotient using eztrieve

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
View previous topic :: :: View next topic  
Author Message
Anu Narayanan

New User


Joined: 12 Sep 2005
Posts: 20
Location: USA

PostPosted: Mon Aug 28, 2006 11:06 pm    Post subject: Obtaining Remainder and quotient using eztrieve
Reply with quote

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.
Back to top
View user's profile Send private message

IQofaGerbil

Active User


Joined: 05 May 2006
Posts: 183
Location: Scotland

PostPosted: Tue Aug 29, 2006 3:28 pm    Post subject: Re: Obtaining Remainder and quotient using eztrieve
Reply with quote

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
Back to top
View user's profile Send private message
vijayarockiarajkp

New User


Joined: 18 Jul 2006
Posts: 7
Location: USA

PostPosted: Tue Sep 19, 2006 6:48 pm    Post subject:
Reply with quote

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

 

Search our Forum:

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


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