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.
Answer Posted / sumanth toom
/**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)"
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
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?
I just know the Panvalet dataset name, i would like to search all the members of that dataset for particular keyword through Rexx. how to achive? please suggest. Is it possible to open panvalet member in browse mode using Rexx? Your help would be appreciated very much. Thanks in advance.
how to access data held on the jes spool?
for which platforms is uni-rexx available?
does uni-rexx give me any capabilities designed specifically for the unix environment?
Enlist the features of rexx as a programming language.
How to run my rexx exec?
have you already used rexx - even for limited purposes? Do you need to maintain a high level of productivity during your transition to unix?
is oorexx compatible with ibm object rexx?
What is the use of uni-rexx?
How to code the db2 queries using rexx?
how long does the install of oorexx take?
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?
What are various loop types supported by rexx?
how to access data in control blocks such as jobname?