Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Rexx Trunc

/* Main program */ 
say TRUNC(12.22)

Rexx Sign

/* Main program */ 
say SIGN(12) 
say SIGN(-12) 

Rexx Random

/* Main program */ 
say RANDOM()

Rexx Min

/* Main program */ 
say MIN(10,20,30)

Rexx Max

/* Main program */ 
say MAX(10,20,30)

Rexx Abs

/* Main program */ 
i = 50.5 
j = -40.4 
say ABS(i) 
say ABS(j) 

Rexx if else statement

/* Main program */ 
i = 50 
if (i < 10) then 
   do 
      say "i is less than 10" 
   end  
else 
   do 
      say "i is greater than 10" 
   end 

Rexx If Statement

/* Main program */ 
i = 5 

if (i < 10) then 
   do 
      say "i is less than 10" 
   end

Rexx Select Statement

/* Main program */ 
i = 50 
select 
when(i <= 5) then 
say "i is less than 5" 

when(i <= 10) then 
say "i is less than 10" 

otherwise 
say "i is greater than 10" 
end

Rexx Nested If Statement

/* Main program */ 
i = 50 
if (i < 10) then 
   do 
      say "i is less than 10" 
   end 
else 
if (i < 7) then 
   do 
      say "i is less than 7" 
   end 
else 
   do 
      say "i is greater than 10" 
   end 

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.