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 Transfer Value to label

/* Main program */ 
n = 1 

if \ datatype( n, wholenumber ) then 
   signal msg 

if n < 1 | n > 3 then 
   signal msg  
   signal value n 
   3 : say 'This is the number 3' 
   2 : say ' This is the number 2' 
   1 : say ' This is the number 1' 
   return n 
msg : 
   say ' This is an incorrect number ' 
   exit 99 

Rexx Whole Number

/* Main program */ 
n = 100 

if \ datatype( n, wholenumber ) then 
   signal msg 
   say ' This is a whole number ' 
   return 0 
msg : 
   say ' This is an incorrect number '

Rexx Signal Statement

/* Main program */ 
n = 100.45 

if \ datatype( n, wholenumber ) then 
   signal msg 
   say 'This is a whole number' 
   return 0 
msg : 
   say 'This is an incorrect number'

Rexx relative positional parsing

/* Main program */ 
testString = "Doe       John M.   03/03/78  Mumbai              India"; 
parse var testString name1 +10 name2 +10 birthday +10 town +20 country 
say name1 
say name2 
say birthday 
say town 
say country

Rexx Posittional Parsing

/* Main program */ 
testString = "Doe       John M.   03/03/78  Mumbai              India"; 
parse var testString name1 11 name2 21 birthday 31 town 51 country 
say name1 
say name2 
say birthday 
say town 
say country

Rexx Parse While clause

/* Main program */ 
phrase = 'This is a Tutorial' 

do while phrase <> '' 
   parse var phrase word phrase 
   say "'"word"'" 
   end 

Rexx How to Parse

/* Main program */ 
parse value 'This is a Tutorial' with word1 word2 word3 word4 
say "'"word1"'" 
say "'"word2"'" 
say "'"word3"'" 
say "'"word4"'" 

Rexx Directory

/* Main program */ 
options arexx_bifs 
say directory() 

Rexx B2C

/* Main program */ 
options arexx_bifs 
say b2c('00110011')

Rexx System Command Example

/* Main program */ 
dir 
if rc = 0 then 
   say 'The command executed successfully' 
else 
   say 'The command failed, The error code is =' rc

Advertisements
Loading...

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