REXX Programming Fundamentals
Test your knowledge of REXX programming language including variables, string functions, parsing operations, and mainframe dataset interactions.
Questions
SAY "HELLO" "THERE" SAY "HELLO" || "THERE Result? HELLO THERE HELLOTHERE
- True
- False
NAME1 = "JHON" NAME2 = " JHON " IF NAME1 == NAME2 THEN SAY " MATCHED " ELSE SAY " NOT MATCHED " Result: NOT MATCHED
- True
- False
INPUT_STRING = "HOW ARE YOU" PARSE VAR INPUT_STRING ONE TWO THREE
- ONE = " " ; TWO = "HOW" ; THREE = "ARE YOU"
- ONE = "HOW" ; TWO = "ARE"; THREE = "YOU"
- ONE = "HOW ARE YOU" ; TWO = NULL ; THREE = NULL
- ONE = " " ; TWO = "HOW" ; THREE = "ARE"
PARSE VALUE "THIS IS A SAMPLE" WITH B A C D WHAT IS THE VALUE OF C?
- THIS
- IS
- A
- SAMPLE
%MYPRINT MEMORIAL DRIVE CAMBRIDGE ------------------------------------ /REXX/ PARSE UPPER ARG LASTN . SAY LASTN -------------------------------------- RESULT?
- MEMORIAL
- DRIVE
- MEMORIAL DRIVE CAMBRIDGE
- CAMBRIDGE
%MYPRINT MEMORIAL DRIVE CAMBRIDGE ------------------------------------ /REXX/ PARSE UPPER ARG LASTN FIRSTN SAY FIRSTN -------------------------------------- RESULT?
- MEMORIAL
- DRIVE CAMBRIDGE
- DRIVE
- CAMBRIDGE
%MYPRINT ABCDEFGHIJKLMNOP ------------------------------------ /*REXX */ PARSE ARG 1 VAR1 5 7 VAR2 9 -------------------------------------- RESULT?
- VAR1 = ABCDE ; VAR2 = GHE
- VAR1 = ABCD ; VAR2 = GH
- VAR1 = ABCDE ; VAR2 = GHIJKLMNOP
- VAR1 = ABCDEFG; VAR2 = HI
SIGL instruction ?
- set to the line number of the REXX program from which the transfer of Control statment
- set to the command of the REXX program causes error
- set to the subroutine name of the REXX program causes error
- set to the return code that was set by an environment command
Pick the REXX reserved variables from the following list?
- RC
- RESULT
- ADDRESS
- SIGL
SAY VERIFY('SUSAN','ABNTUSV') result : 0
- True
- False
SAY TRUNC(1234.5,3) Result:
- 1234.5
- 1234.500
- 123
- 234
SYSDSN(dataset name) instruction helps to ?
- Defines the dataset name in system Catalog
- Uncatalog the dataset name given
- Tells if a dataset name exists
- none
NEW_STRING = STRIP(' MUCH BLANK SPACE ',B) SAY NEW_STRING
- " MUCH BLANK SPACE "
- " MUCH BLANK SPACE"
- "MUCH BLANK SPACE "
- "MUCH BLANK SPACE"
CALL LISTDSI dataset name?
- Retrieves complete information about dataset name
- Retrivess list of dataset names similar to the given dataset name
- Retrives RACF details of dataset name
- Retrives the attributes of a dataset
say FORMAT(123.45,5,3)?
- " 123.450"
- "123.45"
- "00123.450"
- "00123.45"
say FIND ('MARY HAD A LITTLE LAMB)','A LITTLE LAMB')
- 1
- 2
- 3
- 4
say C2X('A123')?
- C1F1F2F3
- A1010203
- A2010203
- C2010203
COMPARE ('APPLES', APPLESAUCE')?
- 7
- 8
- 9
- 10
PROCEDURE instruction: Makes all variables in the function/ subroutine as local variables
- True
- False
EXPOSE variable-1 ... varible-n
- Allow Variable-1 through variable-n to be shared with the main part of the program
- Used with the PROCEDURE instruction
- suppress Variable-1 through variable-n not to be share with main part of the program
- All the above