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

Is it possible to port existing applications from the mainframe or os/2? Are there major changes required to do this?

1 Answers  


what is uni-rexx?

1 Answers   IBM,


I want to remove a duplicates form a given input field using rexx program. please Any one help me out to solve this ... Thanks in Advance.

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

1 Answers  


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

1 Answers   IBM,


why is there no os/2 (ecs) port of oorexx?

1 Answers   IBM,


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

1 Answers   IBM,


I'm new to rexx. 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.

1 Answers  


How do I Run My Rexx Exec.?

2 Answers  


What are the functions available in rexx?

1 Answers  


What are the various error conditions seen in rexx?

1 Answers  


What do unusual return codes such as -3 and 0196 mean?

2 Answers  


Categories