/* DRCTEXCP - Create USER SOURCE file to be used to migrate user */ /* and profile directory entries from source z/VM system */ /* to an interim file for editing when compatibility issues */ /* exit that need to be edited prior to merging the entries*/ /* to the target z/VM system's directory */ /* Runs on the target system */ /* input files */ /* List of profile entries to be migrated - created by exec DIRLIST */ PROFLIST='MIGRATE PROFLST A' /* List of user entries to be migrated - created by exec DIRLIST */ USERLIST='MIGRATE USERLST A' /* Flat file copy of the source z/VM system's user directory */ SOURCEIN='SOURCE DIRECT A' /* Output file - USER DIRECT A - becomes input to DIRECTXA */ USERDIR='USER SOURCE A' /* call CheckIp to verify that all input files exist */ Call CheckIp /* erase the output file if it exists */ ADDRESS COMMAND 'ESTATE 'USERDIR If RC = 0 then 'ERASE 'USERDIR /* create a new output file - must have RECFM F */ Say 'Creating 'USERDIR 'EXECIO 1 DISKW 'USERDIR' 0 F 80 (STRING *' /* copy profiles to the output file using the GetDir procedure */ /* Note: profiles must be copied first to insure they are present */ /* when the user entries are processed */ 'pipe < 'PROFLIST' | stem PROFS.' Say 'Copying Profiles from 'SOURCEIN Do P = 1 to PROFS.0 NAME=PROFS.P Call GetDir End /* copy user entries to the output file using the GetDir procedure */ 'pipe < 'USERLIST' | stem USERS.' Say 'Copying Users from 'SOURCEIN Do U = 1 to USERS.0 NAME=USERS.U Call GetDir End Say "File "USERDIR" has been created" Exit GetDir: /* extract USER or PROFILE entries from the DIRM WITHPASS file */ /* and place into the output file */ Linein(SOURCEIN,1,0) Do Forever LINE=Linein(SOURCEIN) Parse var LINE W1 W2 . If W1='USER' & W2 = NAME | W1='PROFILE' & W2 = NAME then Do 'pipe var LINE | specs 1-72 1 | pad 80', '| block 80 fixed | >> ' USERDIR Say "Copying " W1 W2 "to File " USERDIR Do Forever LINE=Linein(SOURCEIN) 'pipe var LINE | specs 1-72 1 | pad 80', '| block 80 fixed | >> ' USERDIR Parse var LINE L1 . If L1 = "*DVHOPT" then Return End /* copy records loop */ End /* if found loop */ End/* main loop */ Return CheckIp: /* check for the input files - exit with RC 04 if not found */ IFiles.1=PROFLIST IFiles.2=USERLIST IFiles.3=SOURCEIN IFiles.0=3 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