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


Please Help Members By Posting Answers For Below Questions

What does the sample library of uni-rexx consist of?

607


What is the difference between ooRexx and IBM's Object REXX for Windows?

543


how to access data held on the jes spool?

661


is oorexx compatible with ibm object rexx?

626


Enlist the features of rexx as a programming language.

623






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.

5133


is oorexx compatible with rexx?

570


I want to open particular list of members inside pds.Let me know whether below code will work.if not tell me how it works INPUT='DDM.DATASET(AAA*)' X = OUTTRAP(MEMS.)

2792


How to find or access the current level of a gdg?

486


What is the use of uni-rexx?

549


I want to set position for a particular text in a certain position in several of my cics maps.Please provide me with a solution. Ex: If "F1-Help" has to be set to pos(4,27) always in all the maps within a PDS.

1944


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

578


Can I combine uni-REXX with a compiled language in my application? What application programming interfaces are available? For example, can I share variables between uni-REXX and a compiled language?

543


How to code the db2 queries using rexx?

582


Is it possible to combine uni-rexx with a compiled language in any application? What applications interfaces are there?

548