Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
EDITING A DATASET IN BACKGROUND

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
jz1b0c

Active User


Joined: 25 Jan 2004
Posts: 180
Location: Toronto, Canada

PostPosted: Sat Feb 25, 2006 3:18 am    Post subject: EDITING A DATASET IN BACKGROUND
Reply with quote

I actually need to use

" c all a123 b123" in the background for all the members of a pds

I have the macro's but what I really need to know use where should I code a macro.

ISREDIT macro & my rexx do they both reside in the same member of a pds or should they be kept separately

please provide an example.
Back to top
View user's profile Send private message
References
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 1956
Location: Israel

PostPosted: Sat Feb 25, 2006 3:20 am    Post subject:
Reply with quote

No. Your edit macro is a separated REXX exec (executing Edit commands). Then you have a "regular" REXX, which read the PDS and EDIT each member with the MACRO parameter. In this parametr, you supply the name of your edit macro.

O.
Back to top
View user's profile Send private message
jz1b0c

Active User


Joined: 25 Jan 2004
Posts: 180
Location: Toronto, Canada

PostPosted: Sat Feb 25, 2006 3:22 am    Post subject: Re: EDITING A DATASET IN BACKGROUND
Reply with quote

Could you please provide me a live example, on this?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 1956
Location: Israel

PostPosted: Sat Feb 25, 2006 3:57 am    Post subject:
Reply with quote

OK, This is just a copy of another post, but anyway.

1) This is the REXX code:
Code:
/*------------------------------- REXX ------------------------------- 
 * PROGRAM   : C@ALL                                                   
 * FUNCTION  : An example of how to run an edit-macro against all       
 *           : members of PDS.                                         
 * AUTHOR    : OFER                                                     
 * DATE      : 28/03/04                                                 
 * HOW TO USE:                                                         
 *           :                                                         
 *------------------------------------------------------------------*/ 
                                                                       
ARG PDS .                                                               
                                                                       
MAC  = 'TEMPMAC'                               /* Macro name          */
                                                                       
PDS = "'"STRIP(PDS,"B","'")"'"                                         
                                                                       
X = OUTTRAP("LIBMEM.")                         /* Trap output of TSO  */
 ADDRESS TSO "LISTDS "PDS" M"                                           
X = OUTTRAP("OFF")                                                     
                                                                       
PDS = STRIP(PDS,"B","'")                                               
                                                                       
DO I = 7 TO LIBMEM.0                                                   
  LIBMEM.I = STRIP(LIBMEM.I)                   /* Member name         */
  ADDRESS ISPEXEC "EDIT DATASET ('"PDS"("LIBMEM.I")') MACRO ("MAC")"   
  SAY I RC LIBMEM.I                                                     
END                                                                     
                                                                       
EXIT                                                                   
                       


In the above code, I read the PDS member by member, and for each member I isuue the EDIT command with the MACRO parameter. That means, that for each member edited, the macro TEMPMAC will be invoked.

2) TEMPMAC is just an edit macro, for example, here is a macro that return the number of times the word ADABAS appears in the member:
Code:
/* REXX */
 
ADDRESS ISREDIT "MACRO PROCESS"
ADDRESS ISREDIT "FIND 'ADABAS' ALL"
ADDRESS ISREDIT "(TOT1,TOT2) = FIND_COUNTS"
 
ADDRESS ISREDIT "END"
 
EXIT TOT1 + 0


Never forget the END command, when editing multiple members!!!

I hope this time I was more clear.

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