MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Even number Check in Easytrieve

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
vijay
Beginner


Joined: 09 May 2003
Posts: 131
Topics: 64

PostPosted: Fri Jun 18, 2004 7:28 am    Post subject: Even number Check in Easytrieve Reply with quote

Hi ,

Do we've a divide statement in EZT like in cobol.I want to find whether a numeric field is even or not in EZT .

Thanks,
Vijay
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12382
Topics: 75
Location: San Jose

PostPosted: Fri Jun 18, 2004 8:23 am    Post subject: Reply with quote

Vijay,

Please use meaningful topic titles. A more approriate title would be "Even number Check in Easytrieve" . I am editing the topic title.

There is no divide verb in easytrieve but you can use the divide symbol "/" to divide a number. The following program will check if the number is an even number or not


Code:

DEFINE W-NUMBER     W 05 N 0                         
DEFINE W-QUOTIENT   W 05 N 0                         
DEFINE W-REMAINDER  W 05 N 0                         
                                                     
JOB INPUT NULL                                       
                                                     
      W-NUMBER     =  101                             
      W-QUOTIENT   =  W-NUMBER / 2                   
      W-REMAINDER  = (W-NUMBER - (W-QUOTIENT *  2 )) 
                                                     
      IF W-REMAINDER = 0                             
         DISPLAY 'THE NUMBER IS EVEN '
      ELSE                                           
         DISPLAY 'THE NUMBER IS NOT EVEN '
      END-IF                                         



Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group