IDENTIFICATION DIVISION. PROGRAM-ID. SYSUAF. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 item-list-getuai. 02 pwd_lifetime_list. 03 pwd_len PIC S9(4) comp value 8. 03 PIC S9(4) comp VALUE external uai$_pwd_lifetime. 03 pointer value reference pwd_lifetime. 03 pointer value reference ret-addr. 02 pwd_date_list. 03 date_len PIC S9(4) comp value 8. 03 PIC S9(4) comp VALUE external uai$_pwd_date. 03 pointer value reference pwd_date. 03 pointer value reference ret-addr. 02 terminator PIC S9(9) COMP VALUE 0. 01 item-list-getjpi. 02 jpi_username_list. 03 name_len PIC S9(4) comp value 12. 03 PIC S9(4) comp VALUE external jpi$_username. 03 pointer value reference jpi_username. 03 pointer value reference ret-addr. 02 terminator PIC S9(9) COMP VALUE 0. 01 return_value PIC S9(9) COMP. 01 delay COMP-1 VALUE 3.5. 01 EOF PIC X. 01 dummy PIC X. 01 correct PIC X VALUE "N". 01 first_time PIC X VALUE "Y". 01 passchanged PIC X VALUE "N". 01 command_str PIC X(32). 01 jpi_username PIC X(12). 01 pwd_date PIC S9(18) COMP. 01 pwd_lifetime PIC S9(18) COMP. 01 pwd_expire PIC S9(18) COMP. 01 today_date PIC S9(18) COMP. 01 pwd_days_left PIC S9(18) COMP. 01 pwd_date_ascii PIC X(24) VALUE SPACES. 01 pwd_lifetime_ascii PIC X(24) VALUE SPACES. 01 pwd_expire_ascii PIC X(24) VALUE SPACES. 01 today_date_ascii PIC X(24) VALUE SPACES. 01 pwd_days_left_ascii PIC X(24) VALUE SPACES. 01 pwd_life_days. 02 filler PIC XX VALUE SPACES. 02 days PIC XX. 02 filler PIC X(20) VALUE SPACES. 01 ret-addr PIC S9(4) COMP. PROCEDURE DIVISION. UAF-MAIN. Perform pass-check until correct = "Y". * Perform days_left through days-left-exit. If Passchanged = "Y" then DISPLAY " Your VMS Password Has Been Changed " at line number 8 at column 21 reversed erase screen display " Press Return To Continue " at line number 23 reversed accept dummy. stop run. pass-check. perform get-data through get-data-exit. if pwd_lifetime_ascii = "17-NOV-1858 00:00:00.00" move "Y" to correct else if pwd_expire < today_date or pwd_date_ascii = " 0 00:00:00.00" then if first_time = "N" then DISPLAY " " at line number 17 DISPLAY " Your VMS Password Did Not Get Changed Correctly. " at line number 18 at column 15 reversed DISPLAY " PLEASE TRY AGAIN " at line number 19 at column 31 reversed display "Press Return To Continue " at line number 23 reversed accept dummy Display " " at line number 9 erase screen else DISPLAY " " at line number 1 erase screen DISPLAY " Your VMS PASSWORD NEEDS TO BE CHANGED IMMEDIATELY!! " at line number 5 at column 14 reversed DISPLAY " " at line number 6 at column 14 reversed DISPLAY " ""Old Password""" at line number 7 at column 14 reversed DISPLAY " = Type your current password. " at line number 7 at column 29 reversed DISPLAY " " at line number 8 at column 14 reversed DISPLAY " ""New Password""" at line number 9 at column 14 reversed DISPLAY " = Create and type a new password. " at line number 9 at column 29 reversed DISPLAY " " at line number 10 at column 14 reversed DISPLAY " ""Verification""" at line number 11 at column 14 reversed DISPLAY " = Retype your newly created paswword." at line number 11 at column 29 reversed end-if Display " " at line number 13 move "set password" to command_str call "lib$spawn" using by descriptor command_str move "Y" to passchanged else move "Y" to correct end-if. move "N" to first_time. pass-check-exit. exit. GET-DATA. * * get the process user name of the user running this program * call "sys$getjpiw" using by value 0, by value 0, by value 0, by reference item-list-getjpi, by value 0, by value 0, by value 0, giving return_value. if return_value is failure call "lib$stop" using by value return_value. * * get today's date and time and convert to binary * call "sys$asctim" using by value 0, by descriptor today_date_ascii, by value 0, by value 0, giving return_value. call "sys$bintim" using by descriptor today_date_ascii, by reference today_date, giving return_value. * * get the password change date and the password lifetime * call "sys$getuai" using by value 0, by value 0, by descriptor jpi_username, by reference item-list-getuai, by value 0, by value 0 , by value 0 , giving return_value. call "sys$asctim" using by value 0, by descriptor pwd_lifetime_ascii, by reference pwd_lifetime, by value 0, giving return_value. if return_value is failure call "lib$stop" using by value return_value. subtract pwd_lifetime from pwd_date giving pwd_expire. get-data-exit. exit. *days-left. * * determine how many days are left until the password expires. * * * * * find out how many days until the password expires * first convert todays date to binary time * then determine the number of days left before * the password will expire * * subtract pwd_expire from today_date giving pwd_days_left. * call "sys$asctim" using by value 0, * by descriptor pwd_days_left_ascii, * by reference pwd_days_left, * by value 0, * giving return_value. * move pwd_days_left_ascii to pwd_life_days. * * if days = " 0" * DISPLAY " Your VMS Password Is Going To Expire Today " * at line number 5 at column 21 reversed erase screen * else * if days < " 8" * DISPLAY " There Are " * at line number 5 at column 11 reversed erase screen * DISPLAY days at line number 5 at column 21 reversed * DISPLAY " Days Left Before You Have To Change Your VMS Password " * at line number 5 at column 23 reversed * end-if. * * display " " at line number 9. * * *days-left-exit. * exit.