Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

how to exec rexx for all member library in one exec?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
italo_pm

New User


Joined: 26 Mar 2015
Posts: 37
Location: Italy

PostPosted: Sat Apr 25, 2015 1:20 am    Post subject: how to exec rexx for all member library in one exec?
Reply with quote

hi all

i'm a problem with exec a rexx,

how to exec rexx for all members in library (100 members) and put output in sequential file?

actuality my rexx work fine for each member submit and create one output, but for 100 or 200 member i want exec once for all member and create one output in one sequential file for all member...


input member A

Code:
WIAX8 name lastname 3495555555 SI


output A

Code:
WIAX8 name lastname


input member B

Code:
APP2 name lastname 34988887555 SI


output B

Code:
APP2 name lastname


but i want for only once exec all member and create on output in one sequential file

in one output:

Code:
WIAX8 name lastname
APP2 name lastname



it's possible?? any sample please...

thanks
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Sat Apr 25, 2015 1:45 am    Post subject: Reply to: how to exec rexx for all member library in one exec?
Reply with quote

see here how to apply an edit macro to all the members of PDS
http://www.ibmmainframes.com/viewtopic.php?t=25947&highlight=

it is trivial to substitute the EDIT invocation with the invocation of a REXX script
Back to top
View user's profile Send private message
italo_pm

New User


Joined: 26 Mar 2015
Posts: 37
Location: Italy

PostPosted: Sat Apr 25, 2015 3:02 pm    Post subject:
Reply with quote

thanks for answer Enrico, it's all new for me...

i'm create this rexx

Code:
/* rexx */                                                               
/* get name owner from jobname in member*/                                     
say 'start rexx'                                                               
/*----------------------------------------------------------------------------*/
/* FILEINP = app name (member) it's parm in jcl */                             
/*----------------------------------------------------------------------------*/
address tso "execio * diskr fileinp (stem fileinp. finis"                       
 if rc>0 then exit 12                                                           
 out = 0                                                                       
do in=0 to fileinp.0                                                           
    IF substr(fileinp.in,1,3) = VFY THEN DO                                     
      owner = substr(fileinp.in,1,40)                                           
      out=out+1                                                                 
      filowner.out = 'OWNER Jobname: 'owner                                     
      filowner.0   = out                                                       
      say ' - OWNER Jobname:' owner                                             
    end                                                                         
end                                                                             
/*----------------------------------------------------------------------------*/


member WIAX8 input PAMR=WIAX8:

Code:
WIAX8P01  name lastname                  55555555 SI                     
WIAX8P02  name lastname 2                 33344454 SI


output with PAMR=WIAX8:

Code:
WIAX8P01  name lastname                                                   
WIAX8P02  name lastname 2                                                       


member WIAX10 input PAMR=WIAX10:

Code:
WIAX10P1  name lastname 1                222222222 SI                     
WIAX10P2  name lastname 2                77777777 SI


output with PAMR=WIAX10:

Code:
                                                                         
WIAX10P1  name lastname 1                                                       
WIAX10P2  name lastname 2                                                       


but now,

how to in one exec the rexx get input all members in library and create one output sequential

MY.LIBRARY.APP (100 members)
WIAX8
WIAX10
MILA1
MILB1

one output for all memebers

Code:
                                                                         
WIAX8P01  name lastname                                                         
WIAX8P02  name lastname 2                                                       
WIAX10P1  name lastname 1                                                       
WIAX10P2  name lastname 2                                                       
MILA1P01  name lastname                                                         
MILA1P02  name lastname 2                                                       
MILB10P1  name lastname 1                                                       
MILB10P2  name lastname 2                                                       


i'm create this rexx but i'm not sure work...

Code:
                                                                         
/* REXX */                                                                     
A = OUTTRAP('MEMBLIST.')                                                       
"LISTDS (MY.LIBRARY.APP) MEMBERS"                                               
A = OUTTRAP(OFF)                                                               
                                                                               
 DO i = 4 TO MEMBLIST.0                                                         
  MEMBER = STRIP(MEMBLIST.i)                                                   
   IF substr(MEMBER,1,8) = MEMBER THEN DO                                       
    "ALLOC FILE(MEMBER) DSNAME('"MY.LIBRARY.APP"("MEMBER")') SHR"               
       IF rc <> 0 THEN DO                                                       
         SAY 'Error read member' MY.LIBRARY.APP'('MEMBER')'                     
         EXIT                                                                   
       END                                                                     
         "EXECIO * DISKR MEMBER (STEM LINEA."                                   
                                                                               
          out = 0                                                               
          do in=0 to LINEA.0                                                   
            IF substr(LINEA.in,1,3) = VFY THEN DO                               
               owner = substr(LINEA.in,1,40)                                   
               out=out+1                                                       
               filowner.out = 'OWNER Jobname: 'owner                           
               filowner.0   = out                                               
               say ' - OWNER Jobname:' owner                                   
            end                                                                 
          end                                                                   
                                                                               
        SAY MEMBER 'elaborate'                                                 
        "EXECIO 0 DISKR MEMBER (FINIS"                                         
        "FREE FILE(MEMBER)"                                                     
        "EXECIO 1 DISKR MEMBER (STEM LISTA."                                   
   END                                                                         
 END                                                                           
                                                                               
 EXIT                                                                           


