Hello Gehan,
Welcome to the list and the 3000 community!
...
> How do I access the Name field of a file by it's DFID number?
> when you send a print job I want it to say
> JReport sent to main printer
> instead of
> 2243 sent to main printer
>
> Can you do something like???
> echo $p1.filename sent to main printer
That would be a nice feature of MPE's Command Interpreter (CI,
like a Unix shell program), and it may be provided in VESoft's
MPEX product (extra cost from a reputable 3rd party) -- I'm sure
someone on the list can comment on that.
I believe one of the MPE SIGs (special interest groups) has asked
for a Spoolfile Info function, and if we had one I bet it would
have provided this info easily. But...
just using the CI you'll need to redirect the output of the LISTSPF
command to a disk file, read the contents of the file into a CI
variable, parse out the JOBNAME, and echo that to $STDLIST.
Something like this should work, but it has not been tested :
PARM spf, copies=1, dev=1
# script to send "copies" copies of spoolfile "spf" to LDEV "dev".
# (note MPE message files reads are destructive)
#
setvar _spf_file "!spf" + ".out.hpspool"
if not finfo(_spf_file,'exists') then
echo Spoolfile !_spf_file not found...
return
endif
errclear
continue
spoolf !_spf_file;dev=!dev;copies=!copies;pri=13
if hpcierr = 0 then
# spoolf worked
file spfmsg;MSG
## I don't know if you need a pause here after the spoolf command but
## before the listspf command. If you do then use the PAUSE command.
continue
listspf !spf >*spfmsg
if hpcierr = 0 then
# listspf command worked, read MSG file
# read and ignore the 1st 3 records in the file
input _spf_buf <*spfmsg
input _spf_buf <*spfmsg
input _spf_buf <*spfmsg
# extract the job name (3rd word in the input buffer)
input _spf_buf <*spfmsg
setvar _spf_jname word(_spf_buf,,3)
if _spf_jname = "" then
setvar _spf_jname "!spf"
endif
echo !_spf_jname sent to main printer at LDEV !dev
endif
endif
deletevar _spf_@
There are also a couple of predefined variables that might help
in the future:
Enter help on: HPSPOOLID and HPLASTSPID, and HPLASTJOB too. E.g.:
:help hpspoolid
:help hplastspid ... and ...
:help variables
:help expressions
:help operators
:help functions
> Ps. Also before anyone makes a comment about a BSCS who can't
> figure out a 3 line program. This is all in my own time. My job
> is Database programming/SQL server, I'm just learning this for
> fun on my lunch hours.
This list is not hostile and I doubt you'd see comments as you
are concerned about above. However, you might read some tidbits
about politics, religion, insects, galaxies, meteor showers,
printers, evolutionary concepts applied to computer science,
gripes about HP stopping support of the 3000 in 2006, etc...
on this list.
Hope this helps,
Jeff Vance, "CSY"
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|