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
Enlist the features of rexx as a programming language.
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?
why is there no os/2 (ecs) port of oorexx?
how to pass parms to ispf edit macro?
I have one input file and some 40 tables, I want to read input file and compare the input file value with the table value if it is present then we have to update with new value, this should be repeated for all 40 tables and we are reading only one input file, for this is there any REXX program or job or routine to accomplish above requirement. components of the requirements; 1. One input file 2. 40 DB2 tables 3. we have to read from the input file and compare with table value, if present then update with new value (this should be recurssive for all 40 tables for every record of input file). 4. quick help is appreciated.
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?
How to code the db2 queries using rexx, and also plz send some link and examples using db2 queries?
how to access data in control blocks such as jobname?
Is it possible to combine uni-rexx with a compiled language in any application? What applications interfaces are there?
does uni-rexx give me any capabilities designed specifically for the unix environment?
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
What does the sample library of uni-rexx consist of?
what would I use uni-rexx for?
How to run my rexx exec?