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
What does the sample library of uni-rexx consist of?
What is the difference between ooRexx and IBM's Object REXX for Windows?
how to access data held on the jes spool?
is oorexx compatible with ibm object rexx?
Enlist the features of rexx as a programming language.
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.
is oorexx compatible with rexx?
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.)
How to find or access the current level of a gdg?
What is the use of uni-rexx?
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.
can I port my existing applications from the mainframe or os/2? Will there be extensive changes required to do this?
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?
How to code the db2 queries using rexx?
Is it possible to combine uni-rexx with a compiled language in any application? What applications interfaces are there?