Page 1 of 1

To update members of a PDS, by comparing values with PS file

PostPosted: Mon Feb 25, 2019 11:03 pm
by Akshata
I am trying to change the password value present every member of a PDS, with the new password value present in a PS file(by comparing Username value).
PDS members:

Member1:
Image

Member2:
Image

Member3:
Image

PS file:
Image

Updated members of the PDS should look like below:

Member1:
Image

Member2:
Image

Member3:
Image



Note:
• There is no specific length defined for any values present in PDS/PS file, only User name value can be used to compare.
• Only password value needs to be changed in each PDS member
• There nearly 500 members to be updated as part of this change.

Please suggest the way to perform this change.

Thanks in advance.

Re: To update members of a PDS, by comparing values with PS

PostPosted: Mon Feb 25, 2019 11:57 pm
by Terry Heinze
Please post your topic in an appropriate Forum. Maybe "CLIST & REXX"?

Re: To update members of a PDS, by comparing values with PS

PostPosted: Tue Feb 26, 2019 12:01 am
by enrico-sorichetti
since most of the answer will be among the lines ...
use a rexx edit macro and apply it to all the pds members

Re: To update members of a PDS, by comparing values with PS

PostPosted: Tue Feb 26, 2019 2:55 pm
by willy jensen
No standard utility to do this, but..
There are a couple of freewares to offload a pds to a sequential dataset, with IEBUPDTE ADD statements at the front of each member. PDSLOADW from CBTTAPE.ORG file 093 would be my suggestion.
As other have suggested perhaps an ISPF edit macro might be the simplest solution, here is a sample of mine:
/*                                                                 rexx  
  Run an ISPF Edit Macro against every member of named pds                
  Use from ISPF 3.4, or in batch as %thisname dsname                      
*/                                                                        
 Address Isredit "MACRO NOPROCESS (PRM)"                                  
 if rc=0 then Exit EditSect()                                            
 /* generate member list, run the edit macro against each */              
 parse source . . $me .                                                  
 arg dsn .                                                                
 zz=outtrap('lst.')                                                      
 "LISTDS" requote(dsn) "MEMBERS"                                          
 zz=outtrap('off')                                                        
 dsn = unquote(dsn)                                                      
 do n = 7 to lst.0                                                        
   Address ISPEXEC "EDIT DATASET('"dsn"("strip(lst.n)")') MACRO("$me")"  
 end                                                                      
 exit                                                                    
Requote: if arg(1)='' then return '';else return "'"Unquote(arg(1))"'"    
Unquote: return strip(space(translate(arg(1)," ","'")))                  
/* Edit macro section */                                                  
Editsect:                                                                
 Address Isredit                                                          
 "(ds)=dataset"                                                          
 "(mb)=member "                                                          
 "(l)= Line 1"                                                            
 l=strip(l,'t')                                                          
 /* do something to line 1 */                                            
 say ds mb 'line 1=' l                                                    
 "line 1 = (l)"                                                          
 "save"                                                                  
 "cancel"                                                                
 exit 0