function long write_display( long scrn, lines ) !labels !constants %include "$quidef" %from %library "sys$library:basic$starlet.tlb" %include "$smgdef" %from %library "sys$library:basic$starlet.tlb" %include "smg$routines" %from %library "sys$library:basic$starlet.tlb" %include "$smgtrmptr" %from %library "sys$library:basic$starlet.tlb" %include "$ssdef" %from %library "sys$library:basic$starlet.tlb" !types !variables declare string j_status, outputstr, replace, match, & j_name, head1, head2 declare long job, sys_status, start_scroll, & end_scroll, rendition_set, direction, & iterations %include "que_struct.bas" !procedures !functions external long function str$translate( string, & string, & string, & string ), & smg$put_with_scroll, & sys$asctim screen = scrn headlines = 2% sys_status = ss$_normal replace = " " match = chr$(0%) dplines = tt_rows - 2% start_scroll = 3% end_scroll = dplines datalines = dplines - headlines if lines = 0% then lines = datalines end if iterations = 0% if lines = 0% then lines = screen * datalines + datalines end if select batch_que case <> 0% head1 = " Jobname Username Entry Status" head2 = " ------- -------- ----- ------" case = 0% head1 = " Jobname Username Entry Blocks Formname Status" head2 = " ------- -------- ----- ------ -------- ------" end select if display_flag = 0% then cur_job = 0% sys_status = smg$erase_display( dpid by ref,,,, ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if sys_status = smg$put_line( dpid by ref, & head1 by desc,,,,,, ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if sys_status = smg$put_line( dpid by ref, & head2 by desc,,,,,, ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if sys_status = smg$set_display_scroll_region( dpid by ref, & start_scroll by ref, & end_scroll by ref ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if end if if display_flag <> 0% then job = screen * datalines + 1% + lines else job = screen * datalines + 1% display_flag = 1% end if while cur_job < num_jobs and iterations < abs(lines) iterations = iterations + 1% if lines > 0% then cur_job = cur_job + 1% else cur_job = cur_job - 1% end if j_status = "" if job_status(cur_job) and qui$m_job_aborting then j_status = j_status + "Aborting " end if if job_status(cur_job) and qui$m_job_executing then j_status = j_status + "Executing " end if if job_status(cur_job) and qui$m_job_holding then j_status = j_status + "Holding " ! else ! if selected(cur_job) = 0% then ! j_status = j_status + "To be Held " ! else ! j_status = j_status + " " ! end if end if if job_status(cur_job) and qui$m_job_inaccessible then j_status = j_status + "Inaccessible " end if if job_status(cur_job) and qui$m_job_refused then j_status = j_status + "Refused " end if if job_status(cur_job) and qui$m_job_retained then j_status = j_status + "Retained " end if if job_status(cur_job) and qui$m_job_starting then j_status = j_status + "Starting " end if if job_status(cur_job) and qui$m_job_timed then timbuf = "" j_status = j_status + "Holding until " sys_status = sys$asctim(timlen, timbuf, after_time(cur_job, 1%), ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if j_status = j_status + mid(timbuf, 1%, timlen - 6%) end if j_name = job_name(cur_job) if mid(j_name,19%,1%) <> chr$(0%) and & mid(j_name,20%,1%) <> chr$(0%) then mid(j_name,19%,1%) = "\" end if select batch_que case <> 0% outputstr = " " + mid(j_name,1%,19%) + " " + username(cur_job) & + " " + format$(entry_number(cur_job),"#####") + " " + j_status case = 0% outputstr = " " + mid(j_name,1%,19%) + " " + username(cur_job) & + " " + format$(entry_number(cur_job),"#####") + " " + & format$(job_size(cur_job),"######") + " " + & mid(formname(cur_job),1%,10%) + " " + j_status end select sys_status = str$translate( outputstr by desc, & outputstr by desc, & replace by desc, & match by desc ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if if selected(cur_job) then rendition_set = smg$m_reverse else rendition_set = 0% end if if lines >= 0% then direction = smg$m_up else direction = smg$m_down end if sys_status = smg$put_with_scroll( dpid by ref, & outputstr by desc, & direction by ref, & rendition_set by ref,,, ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if next write_display = sys_status end function