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

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  


is oorexx compatible with ibm object rexx?

0 Answers   IBM,


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 , please

1 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???

1 Answers  


How do I access data in control blocks such as jobname?

1 Answers  






Can I cleanly uninstall oorexx?

0 Answers   IBM,


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

0 Answers   IBM,


I am new to rexx db2 ,can anyone help me by expalinin how to code the db2 queries using rexx,and also plz send some link and examples using db2 queries.

3 Answers  


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.

0 Answers  


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

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,


how to access data held on the jes spool?

0 Answers   IBM,


Categories