parm select ="" entry='MaIn' # # Code for executing within MPEX to avoid error due to way MPEX # evaluates conditional expressions. # setvar insidempex,0 if "!entry" = "MaIn" AND (insidempex <> 0 OR hpcmdnum=0) then setvar _cm "![BASENAME(hpfile)]" run CI.PUB.SYS;PARM=3;info='xeq !hpfile ![ANYPARM(!select)]' return elseif NOT BOUND(_cm) then echo !-1 >xsjfilex INPUT _cm < xsjfilex setvar _cm WORD(_cm) endif # if "!entry" = "ReAdIt" then setvar ShowJob_Count 0 while (POS("$eod$",(SETVAR(_sj_Text,INPUT()))) = 0) do if LFT(_sj_Text,1) = "#" then if POS("!_sj_Select",_sj_Text) <> 0 then echo !_sj_Text setvar ShowJob_Count ShowJob_Count + 1 endif else echo !_sj_Text endif endwhile # (return to myself in the "main" entry code) return else setvar _sj_Select UPS("!select") setvar _sj_Jobq_Spec "" if BOUND(ShowJobQueue) AND ShowJobQueue then setvar _sj_Jobq_Spec ";JOBQ" endif if _sj_Select = "?" then echo (PHC) Flexible ShowJob command V2004.01.16 !hpdatef, !hptimef echo echo Usage: !_cm [ SJ_parm ] ![CHR(7)] echo echo Produces a more 'flexible' "showjob" listing. It has a number echo of 'pre-defined' parameter values plus wild-card capability. echo echo SJ_parm - Optional parameter directing the selection of the echo generated 'showjob' records, with the following values: echo echo 1. "?" - Shows command file's 'usage' information. echo 2. "" - Shows all JOBS and SESSIONS in the system. echo 3. "J" - Shows all BATCH JOBS in the system. echo 4. "S" - Shows all SESSIONS in the system. echo 5. "X" - Shows all BATCH JOBS in the EXEC state. echo 6. ".acctname" - Shows JOBS and SESSIONS for entered account. echo 7. "string" - Shows all 'showjob' records containing the echo indicted string. echo echo NOTE: The setting of the CI variable "ShowJobQueue" to a 'true' echo value causes the command file to include any 'job queue' echo information in its display. Also a '~' char in the FIRST echo position of the string, acts as an 'escape' character. # elseif _sj_Select = "" then showjob job=@!_sj_Jobq_Spec elseif _sj_Select = "J" then showjob job=@J!_sj_Jobq_Spec elseif _sj_Select = "S" then showjob job=@S elseif _sj_Select = "X" then showjob job=@j;EXEC!_sj_Jobq_Spec elseif LFT(_sj_Select,1) = "." then showjob job=@!_sj_Select!_sj_Jobq_Spec else if LFT(_sj_Select,1) = "~" AND LEN(_sj_Select) > 1 then setvar _sj_Select _sj_Select - "~" endif showjob job=@!_sj_Jobq_Spec > xsjfilex echo $eod$ >> xsjfilex xeq !hpfile _sj_Select ;entry="ReAdIt" < xsjfilex purge xsjfilex,temp > $null echo setvar _sj_Suffix "s" if ShowJob_Count = 1 then setvar _sj_Suffix "" endif echo *** !ShowJob_Count Item!_sj_Suffix qualified. *** ![chr(7)] echo endif endif # Clean Up deletevar _cm if BOUND(traceon) AND traceon then showvar _sj@ else deletevar _sj@ endif