function long display_full_info !labels !constants %include "$quidef" %from %library "sys$library:basic$starlet.tlb" %include "$smgdef" %from %library "sys$library:basic$starlet.tlb" %include "$smgmsg" %from %library "sys$library:basic$starlet.tlb" %include "smg$routines" %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, outputstr_tmp, head1, head2, & qc declare long sys_status, dp_attr, full_dpid, & start_col, start_row, window_width, & window_len, idx, start_scroll, & fixed_lines, wrap_flag, file_len, & additional_lines, entry_flag, str_len, & file_line_count, file_lines, top_file, & bottom_file, lines_to_scroll, & batchlogfile, batchparams %include "que_struct.bas" declare string file_line(maxfile_lines) !procedures !functions external long function smg$put_with_scroll, & window_getmsg( long ), & write_display( long, long ), & str$translate( string, & string, & string, & string ), & sys$asctim file_line_count = 0% replace = " " match = chr$(0%) wrap_flag = 1% dp_attr = smg$m_border fixed_lines = 6% window_width = tt_cols - 2% qc = chr$(34%) select batch_que case <> 0% head1 = " Jobname Username Entry Pri Status" head2 = " ------- -------- ----- --- ------" if p1len(cur_job) <> 0% then batchparams = -1% fixed_lines = fixed_lines + 1% end if if log_speclen(cur_job) <> 0% then batchlogfile = -1% fixed_lines = fixed_lines + 1% end if case = 0% head1 = " Jobname Username Entry Blocks Formname Pri Status" head2 = " ------- -------- ----- ------ -------- --- ------" batchparams = 0% batchlogfile = 0% end select window_len = fixed_lines + min(num_files(cur_job),dplines - fixed_lines) ! Add one to allow for "Done." message to appear at the bottom of the window. if window_len < dplines then window_len = window_len + 1% end if if (len(edit$(job_name(cur_job), 2% + 4%)) > 19%) and & (window_len < dplines) then window_len = window_len + 1% end if file_len = len(edit$(file_spec(cur_job,num_files(cur_job)), 2%+4%)) additional_lines = (file_len / (tt_cols - 3%)) - 1% if mod(file_len,tt_cols - 3%) > 0% then additional_lines = additional_lines + 1% end if if (additional_lines > 0%) and (window_len < dplines) then window_len = window_len + additional_lines end if sys_status = smg$create_virtual_display( window_len by ref, & window_width by ref, & full_dpid by ref, & dp_attr by ref,, ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if start_col = 2% start_row = (tt_rows / 2%) - ((window_len + 2%) / 2%) + 2% sys_status = smg$paste_virtual_display( full_dpid by ref, & pbid by ref, & start_row by ref, & start_col by ref, ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if sys_status = smg$put_with_scroll( full_dpid by ref, & "" by desc,,,,, ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if sys_status = smg$put_with_scroll( full_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_with_scroll( full_dpid by ref, & head2 by desc,,,,, ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) 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 " 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,20%,1%) <> chr$(0%) then start_scroll = fixed_lines + 1% outputstr = j_name 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 sys_status = smg$put_with_scroll( full_dpid by ref, & outputstr by desc,,,, & wrap_flag by ref, ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if else start_scroll = fixed_lines end if select batch_que case <> 0% if start_scroll = fixed_lines then outputstr = " " + mid(j_name,1%,19%) + " " + username(cur_job) & + " " + format$(entry_number(cur_job),"#####") + " " + & format$(priority(cur_job),"###") + " " + j_status else outputstr = space$(21%) + username(cur_job) + " " + & format$(entry_number(cur_job),"#####") + " " + & format$(priority(cur_job),"###") + " " + j_status end if case = 0% if start_scroll = fixed_lines then 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%) + " " + & format$(priority(cur_job),"###") + " " + j_status else outputstr = space$(21%) + username(cur_job) + " " + & format$(entry_number(cur_job),"#####") + " " + & format$(job_size(cur_job),"######") + " " + & mid(formname(cur_job),1%,10%) + " " + & format$(priority(cur_job),"###") + " " + j_status end if 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 sys_status = smg$put_with_scroll( full_dpid by ref, & outputstr by desc,,,, & wrap_flag by ref, ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if timbuf = "" sys_status = sys$asctim(timlen, timbuf, sub_time(cur_job, 1%), ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if outputstr = " Submitted " + mid(timbuf, 1%, timlen) 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 sys_status = smg$put_with_scroll( full_dpid by ref, & outputstr by desc,,,, & wrap_flag by ref, ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if if batchlogfile then outputstr = " /LOG=" + mid(log_spec(cur_job), 1%, log_speclen(cur_job)) 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 sys_status = smg$put_with_scroll( full_dpid by ref, & outputstr by desc,,,, & wrap_flag by ref, ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if end if if batchparams then outputstr = " /PARAM=(" + qc + mid(p1(cur_job), 1%, p1len(cur_job)) + qc if p2len(cur_job) <> 0% then outputstr = outputstr + ", " + qc + & mid(p2(cur_job), 1%, p2len(cur_job)) + qc end if if p3len(cur_job) <> 0% then outputstr = outputstr + ", " + qc + & mid(p3(cur_job), 1%, p3len(cur_job)) + qc end if if p4len(cur_job) <> 0% then outputstr = outputstr + ", " + qc + & mid(p4(cur_job), 1%, p4len(cur_job)) + qc end if if p5len(cur_job) <> 0% then outputstr = outputstr + ", " + qc + & mid(p5(cur_job), 1%, p5len(cur_job)) + qc end if if p6len(cur_job) <> 0% then outputstr = outputstr + ", " + qc + & mid(p6(cur_job), 1%, p6len(cur_job)) + qc end if if p7len(cur_job) <> 0% then outputstr = outputstr + ", " + qc + & mid(p7(cur_job), 1%, p7len(cur_job)) + qc end if if p8len(cur_job) <> 0% then outputstr = outputstr + ", " + qc + & mid(p8(cur_job), 1%, p8len(cur_job)) + qc end if outputstr = outputstr + ")" 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 sys_status = smg$put_with_scroll( full_dpid by ref, & outputstr by desc,,,, & wrap_flag by ref, ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if end if if start_scroll - (window_len - 1%) < 0% then sys_status = smg$set_display_scroll_region( full_dpid by ref, & start_scroll by ref, & window_len - 1% by ref ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if end if for idx = 1% to num_files(cur_job) outputstr = " " + edit$(file_spec(cur_job,idx), 2% + 4%) entry_flag = 0% str_len = min(tt_cols - 3%, len(outputstr)) outputstr_tmp = outputstr while outputstr_tmp <> "" entry_flag = -1% file_line_count = file_line_count + 1% outputstr = mid(outputstr_tmp, 1%, str_len) file_line(file_line_count) = outputstr sys_status=smg$put_with_scroll( full_dpid by ref, & outputstr by desc,,,, & wrap_flag by ref, ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if outputstr_tmp = mid(outputstr_tmp, str_len + 1%, & len(outputstr_tmp) - str_len) str_len = min(tt_cols - 3%, len(outputstr_tmp)) next next idx file_line_count = file_line_count + 1% outputstr = " Done." file_line(file_line_count) = outputstr sys_status=smg$put_with_scroll( full_dpid by ref, & outputstr by desc,,,, & wrap_flag by ref, ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if bottom_file = file_line_count file_lines = dplines - start_scroll - 1% if file_line_count > file_lines then top_file = bottom_file - file_lines else top_file = 1% end if sys_status = smg$set_cursor_abs( full_dpid by ref, & window_len - 1% by ref, & 1% ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if while done = 0% sys_status = smg$read_keystroke( kbid by ref, & terminator by ref,,,,, ) if (sys_status = smg$_eof) or & (sys_status = ss$_badescape) or & (sys_status = ss$_partescape) or & (sys_status = ss$_dataoverun) then sys_status = ss$_normal end if if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if select terminator case = smg$k_trm_up, = smg$k_trm_ctrlp if top_file > 1% then top_file = top_file - 1% bottom_file = bottom_file - 1% sys_status = smg$set_cursor_abs( full_dpid by ref, & start_scroll by ref, & 1% by ref ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if sys_status = smg$put_with_scroll( full_dpid by ref, & "" by desc, & smg$m_down by ref,,,, ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if sys_status = smg$put_with_scroll(full_dpid by ref, & file_line(top_file) by desc, & smg$m_down by ref,,, & 1% by ref, ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if sys_status = smg$set_cursor_abs( full_dpid by ref,, & 1% by ref ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if end if case = smg$k_trm_down, = smg$k_trm_ctrln if bottom_file < file_line_count then top_file = top_file + 1% bottom_file = bottom_file + 1% sys_status = smg$set_cursor_abs( full_dpid by ref, & window_len - 1% by ref, & 1% by ref ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if sys_status = smg$put_with_scroll( full_dpid by ref, & "" by desc, & smg$m_up by ref,,,, ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if sys_status = smg$put_with_scroll(full_dpid by ref, & file_line(bottom_file) by desc, & smg$m_up by ref,,, & 1% by ref, ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if sys_status = smg$set_cursor_abs( full_dpid by ref,, & 1% by ref ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if end if case = smg$k_trm_prev_screen if top_file > 1% then if top_file > file_lines - 1% then lines_to_scroll = file_lines - 1% bottom_file = bottom_file - lines_to_scroll else lines_to_scroll = top_file - 1% bottom_file = bottom_file - lines_to_scroll end if sys_status = smg$set_cursor_abs( full_dpid by ref, & start_scroll by ref, & 1% by ref ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if sys_status = smg$put_with_scroll( full_dpid by ref, & "" by desc, & smg$m_down by ref,,,, ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if for top_file = top_file - 1% to top_file - lines_to_scroll step -1% sys_status = smg$put_with_scroll(full_dpid by ref, & file_line(top_file) by desc, & smg$m_down by ref,,, & 1% by ref, ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if next top_file sys_status = smg$set_cursor_abs( full_dpid by ref,, & 1% by ref ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if end if case = smg$k_trm_next_screen, = smg$k_trm_ctrlv if bottom_file < file_line_count then if file_line_count - bottom_file >= file_lines - 1% then lines_to_scroll = file_lines - 1% top_file = top_file + lines_to_scroll else lines_to_scroll = file_line_count - bottom_file top_file = top_file + lines_to_scroll end if sys_status = smg$set_cursor_abs( full_dpid by ref, & window_len - 1% by ref, & 1% by ref ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if sys_status = smg$put_with_scroll( full_dpid by ref, & "" by desc, & smg$m_up by ref,,,, ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if for bottom_file = bottom_file + 1% to bottom_file + lines_to_scroll sys_status = smg$put_with_scroll(full_dpid by ref, & file_line(bottom_file) by desc, & smg$m_up by ref,,, & 1% by ref, ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if next bottom_file sys_status = smg$set_cursor_abs( full_dpid by ref,, & 1% by ref ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if end if case = smg$k_trm_do, = smg$k_trm_ctrlz, = smg$k_trm_cr, = smg$k_trm_space, = smg$k_trm_f10 done = 1% sys_status = smg$delete_virtual_display( full_dpid by ref ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if case = smg$k_trm_ctrlw, = smg$k_trm_ctrll sys_status = smg$repaint_screen( pbid by ref ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if sys_status = smg$set_cursor_abs( full_dpid by ref,, & 1% by ref ) if (sys_status and 1%) = 0% then call lib$signal( sys_status by value ) end if end select next display_full_info = sys_status end function