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.



If there are a set of statements and each has a word "value" in it, If I want to display..

Answer / 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

More REXX Interview Questions

can I port my existing applications from the mainframe or os/2? Will there be extensive changes required to do this?

0 Answers   IBM,


what would I use uni-rexx for?

0 Answers   IBM,


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.

1 Answers  


how to pass parms to ispf edit macro?

0 Answers   IBM,


have you already used rexx - even for limited purposes? Do you need to maintain a high level of productivity during your transition to unix?

0 Answers   IBM,






Enlist the features of rexx as a programming language.

0 Answers  


How do I pass parms to my ISPF Edit macro

2 Answers   Wipro,


How to code the db2 queries using rexx?

0 Answers  


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??? I want code snippet or the coding for this , please

1 Answers  


can oorexx run ibm object rexx programs?

0 Answers   IBM,


does uni-rexx give me any capabilities designed specifically for the unix environment?

0 Answers   IBM,


How to run my rexx exec?

0 Answers  


Categories