REXX MCQs and Answers with Explanation: This article provides REXX Multiple Choice Questions to help you enhance your knowledge about REXX. Before checking out the REXX MCQ Questions, take some time to learn about this concept and then proceed to the REXX Quiz. REXX (Restructured Extended Executor) is a powerful programming language developed in the early 1970s. Originally designed for mainframe systems, it was widely used in the banking and finance industries. However, REXX has since evolved into a versatile programming language that can be used for a variety of applications, including system programming, scripting, and web development.
REXX MCQs with Answers
One of the key features of REXX is its ease of use and readability, which makes it an ideal choice for beginners who are just starting out with programming. Through this article, you can go through the REXX Quiz Questions with answers to test your knowledge of this popular programming language. Try to answer these Top 54 REXX Multiple Choice Questions to test how well you know about this concept and where you need to improve to do better.
REXX Multiple Choice Questions
Name | REXX |
Exam Type | MCQ (Multiple Choice Questions) |
Category | Technical Quiz |
Mode of Quiz | Online |
Top 54 REXX MCQ Questions with Answers | REXX Online Quiz
1. What does the acronym REXX stand for?
a) Relational Extended Execution
b) Remote Execution
c) Restructured Extended Executor
d) None of the above
Answer: c) Restructured Extended Executor.
Explanation: REXX is an interpreted high-level programming language that was developed by IBM in the late 1970s.
2. Which of the following is not a REXX built-in function?
a) SUBSTR
b) POS
c) ADD
d) LENGTH
Answer: c) ADD.
Explanation: The REXX built-in functions include SUBSTR, POS, and LENGTH, among others.
ADD is not a REXX built-in function.
3. What is the default delimiter in REXX?
a) Comma (,)
b) Semicolo (;)
c) Space
d) Tab
Answer: c) Space.
Explanation: The default delimiter in REXX is a space.
However, other delimiters can also be specified using the DELIMITERS keyword.
4. Which of the following is not a valid REXX comment?
a) /* This is a comment /
b) / This is a comment
c) * This is a comment *
d) // This is a comment
Answer: b) /* This is a comment.
Explanation: REXX comments can be written using two different formats: /* .
.
.
*/ and — .
.
.
–.
The other two options are also valid REXX comments.
5. Which REXX keyword is used to terminate a DO loop?
a) END
b) ENDDO
c) DOEN
d) None of the above
Answer: b) ENDDO.
In REXX, a DO loop is terminated using the ENDDO keyword.
6. Which of the following is not a valid REXX variable name?
a) MY_VAR
b) 123_VAR
c) MY_VAR_1
d) MY-VAR
Answer: b) 123_VAR
Explanation: In REXX, variable names must start with a letter and can contain letters, digits, and underscores.
Variable names cannot start with a digit or contain special characters such as hyphens.
7. Which REXX keyword is used to exit from a loop?
a) STOP
b) EXIT
c) BREAK
d) QUIT
Answer: b) EXIT.
Explanation: The EXIT keyword is used to exit from a loop in REXX.
8. What is the function of the REXX INTERPRET statement?
a) To execute a command or a series of commands
b) To pause the execution of a program
c) To terminate the execution of a program
d) None of the above
Answer: a) To execute a command or a series of commands.
Explanation: The REXX INTERPRET statement is used to execute a command or a series of commands that are stored in a string variable
9. Which of the following REXX instructions is used to read data from a file?
a) READ
b) GET
c) INPUT
d) None of the above
Answer: c) INPUT.
Explanation: The INPUT instruction is used to read data from a file in REXX.
10. Which REXX keyword is used to define a subroutine?
a) PROCEDURE
b) SUBROUTINE
c) FUNCTION
d) None of the above
Answer: a) PROCEDURE.
Explanation: In REXX, a subroutine is defined using the PROCEDURE keyword, followed by the name of the subroutine and its parameters.
11. Which of the following is not a valid REXX comparison operator?
a) ==
b) !=
c) <=>
d) ===
Answer: c) <=>.
Explanation: REXX comparison operators include == (equality), = (not equal), > (greater than), < (less than), >= (greater than or equal to), and <= (less than or equal to).
The <=> operator is not a valid REXX comparison operator.
12. Which REXX keyword is used to define a function?
a) PROCEDURE
b) SUBROUTINE
c) FUNCTION
d) None of the above
Answer: c) FUNCTION.
Explanation: In REXX, a function is defined using the FUNCTION keyword, followed by the name of the function and its parameters.
13. Which REXX instruction is used to write data to a file?
a) WRITE
b) PUT
c) OUTPUT
d) None of the above
Answer: b) PUT.
Explanation: The PUT instruction is used to write data to a file in REXX.
14. Which of the following is not a valid REXX arithmetic operator?
a) +
b) –
c) *
d) /
Answer: d) /.
Explanation: REXX arithmetic operators include + (addition), – (subtraction), * (multiplication), and / (division).
15. Which of the following is not a valid REXX logical operator?
a) AND
b) OR
c) NOT
d) XOR
Answer: d) XOR.
Explanation: REXX logical operators include AND, OR, and NOT.
16. Which REXX keyword is used to include a file in a REXX program?
a) INCLUDE
b) IMPORT
c) REQUIRE
d) None of the above
Answer: a) INCLUDE.
Explanation: The INCLUDE keyword is used to include a file in a REXX program.
17. Which of the following is not a valid REXX string function?
a) UPPER
b) LOWER
c) LENGTH
d) SUBSTR
Answer: c) LENGTH.
Explanation: LENGTH is a REXX built-in function that returns the length of a string.
UPPER and LOWER are string functions that convert a string to uppercase or lowercase, respectively.
SUBSTR is a string function that returns a substring of a string.
18. Which of the following REXX instructions is used to allocate storage for a variable?
a) ALLOCATE
b) DEFINE
c) ADDRESS
d) None of the above
Answer: b) DEFINE.
Explanation: The DEFINE instruction is used to allocate storage for a variable in REXX.
19. Which REXX keyword is used to specify the end of a REXX program?
a) END
b) FINISH
c) TERMINATE
d) None of the above
Answer: a) END.
Explanation: The END keyword is used to specify the end of a REXX program.
20. Which of the following is not a valid REXX stem variable?
a)
1
b)
2
c)
3
d) MYSTEM[4]
Answer: d) MYSTEM[4].
Explanation: REXX stem variables are used to store arrays of data, and they are identified by a common stem name followed by a period and a subscript.
Square brackets are not used to access elements of a REXX stem variable.
21. What is the function of the REXX ADDRESS instruction?
a) To specify the address of a variable
b) To specify the address of a subroutine
c) To specify the address of a file
d) None of the above
Answer: c) To specify the address of a file.
Explanation: The REXX ADDRESS instruction is used to specify the address of a file, allowing REXX to read from or write to the file.
22. Which of the following REXX instructions is used to allocate storage for an array?
a) DIMENSION
b) DEFINE
c) ARRAY
d) None of the above
Answer: b) DEFINE.
Explanation: The DEFINE instruction is used to allocate storage for a variable in REXX, including arrays.
23. Which REXX keyword is used to call a subroutine?
a) CALL
b) PERFORM
c) SUBROUTINE
d) None of the above
Answer: b) PERFORM.
Explanation: The PERFORM keyword is used to call a subroutine in REXX.
24. Which REXX keyword is used to create a loop in a REXX program?
a) LOOP
b) DO
c) WHILE
d) None of the above
Answer: b) DO.
Explanation: The DO keyword is used to create a loop in a REXX program.
25. Which of the following is not a valid REXX string function?
a) INDEX
b) VERIFY
c) SUBSTITUTE
d) SORT
Answer: d) SORT.
Explanation: SORT is not a valid REXX string function.
INDEX is a string function that returns the position of a substring in a string.
VERIFY is a string function that returns the position of the first character in a string that is not in a specified set of characters.
SUBSTITUTE is a string function that replaces one substring with another in a string.
26. Which REXX keyword is used to define a label in a REXX program?
a) LABEL
b) GOTO
c) TAG
d) None of the above
Answer: a) LABEL.
Explanation: The LABEL keyword is used to define a label in a REXX program.
27. Which of the following REXX instructions is used to remove a variable from memory?
a) DELETE
b) REMOVE
c) ERASE
d) None of the above
Answer: c) ERASE.
Explanation: The ERASE instruction is used to remove a variable from memory in REXX.
28. Which REXX keyword is used to terminate a loop in a REXX program?
a) END
b) STOP
c) QUIT
d) None of the above
Answer: b) STOP.
Explanation: The STOP keyword is used to terminate a loop in a REXX program.
29. Which of the following REXX instructions is used to display output on the screen?
a) PRINT
b) SAY
c) WRITE
d) None of the above
Answer: b) SAY.
Explanation: The SAY instruction is used to display output on the screen in REXX.
30. Which REXX keyword is used to define a variable as global?
a) GLOBAL
b) EXPOSE
c) PUBLIC
d) None of the above
Answer: b) EXPOSE.
Explanation: The EXPOSE keyword is used to define a variable as global in REXX.
31. Which REXX keyword is used to test whether a variable exists?
a) IF
b) SELECT
c) EXISTS
d) None of the above
Answer: c) EXISTS.
Explanation: The EXISTS keyword is used to test whether a variable exists in REXX.
32. Which of the following REXX instructions is used to create a new file?
a) CREATE
b) NEW
c) OPEN
d) None of the above
Answer: c) OPEN.
Explanation: The OPEN instruction is used to create a new file in REXX.
33. Which REXX keyword is used to conditionally execute a block of code?
a) IF
b) DO
c) WHILE
d) None of the above
Answer: a) IF.
Explanation: The IF keyword is used to conditionally execute a block of code in REXX.
34. Which of the following REXX instructions is used to write data to a file?
a) WRITE
b) PUT
c) OUTPUT
d) None of the above
Answer: b) PUT.
Explanation: The PUT instruction is used to write data to a file in REXX.
35. Which REXX keyword is used to exit a program?
a) END
b) STOP
c) QUIT
d) None of the above
Answer: c) QUIT.
Explanation: The QUIT keyword is used to exit a program in REXX.
36. Which of the following REXX instructions is used to close a file?
a) CLOSE
b) END
c) QUIT
d) None of the above
Answer: a) CLOSE.
Explanation:The CLOSE instruction is used to close a file in REXX.
37. Which REXX keyword is used to define a function in a REXX program?
a) FUNCTION
b) SUBROUTINE
c) PROCEDURE
d) None of the above
Answer: a) FUNCTION.
Explanation: The FUNCTION keyword is used to define a function in a REXX program.
38. Which of the following REXX instructions is used to truncate a file?
a) TRUNCATE
b) SHORTEN
c) TRIM
d) None of the above
Answer: a) TRUNCATE.
Explanation: The TRUNCATE instruction is used to truncate a file in REXX.
39. Which REXX keyword is used to test whether a string is numeric?
a) NUMERIC
b) ISNUMERIC
c) TESTNUM
d) None of the above
Answer: a) NUMERIC.
Explanation: The NUMERIC keyword is used to test whether a string is numeric in REXX.
40. Which of the following REXX instructions is used to read a line from the console?
a) READ
b) GETLINE
c) INPUT
d) None of the above
Answer: b) GETLINE.
Explanation:The GETLINE instruction is used to read a line from the console in REXX.
41. Which REXX keyword is used to test whether a variable is null?
a) NULL
b) ZERO
c) BLANK
d) None of the above
Answer: c) BLANK.
Explanation: The BLANK keyword is used to test whether a variable is null in REXX.
42. Which of the following REXX instructions is used to read a character from the console?
a) READ
b) GETC
c) INPUT
d) None of the above
Answer: b) GETC.
Explanation: The GETC instruction is used to read a character from the console in REXX.
43. Which of the following REXX instructions is used to replace a string in a file?
a) REPLACE
b) SUBSTR
c) OVERLAY
d) None of the above
Answer: a) REPLACE.
Explanation: The REPLACE instruction is used to replace a string in a file in REXX.
44. Which REXX keyword is used to allocate storage space for a variable?
a) NEW
b) STORAGE
c) ALLOCATE
d) None of the above
Answer: c) ALLOCATE.
Explanation: The ALLOCATE keyword is used to allocate storage space for a variable in REXX.
45. Which of the following REXX instructions is used to delete a file?
a) DELETE
b) REMOVE
c) ERASE
d) All of the above
Answer: d) All of the above.
Explanation: The DELETE, REMOVE, and ERASE instructions are all used to delete a file in REXX.
46. Which REXX keyword is used to test whether a variable is a stem?
a) STEM
b) ISSTEM
c) TESTSTEM
d) None of the above
Answer: a) STEM.
Explanation: The STEM keyword is used to test whether a variable is a stem in REXX.
47. Which of the following REXX instructions is used to append data to a file?
a) APPEND
b) WRITE
c) PUT
d) None of the above
Answer: a) APPEND.
Explanation: The APPEND instruction is used to append data to a file in REXX.
48. Which REXX keyword is used to perform bitwise operations?
a) BIT
b) MASK
c) BINARY
d) None of the above
Answer: a) BIT.
Explanation: The BIT keyword is used to perform bitwise operations in REXX.
49. Which of the following REXX instructions is used to create a directory?
a) MKDIR
b) CREATEDIR
c) NEWDIR
d) None of the above
Answer: a) MKDIR.
Explanation: The MKDIR instruction is used to create a directory in REXX.
50. Which REXX keyword is used to test whether a variable is a whole number?
a) INTEGER
b) WHOLE
c) NUMBER
d) None of the above
Answer: a) INTEGER.
Explanation: The INTEGER keyword is used to test whether a variable is a whole number in REXX.
51. Which of the following REXX instructions is used to retrieve the value of a variable?
a) GET
b) VALUE
c) RETRIEVE
d) None of the above
Answer: b) VALUE.
Explanation: The VALUE instruction is used to retrieve the value of a variable in REXX.
52. Which REXX keyword is used to test whether a variable is a string?
a) STRING
b) CHAR
c) TYPE
d) None of the above
Answer: a) STRING.
Explanation: The STRING keyword is used to test whether a variable is a string in REXX.
53. Which of the following REXX instructions is used to display output to the console?
a) DISPLAY
b) PUT
c) WRITE
d) All of the above
Answer: d) All of the above.
Explanation: The DISPLAY, PUT, and WRITE instructions can all be used to display output to the console in REXX.
54. Which REXX keyword is used to concatenate strings?
a) CONCAT
b) CAT
c) STRCAT
d) None of the above
Answer: b) CAT.
Explanation: The CAT keyword is used to concatenate strings in REXX.
REXX is a powerful and versatile programming language that can be used for a wide range of applications. By testing your knowledge with these REXX MCQ Questions and answers, you can deepen your understanding of this language and develop your skills as a programmer. Keep following our Freshesnow portal regularly to get latest technical quizzes.