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
for which platforms is uni-rexx available?
what if I need to have the same application running on multiple platforms, such as unix and the mainframe? Does that mean I have to maintain two separate sources?
What are the functions available in rexx?
can I port my existing applications from the mainframe or os/2? Will there be extensive changes required to do this?
i want new rexx tool which will perform jcl chk without submitting it
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 code the db2 queries using rexx, and also plz send some link and examples using db2 queries?
is oorexx compatible with rexx?
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?
If I have limited experience with Rexx or it's been a long time since I've used it, what kind of help is available to get me started?
can oorexx run normal rexx programs?
How to find or access the current level of a gdg?
How to run my rexx exec?
why is there no os/2 (ecs) port of oorexx?
What is the difference between ooRexx and IBM's Object REXX for Windows?