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:
Member2:
Member3:
PS file:
Updated members of the PDS should look like below:
Member1:
Member2:
Member3:
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.
/* 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