View previous topic :: View next topic |
Author |
Message |
wdnealis Beginner
Joined: 17 Jan 2006 Posts: 25 Topics: 4
|
Posted: Tue Sep 29, 2009 10:52 pm Post subject: REXX Multiple Results on one line. |
|
|
How can I write multiple values on the same line in the output file?
For example, when I search for a value, how can I get the memeber name and the results on the same line of an output file?
i.e.
MEMBER01= PROGRM01
MEMBER02= PROGRM02
MEMBER03= PROGRM03
MEMBER04= PROGRM04
Is this possible?
What I have not is:
___________________ Code: |
PULL STR2FND
STR2FND = "PROGRAM-ID."
*/
SAY "SEARCHING " PDSNAME
SAY "FOR STRING <" STR2FND ">"
CALL OUTTRAP "MBRS."
"LISTD" PDSNAME "MEMBERS"
CALL OUTTRAP "OFF"
LOT.1="------------------------------------------------"
LOT.2="--- SEARCHING " PDSNAME " FOR STRING <" STR2FND ">"
LOT.3="------------------------------------------------"
LOT.0=3
"EXECIO" LOT.0 "DISKW XXOUT (STEM LOT."
DO CURMBR = NDX TO MBRS.0
PARSE VALUE MBRS.CURMBR WITH MEMNAME
MEMNAME=STRIP(MEMNAME)
HDR=1
SAY "MEMBER="FULLNAME"("MEMNAME")"
"ALLOC F(XXIN) DS('"FULLNAME"("MEMNAME")') SHR REUSE"
"EXECIO * DISKR XXIN (FINIS STEM IN."
"FREE F(XXIN)"
FND=0
DO RECID=1 TO IN.0
IF POS(STR2FND,IN.RECID) > 0 THEN
DO
IF HDR = 1 THEN
DO
LOT.1="------------------------------------------------"
LOT.2="----> " MEMNAME " HAS THE STRING <" STR2FND ">"
LOT.3 = IN.RECID
LOT.0=3
"EXECIO" LOT.0 "DISKW XXOUT (STEM LOT."
HDR=0
END
LOT.1 = IN.RECID
LOT.0=1
END
END
END
"EXECIO" LOT.0 "DISKW XXOUT (STEM LOT."
"EXECIO 0 DISKW XXOUT (FINIS"
"FREE F(XXOUT)"
EXIT 0
**************************************
RESULTS:
-- SEARCHING 'MY.TEST.PDS' FOR STRING < PROGRAM-ID. >
-----------------------------------------------
-----------------------------------------------
---> MEMBER01 HAS THE STRING < PROGRAM-ID. >
00200 PROGRAM-ID. PROGRM01.
-----------------------------------------------
---> MEMBER02 HAS THE STRING < PROGRAM-ID. >
00200 PROGRAM-ID. PROGRM02.
-----------------------------------------------
---> MEMBER03 HAS THE STRING < PROGRAM-ID. >
00200 PROGRAM-ID. PROGRM03.
-----------------------------------------------
---> MEMBER04 HAS THE STRING < PROGRAM-ID. >
00200 PROGRAM-ID. PROGRM04.
-----------------------------------------------
|
|
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Wed Sep 30, 2009 1:29 pm Post subject: |
|
|
Just using Rexx, save all your resul members in a stem and when the loop
has completed, create and write your output lines _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
wdnealis Beginner
Joined: 17 Jan 2006 Posts: 25 Topics: 4
|
Posted: Sun Oct 04, 2009 9:03 pm Post subject: |
|
|
No, I'm looking to strip the results and add a value when the string is found to generate a report.
I'm also looking to search for multiple values. |
|
Back to top |
|
 |
wdnealis Beginner
Joined: 17 Jan 2006 Posts: 25 Topics: 4
|
Posted: Sun Oct 04, 2009 9:07 pm Post subject: |
|
|
Nic Clouston wrote: | Just using Rexx, save all your resul members in a stem and when the loop
has completed, create and write your output lines |
Not that familiar with REXX, I know that I can use it to read the PDS, but not certain about saving all the results in the STEM.
I was able to display multiple values on the screen, but when I tried adding multiple values to to the EXECIO I got an error. |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Mon Oct 05, 2009 12:04 pm Post subject: |
|
|
here is an outline of what to do...
Code: |
i = 0
start of loop
do work
if result is to be saved
Then Do
i = i + 1
save_stem.i = result to save
End
end loop
save_stem.0 = i
|
then
Code: |
output_line = ''
do i = 1 to save_stem.0
output_line = output_line save_stem.i
end
|
then
output your ouput_line _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
|
|