IBM REXX Interview Questions And Answers
Download IBM REXX Interview Questions and Answers PDF
Enhance your IBM REXX interview preparation with our set of 12 carefully chosen questions. Each question is crafted to challenge your understanding and proficiency in IBM REXX. Suitable for all skill levels, these questions are essential for effective preparation. Don't miss out on our free PDF download, containing all 12 questions to help you succeed in your IBM REXX interview. It's an invaluable tool for reinforcing your knowledge and building confidence.
12 IBM REXX Questions and Answers:
IBM REXX Job Interview Questions Table of Contents:
1 :: How to access data held on the JES spool?
Held output (JES2 or JES3) can be captured by outtrapping
the output of the following command
"OUTPUT jobname PRINT(*) KEEP".
Use command HELP OUTPUT for more information.
Furthermore there are output tools you can buy like SDSF,
IOF, (E)JES, etc. But not all of these have got a rexx
interface.
Read Morethe output of the following command
"OUTPUT jobname PRINT(*) KEEP".
Use command HELP OUTPUT for more information.
Furthermore there are output tools you can buy like SDSF,
IOF, (E)JES, etc. But not all of these have got a rexx
interface.
2 :: How to access data in control blocks such as jobname?
Use the Storage() function to extract the data from control
blocks.
/* REXX Get taskname from TCB */
cvt = storage(10,4) /* FLCCVT-PSA data area */
tcbp = storage(d2x(c2d(cvt)),4) /* CVTTCBP */
tcb = storage(d2x(c2d(tcbp)+4),4)
tiot = storage(d2x(c2d(tcb)+12),4) /* TCBTIO */
say strip(storage(d2x(c2d(tiot)),8)) /* TIOCNJOB */
Read Moreblocks.
/* REXX Get taskname from TCB */
cvt = storage(10,4) /* FLCCVT-PSA data area */
tcbp = storage(d2x(c2d(cvt)),4) /* CVTTCBP */
tcb = storage(d2x(c2d(tcbp)+4),4)
tiot = storage(d2x(c2d(tcb)+12),4) /* TCBTIO */
say strip(storage(d2x(c2d(tiot)),8)) /* TIOCNJOB */
3 :: How to find or access the current level of a GDG?
You may use this
CALL BPXWDYN "ALLOC DD(ddn) SHR DSN('"gdg"(0)') RTDSN(GDGN)"
Afterwards GDGD contains the name of the actual gdg data
set.
Read MoreCALL BPXWDYN "ALLOC DD(ddn) SHR DSN('"gdg"(0)') RTDSN(GDGN)"
Afterwards GDGD contains the name of the actual gdg data
set.
4 :: How to Run My Rexx Exec?
Make sure the Exec starts with the /* REXX */ comment.
TSO EXEC 'hlq.your.dsn(member)' runs Rexx in exactly the
same way as it would a CLIST.
TSO EX yourlib(member) E uses a suffix of EXEC and the TSO
profile prefix to form a full DSN
of 'your_prefix.yourlib.EXEC(member)'
The SYSEXEC concatenation can be used to run execs using
TSO execname. The SYSPROC concatenation will do just as
well, but is really intended for CLISTS.
TSO %execname parameter_string allows you to pass a
parameter string to the exec, note that this string is only
a single argument, not multiple arguments as can be used
when calling from within an exec. The '%' instructs TSO to
not use loadlib concatenations when constructing the search
path.
For running Rexx in batch:
Create a batch environment for the Exec to run in with
PGM=IRXJCL, PGM=IKJEFT01 or PGM=IKJEFT1B
IRXJCL is a straight batch environment
IKJEFT01 and IKJEFT1B are the TSO in batch programs.
Put the Rexx exec libraries in the SYSEXEC DD
concatenation.
Call your exec via the PARM='yourprog' or as input in the
SYSTSIN DD
Read MoreTSO EXEC 'hlq.your.dsn(member)' runs Rexx in exactly the
same way as it would a CLIST.
TSO EX yourlib(member) E uses a suffix of EXEC and the TSO
profile prefix to form a full DSN
of 'your_prefix.yourlib.EXEC(member)'
The SYSEXEC concatenation can be used to run execs using
TSO execname. The SYSPROC concatenation will do just as
well, but is really intended for CLISTS.
TSO %execname parameter_string allows you to pass a
parameter string to the exec, note that this string is only
a single argument, not multiple arguments as can be used
when calling from within an exec. The '%' instructs TSO to
not use loadlib concatenations when constructing the search
path.
For running Rexx in batch:
Create a batch environment for the Exec to run in with
PGM=IRXJCL, PGM=IKJEFT01 or PGM=IKJEFT1B
IRXJCL is a straight batch environment
IKJEFT01 and IKJEFT1B are the TSO in batch programs.
Put the Rexx exec libraries in the SYSEXEC DD
concatenation.
Call your exec via the PARM='yourprog' or as input in the
SYSTSIN DD
5 :: Suppose i want to code a rexx program in order to get the inputfile and output files of jcl. i want code snippet or the coding for this?
If you know the ddnames of the files being used, then you
can get the infor via the LISTDSI function.
rc = LISTDSI( ddname "FILE")
If the rc = 0 then the dsname is in de variable SYSDSNAME.
If you do not know the ddnames of the files allocated to
your program, you can get the information via TSO with:
Address TSO "LISTA" or Address TSO "LISTA STATUS"
Set up OUTTRAP first so you can capture the output and via
REXX scroll through it.
The difference between LISTA and LISTA STATUS is that LISTA
will only give the datasetnames of all allocated datasets.
LISTA STATUS will give you the ddname followed by all
datasets that are allocated to the ddname for all the
datasets.
Read Morecan get the infor via the LISTDSI function.
rc = LISTDSI( ddname "FILE")
If the rc = 0 then the dsname is in de variable SYSDSNAME.
If you do not know the ddnames of the files allocated to
your program, you can get the information via TSO with:
Address TSO "LISTA" or Address TSO "LISTA STATUS"
Set up OUTTRAP first so you can capture the output and via
REXX scroll through it.
The difference between LISTA and LISTA STATUS is that LISTA
will only give the datasetnames of all allocated datasets.
LISTA STATUS will give you the ddname followed by all
datasets that are allocated to the ddname for all the
datasets.
6 :: i am getting error while editing macro, its not even entering into the macro, getting error like
31 *-* "EDIT DATASET(\"DSN"("MEM")) MACRO("CHGLINE")"
+++ RC(-3) +++? any idea
Why?
You must turn on ISPEXEC Address.
Address ISPEXEC "EDIT dataset(xx) macro(mmm)"
Read MoreAddress ISPEXEC "EDIT dataset(xx) macro(mmm)"
7 :: How to code rexx in jcl to read in a lpar
cpu usage file and select 1. date, time 2. some system names 3. cpu usage for each system. The input file has hourly reporting. The output file (CSV)is for excel use. Run in batch mode. Output in FB?
to get the system time and date , u can use following code
time = time()
date = date()
Read Moretime = time()
date = date()
8 :: Suppose If there are a set of statements and each has a word "value" in it, If I want to display all these statements so that the word "value" is aligned, then how do
I code this in REXX.
e.g - The value of X is Y.
Wot is its value?
Do u know its value?
I want to know its value?
/**REXX**/
ADDRESS TSO
"ALLOC DD(INP1) DA('input-dataset') SHR REUS"
"EXECIO * DISKR INP1 (STEM IN1. FINIS"
MAX_OFFSET = 0
INP_OFFSET = 0
DO I = 1 TO IN1.0
PARSE UPPER VAR IN1.I INP
INP_OFFSET = POS("VALUE",INP)
IF INP_OFFSET > MAX_OFFSET THEN
DO
MAX_OFFSET = INP_OFFSET
END
END
DO I = 1 TO IN1.0
PARSE UPPER VAR IN1.I INP
Z = POS("VALUE",INP)
SAY LEFT(SUBSTR(IN1.I,1,(Z - 1)),(MAX_OFFSET - 1))||,
SUBSTR(IN1.I,Z,20)
END
"FREE DD(INP1)"
Read MoreADDRESS TSO
"ALLOC DD(INP1) DA('input-dataset') SHR REUS"
"EXECIO * DISKR INP1 (STEM IN1. FINIS"
MAX_OFFSET = 0
INP_OFFSET = 0
DO I = 1 TO IN1.0
PARSE UPPER VAR IN1.I INP
INP_OFFSET = POS("VALUE",INP)
IF INP_OFFSET > MAX_OFFSET THEN
DO
MAX_OFFSET = INP_OFFSET
END
END
DO I = 1 TO IN1.0
PARSE UPPER VAR IN1.I INP
Z = POS("VALUE",INP)
SAY LEFT(SUBSTR(IN1.I,1,(Z - 1)),(MAX_OFFSET - 1))||,
SUBSTR(IN1.I,Z,20)
END
"FREE DD(INP1)"
9 :: I want to code a REXX Program in order to load many tables in a database simultaneously in a batch fashion. Currently batch codes ar available in which only one job is submitted at a time and this loads only one table. My requirement is that many tables should be loaded at a time when one Job is submitted and can this be done using REXX Tool?
Not exactly sure what you are asking.
Can a REXX exec submit multiple jobs via the internal
reader? Yes.
Can you update multiple tables in a RDBMS? Yes, however
referential integrity could be compromised and RDBMS
overhead could be a serious issue.
Let's assume that you have that you are seeking to load DB
tables from a 100K+ 1NF file which has some 6257 bytes per
recode You would use REXX (CMSPIPES) to split the file while
keeping a common key. You would split this 1nf record in 3nf
tables. You would need to know the data and some aspects on
how it will be used --- Remember Data Privacy is important too.
Read MoreCan a REXX exec submit multiple jobs via the internal
reader? Yes.
Can you update multiple tables in a RDBMS? Yes, however
referential integrity could be compromised and RDBMS
overhead could be a serious issue.
Let's assume that you have that you are seeking to load DB
tables from a 100K+ 1NF file which has some 6257 bytes per
recode You would use REXX (CMSPIPES) to split the file while
keeping a common key. You would split this 1nf record in 3nf
tables. You would need to know the data and some aspects on
how it will be used --- Remember Data Privacy is important too.
10 :: How to code the db2 queries using rexx, and also plz send some link and examples using db2 queries?
REXX doesn't have support to DB2. But still you can access
it thru some TSO CPs. One of the commercial CP is
REXXTOOLS/MVS. If your shop has that s/w installed you
could able to access DB2.
Read Moreit thru some TSO CPs. One of the commercial CP is
REXXTOOLS/MVS. If your shop has that s/w installed you
could able to access DB2.
11 :: How to pass parms to ISPF Edit macro?
On the command line in the editor, just use the name of the
macro and list the paramters behind it. E.g. if you have a
macro called FINDALL and it expects 3 parameters you would
specify in the commandline: FINDIT parm1 parm2 parm3
When you code the MACRO the first line should be like:
Address ISREDIT "MACRO (parm1 , parm2, parm3)".
Since you are working with REXX you could have used:
Address ISREDIT "MACRO ( parm )"
You then parse the parm like this:
Parse (UPPER) Arg parm parm1 parm2 parm3
Read Moremacro and list the paramters behind it. E.g. if you have a
macro called FINDALL and it expects 3 parameters you would
specify in the commandline: FINDIT parm1 parm2 parm3
When you code the MACRO the first line should be like:
Address ISREDIT "MACRO (parm1 , parm2, parm3)".
Since you are working with REXX you could have used:
Address ISREDIT "MACRO ( parm )"
You then parse the parm like this:
Parse (UPPER) Arg parm parm1 parm2 parm3
12 :: What do unusual return codes such as -3 and 0196 mean?
Basically they are either decimalised abend codes or
indicate a problem with the environment.
Read Moreindicate a problem with the environment.