MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

REXX Multiple Results on one line.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
wdnealis
Beginner


Joined: 17 Jan 2006
Posts: 25
Topics: 4

PostPosted: Tue Sep 29, 2009 10:52 pm    Post subject: REXX Multiple Results on one line. Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Sep 29, 2009 11:23 pm    Post subject: Reply with quote

wdnealis,


I think IDPFX option on batch version 3.15 would give you the desired results.

take a look at this topic

http://www.mvsforums.com/helpboards/viewtopic.php?t=8786&highlight=idpfx

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Wed Sep 30, 2009 1:29 pm    Post subject: Reply with quote

Just using Rexx, save all your resul members in a stem and when the loop
Code:

DO RECID=1 TO IN.0

has completed, create and write your output lines
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
wdnealis
Beginner


Joined: 17 Jan 2006
Posts: 25
Topics: 4

PostPosted: Sun Oct 04, 2009 9:03 pm    Post subject: Reply with quote

kolusu wrote:
wdnealis,


I think IDPFX option on batch version 3.15 would give you the desired results.

take a look at this topic

http://www.mvsforums.com/helpboards/viewtopic.php?t=8786&highlight=idpfx

Kolusu



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
View user's profile Send private message
wdnealis
Beginner


Joined: 17 Jan 2006
Posts: 25
Topics: 4

PostPosted: Sun Oct 04, 2009 9:07 pm    Post subject: Reply with quote

Nic Clouston wrote:
Just using Rexx, save all your resul members in a stem and when the loop
Code:

DO RECID=1 TO IN.0

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
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Mon Oct 05, 2009 12:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group