/* DRCTLIST - create lists of unique users and profiles that need to */ /* be migrated to the system directory on the target system */ /* Runs on the target system */ /* input files */ /* Flat file copy of the source z/VM system's user directory */ SOURCEIN='SOURCE DIRECT A' /* Flat file copy of the target z/VM system's user directory */ TARGETIN='TARGET DIRECT A' /* output files */ /* List of user IDs that need to be migrated to the target system */ USERLIST='MIGRATE USERLST A' /* List of profiles that need to be migrated to the target system */ PROFLIST='MIGRATE PROFLST A' /* call CheckIp to verify that all inout files exist */ Call CheckIp /* erase the output files if they exist */ ADDRESS COMMAND 'ESTATE 'USERLIST If RC = 0 then 'Erase 'USERLIST ADDRESS COMMAND 'ESTATE 'PROFLIST If RC = 0 then 'Erase 'PROFLIST Say 'Processing Users' /* extract user names from new z/VM system's directory */ 'pipe < 'TARGETIN' | locate 1-5 /USER /', '| specs word 2 1 | sort | stem NUSERLST.' /* extract user names from source z/VM system's directory */ 'pipe < 'SOURCEIN' | locate 1-5 /USER /', '| specs word 2 1 | sort | stem PUSERLST.' Say 'Processing Profiles ' /* extract profile names from target z/VM system's directory */ 'pipe < 'TARGETIN' | locate 1-11 /PROFILE / | nlocate 1 /*/', '| specs word 2 1 | sort | stem NPROFLST.' /* extract profile names from source z/VM system's directory */ 'pipe < 'SOURCEIN' | locate 1-11 /PROFILE / | nlocate 1 /*/', '| specs word 2 1 | sort | stem PPROFLST.' Say 'Writing the User List' addctr=0 found=0 /* extract unique user IDs from the source z/VM system */ Do m = 1 to PUSERLST.0 Do x = 1 to NUSERLST.0 If NUSERLST.x =PUSERLST.m then found=1 End If found=0 then Do addctr=addctr+1 adduser.addctr=PUSERLST.m End found=0 End /* write the list of unique user IDs from the source z/VM */ /* system to the output file */ adduser.0=addctr 'pipe stem adduser. | >> 'USERLIST Say "File "USERLIST" has been created: "adduser.0" users were added" profctr=0 found=0 /* extract unique profile IDs from the source z/VM system */ Do m = 1 to PPROFLST.0 Do x = 1 to NPROFLST.0 If NPROFLST.x =PPROFLST.m then found=1 End If found=0 then Do profctr=profctr+1 addprof.profctr=PPROFLST.m End found=0 End /* write the list of unique profiles from the source z/VM */ /* system to the output file */ Say 'Writing the Profile List' addprof.0=profctr 'pipe stem addprof. | >> 'PROFLIST Say "File "PROFLIST" has been created: "addprof.0" profiles were added" Exit CheckIp: /* check for the input files - exit with RC 04 if not found */ IFiles.1=SOURCEIN IFiles.2=TARGETIN IFiles.0=2 Do C=1 to IFiles.0 ADDRESS COMMAND 'ESTATE 'IFiles.C If RC <> 0 then Do Say 'Input file 'IFiles.C' not found - terminating' Exit 4 End End Return