I think this is the shortest sample I can come up with. It generates first or 
next membername for the day, then edits that member using itself as edit macro. 
The edit macro part copies the template and saves the member. Remove the 
'CANCEL' command to stay in edit.
The command can be executed from a dataset list, or from a member list.
You must of course change the 'your.template.lib' to your own library.
/*                                                            rexx  
*/                                                                  
 Address Isredit "MACRO PROCESS (PRM)"                              
 if rc=0 then exit EditMac()         /* edit macro */               
                                                                    
 chrl='?ABCDEFGHIJKLMNOPQRSTUVWXYZ'                                 
 parse source @sys @what @me @ddn @where .                          
                                                                    
 /* get dsn from parm */                                            
 parse value translate(arg(1)," ","'()") with dsn .                 
                                                                    
 /* get member list using TSO services */                           
 zz=outtrap('mbl.')                                                 
 "listds '"dsn"' members"                                           
 zz=outtrap('off')                                                  
                                                                    
 /* Locate previous members with date, member base is Dyymmdd */    
 mbrb='D'substr(date('s'),3)                                        
 do n=mbl.0 to 7 by -1 until left(mbr,7)=mbrb                       
   mbr=strip(mbl.n)                                                 
 end                                                                
 if left(mbr,7)=mbrb then c=right(mbr,1)  /* found one         */   
 else c='?'                               /* 1st of day, use A */   
 mbr=mbrb||substr(chrl,pos(c,chrl)+1,1)   /* make new mbrname  */   
                                                                    
 /* edit (create) new member, using self as macro */                
 Address ispexec "Edit dataset('"dsn"("mbr")') macro("@me")"        
 exit 0                                                             
                                                                    
/* Here is the inline edit macro */                                 
EditMac:                                                            
 Address Isredit                                                    
 "(ds)=dataset"                                                     
 "(mb)=member "                                                     
 /* Get template */                                                 
 "Copy 'your.template.lib(TEMPLATE)' after .zf"  /* insert after first */ 
 /* save and quit */                                                
 "save"                                                             
 "cancel"        /* to avoid any prompts */                         
 exit 0

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to