Get the entry number of a batch job
Posted: Thu Oct 22, 2020 11:35 am
Is there a (simple) way of getting the entry number of a batch job from within the job?
Thanks,
Mark
Thanks,
Mark
The official board to discuss OpenVMS-related topics
https://forum.vmssoftware.com/
Code: Select all
> Is there a (simple) way [...]
Define "simple".
HELP LEXICALS F$GETQUI ! (Abandon hope, ...)
its $ submit /noprint qe.com /log = []qe.log
Job qe (queue SYS$BATCH_ITS, entry 963) started on SYS$BATCH_ITS
its $
Job qe (queue SYS$BATCH_ITS, entry 963) completed
its $ type qe.log
$ Set NoOn
$ VERIFY = F$VERIFY(F$TRNLNM("SYLOGIN_VERIFY"))
entry: 963
SMS job terminated at 22-OCT-2020 13:39:50.38
Accounting information:
Buffered I/O count: 102 Peak working set size: 4672
Direct I/O count: 47 Peak virtual size: 178112
Page faults: 367 Mounted volumes: 0
Charged CPU time: 0 00:00:00.03 Elapsed time: 0 00:00:00.10
its $ type qe.com
$! function item object-id flags
$ e = f$getqui( "DISPLAY_ENTRY", "ENTRY_NUMBER", , "THIS_JOB")
$!
$ write sys$output " entry: ''e'"
Code: Select all
$ create test.com
write sys$output "Test"
^Z
$ show symb $entry
%DCL-W-UNDSYM, undefined symbol - check validity and spelling
$ subm/keep test
Job TEST (queue SYS$BATCH, entry 1) started on SYS$BATCH
$ show symb $entry
$ENTRY = "1"
$
Code: Select all
> $ show symb $entry
> $ENTRY = "1"
Now try that "from within the job".