/* Variable declarations */ length number $4; /**********************************************************/ /* */ /* Employee Number request: */ /* -The Transaction file will be searched first.. */ /* if the employee is found, the user will be able */ /* to edit the observation through fsview. If the */ /* employee is not found, the Master file will be */ /* searched... */ /* -If the employee is found in the Master file */ /* a copy of the observation will be sent to the */ /* Transaction file and displayed to the user for */ /* updating. */ /* -If the employee is not found, a window will */ /* display indicating the employee number does not */ /* exist. */ /* */ /* NOTE: All error checking has been left to the user. */ /* */ /**********************************************************/ EMPNO: call notify ('empno','_get_text_',number); transid=open('daily.trans'); rc=locatec(transid,varnum(transid,'empno'),number); if rc=0 then /* If employee number not found in Transaction file */ do; rc=close(transid); masterid=open('observe.master'); rc=locatec(masterid,varnum(masterid,'empno'),number); if rc=0 then /* If employee number not found in Master file */ do; call display ('ABSENT.FRAME'); rc=close(masterid); return; end; /* if */ else /* If employee number found in Master file */ do; if (exist('temp')) then /* Erase old temp file */ do; rc=delete('temp'); if rc<>0 then _msg_=sysmsg(); end; /* if */ /* Submit code to SAS to append the observation */ /* to a Temporary work file. */ SUBMIT CONTINUE; proc append base=temp data=observe.master(where=(empno="&number")) force; run; ENDSUBMIT; /* Allow user to edit observation */ call fsview('temp','edit'); /* Submit code to SAS to append observation to */ /* Transaction file */ SUBMIT CONTINUE; proc append base=daily.trans data=temp force; run; ENDSUBMIT; rc=close(masterid); end; /* else */ end; /* if rc=0 */ else /* If employee number is in the Transaction file */ do; /* Allow the user to edit observation */ call fsview('daily.trans(where= (empno='||quote(number)||'))','edit'); rc=close(transid); end; /* else */ return;