any ideas?

thanks again
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 988
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Mon Apr 27, 2015 8:54 pm    Post subject:
Reply with quote

First, I'd suggest you look at the contents of the memberlist. stem variables. Next, your code
Code:
DO i = 4 TO MEMBLIST.0                                                         
   MEMBER = STRIP(MEMBLIST.i)                                                   
    IF substr(MEMBER,1,8) = MEMBER THEN DO                                       

needs some thought. I don't think it's what you want.

memberlist.0 contains the number of line returned by OUTTRAP, so you need to loop through the memberlist. stem variable based on this count - but be aware that not all lines returned refer to members.

Garry
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Mon Apr 27, 2015 9:34 pm    Post subject: Reply to: how to exec rexx for all member library in one exec?
Reply with quote

1. I think you can eliminate the second EXECIO by combining with the first EXECIO (add the FINIS).

2. I think you can eliminate the third EXECIO altogether. It is destined to fail because you FREE the DD name just prior to it.

3. You have gathered your output in the filowner. stem, but you have not written it out yet. You need a new EXECIO that writes the stem.
Back to top
View user's profile Send private message
italo_pm

New User


Joined: 26 Mar 2015
Posts: 37
Location: Italy

PostPosted: Wed Apr 29, 2015 10:16 am    Post subject:
Reply with quote

thanks for answer , this is a code ...work fine

but I read your advice and suggestions

Code:
/* REXX */                                                             
/* dsn input */                                                         
   ARG mylib                                                           
/* create list members names */                                         
A = OUTTRAP('MEMBLIST.')                                               
"LISTDS '"mylib"' MEMBERS"                                             
A = OUTTRAP(OFF)                                                       
                                                                       
out = 0                                                                 
DO i = 7 TO memblist.0 /* start from record 7 */                       
   memberinp = STRIP(memblist.i)                                       
   /* open member */                                                   
   "ALLOC FILE(MEMBER) DSNAME('"mylib'('memberinp')'"') SHR"           
   IF rc <> 0 THEN DO                                                   
                                                                       
      SAY 'Error open memberinp' mylib'('memberinp')'                   
      EXIT                                                             
   END                                                                 
     "EXECIO * DISKR MEMBER (STEM LINEA." /* read emberinp */           
    SAY 'member name: 'memberinp 'elaborate'                           
 /* out = 0 */                                                         
    DO in=2 to linea.0 /* start record 2 */                             
      IF SUBSTR(linea.in,1,3) = 'VFY' THEN DO /* only VFY */           
      if substr(linea.in,1,4) = 'VFY=' then iterate  /* exclude VFY= */
         owner = SUBSTR(linea.in,5,51) /* record save */               
         out = out+1                                                   
         filowner.out = owner                                           
         filowner.0   = out                                             
         SAY ' - Owner:' owner                                         
      END                                                               
   END                                                                 
                                                                       
   "EXECIO 0 DISKR MEMBER (FINIS" /* close memberinp elaborate */       
   "FREE FILE(MEMBER)"                                                 
END                                                                     
                                                                       
"EXECIO * DISKW FILOWNER (FINIS STEM FILOWNER."                         
    SAY 'last: 'memberinp 'elaborate'                                   
    SAY 'records out: 'out /* total records */                         
                                                                       
 EXIT


MY.LIBRARY (100 members)
WIAX8
WIAX10
MILA1
MILB1

one output for all members

Code:
WIAX8P01  name lastname                                                         
WIAX8P02  name lastname 2                                                       
WIAX10P1  name lastname 1                                                       
WIAX10P2  name lastname 2                                                       
MILA1P01  name lastname                                                         
MILA1P02  name lastname 2                                                       
MILB10P1  name lastname 1                                                       
MILB10P2  name lastname 2


thanks again for all.
Back to top
View user's profile Send private message
italo_pm

New User


Joined: 26 Mar 2015
Posts: 37
Location: Italy

PostPosted: Mon May 04, 2015 11:18 am    Post subject: Reply to: how to exec rexx for all member library in one exec?
Reply with quote

hi everyone, i'm extract record interesting... then modified records, now, how to insert a new record into the members??

first delete old record?? and after insert new record when only find VFY rule , but how to read all record for each name app... in my output app name is from colum 1 to colum 5 (not for all member)...

any ideas or suggestions please.

thanks

best regards.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm
No new posts Strange EXEC function call in z/VM Willy Jensen CLIST & REXX 3 Wed Oct 05, 2016 2:07 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us