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

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?

0 Answers   IBM,


I executed one job and I forget to save the final JCL. But took an XDC from SPOOL. Now I want to recover the JCL from XDC dataset. Is there any process to do this?. (Manually it takes a lot of time). Is there

0 Answers  


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

2 Answers  


what is uni-rexx?

0 Answers   IBM,


how long does the install of oorexx take?

0 Answers   IBM,






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  


Enlist the features of rexx as a programming language.

0 Answers  


How to code the db2 queries using rexx?

0 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  


what would I use uni-rexx for?

0 Answers   IBM,


I am tryin to select one records(SQL) using Rexx.Here is the code ADDRESS DSNREXX "EXECSQL FETCH C1 USING DESCRIPTOR :TBSQLDA" IF SQLCODE = 0 THEN DO LINE = '' DO I = 1 TO TBSQLDA.SQLD LINE = LINE TBSQLDA.I.SQLDATA END I SAY LINE END ADDRESS DSNREXX "EXECSQL CLOSE C1" ADDRESS DSNREXX 'DISCONNECT' i am getting the following errors and also i dont know wr to see the ouput.Can anyone please hlep me in solving this? 28 +++ ADDRESS DSNREXX 'DISCONNECT' Error running DB2REXX, line 28: Incomplete DO/SELECT/IF

2 Answers   Syntel,


does uni-rexx give me any capabilities designed specifically for the unix environment?

0 Answers   IBM,


Categories