Left and Right function...
Normally every programmer uses Left and Right function to strip the characters from left of a string or Right of a string.
For example:
String="hello"
Result=left(String,4)
This would REXX procedure would return Result as "hell".
REXX is normally used to automate routine manual tasks or generating codes. In order to keep the readability of the code in place, it is necessary we use the right functions to give us a standard alignment throughout the generated source.
The function Left and Right helps us a lot in the regard.
For example: Our task is to give a rating to every country in the world.
Country1="India"
Country2="USA"
Country3="Germany"
Rating1="1"
Rating2="2"
Rating3="3"
Statement1=left(Country1,20)!!left(Rating1,4)
Statement2=left(Country2,20)!!left(Rating2,4)
Statement3=left(Country3,20)!!left(Rating3,4)
This would result in a proper alignment.
Result would be...
India 1
USA 2
Germany 3
Subscribe to:
Post Comments (Atom)
Featured Post
REXX Skeleton: Submitting jobs through Rexx
Submitting jobs through REXX and reading the spool through REXX gives us immense potential to automate many manual activities in mainframes....
-
Abend S013 SYSTEM COMPLETION CODE=013 REASON CODE=00000018 AN OPEN WAS ISSUED FOR A PARTITIONED DATASET. THE SPECIFIED MEMBER NAME WAS N...
-
In order to read or write a file using REXX, first step is to allocate a DDNAME. This step is required only when REXX is executed through Fo...
-
A word is defined as a blank delimited set of characters within a string in REXX. The characters in a word can be alpha, numeric, alphanume...
No comments:
Post a Comment