/**********************************************************************/ /* */ /* Assume you are currently editing data set MY.DATA using the */ /* FSEDIT procedure. You have a unique index on numeric variable */ /* JOBNUM and want to check for a duplicate value as soon as */ /* users enter a value for JOBNUM and press ENTER. The */ /* following SCL program provides this information: */ /* */ /**********************************************************************/ FSEINIT: dsid=open('my.data','i'); return; INIT: initial=jobnum; return; MAIN: if modified(jobnum) and jobnum ne initial then do; rc=where(dsid,'jobnum ='||put(jobnum,3.)); any=attrn(dsid,'any'); if any>0 then do; erroron jobnum; _msg_='You entered a duplicate value for JOBNUM'; end; end; return; TERM: return; FSETERM: if (dsid>0) then rc=close(dsid); return;