Download as pdf or txt
Download as pdf or txt
You are on page 1of 59

PrinterSetupInjBASEAndT24-R10.

01 1
Trainee notes

PrinterSetupInjBASEAndT24-R10.01 3
(1) A database Universe/jBASE or an application Globus/T24 does not hold any capability to print rather
they simply redirect the print jobs sent by users to OS (Operating System)
(2) When we take a look at the flow how request from user passes through various layers and reaches a
database we understand that there is no layer that separates the operating system (Unix/Windows)
and the database (jBASE)
(3) Therefore printers which we can set up at operating system level are all available in jBASE.
Printing in any organization is vital to take hard copy of statements which organization
can make use for present or future reference.
In a bank printing plays major role since it deals with customers money.

PrinterSetupInjBASEAndT24-R10.01 5
Any application or database cannot directly print to the printer as any request to the
hardware is always sent via the operating system. Hence, if we need to print anything
from T24, all that T24 can do is to initiate the print request and send the request to the
database (jBASE). jBASE in turn will route the print request to the operating system
and then the printing will actually happen.

PrinterSetupInjBASEAndT24-R10.01 6
Installing and configuring a printer in Windows is a user friendly task. All you need to
do is open the Control Panel and choose printers and faxes. You might find this option
when you click on start depends on the view you have configured in Windows.

PrinterSetupInjBASEAndT24-R10.01 7
Note windows creates logical printer once printer is added referred as printer driver.
Each vendor has list printer models you can see this under manufacturer and printers.

PrinterSetupInjBASEAndT24-R10.01 8
As you know OS can not communicate directly with any hardware without having a
piece of code written for that particular hardware.
These software are referred as drivers so each hardware in a computer with which OS
has to communicate has a driver installed.

PrinterSetupInjBASEAndT24-R10.01 9
Installing and configuring printers in UNIX is not as user friendly as Windows.
Command line utility which deals with this is lpadmin which helps you in installing local
as well as network printer.

You can print to a default unix printer if specified or if in case of more that one printer
you can mention name of a printer with lpr command to which you want to send your
print job.

PrinterSetupInjBASEAndT24-R10.01 10
You can even remove your print job before it gets despooled. If you know the job
number of your print job you need to mention job number along with your printer name.

PrinterSetupInjBASEAndT24-R10.01 11
As you can see you setup printer first at the OS level then at the jBASE level and
finally at application level that is T24

PrinterSetupInjBASEAndT24-R10.01 12
It depends on which platform you set up printer whether it is on Windows or Unix. At
the same time you setup on which database in our case jBASE you will find different
terminologies has been used. If jBASE has to print with ORACLE as database still
jBASE follows same steps to configure and setup printer at database level.

PrinterSetupInjBASEAndT24-R10.01 13
Note there is no layer in between OS and Database

(1) When we take a look at the flow how request from user passes through various
layers and reaches a database we understand that there is no layer that separates
the operating system (Unix/Windows) and the database (jBASE)
(2) Therefore printers which we can set up at operating system level are all available in
jBASE.
(3) It is important to understand since jBASE has all OS level printers available jBASE
supports all device types as well which are available at OS level

PrinterSetupInjBASEAndT24-R10.01 14
So far, we understood the flow that first OS creates logical printer then in jBASE we
have to create a form queue which will further associate with logical devices which are
nothing but device files available under /dev directory (UNIX only). Base on logical
device type OS understands to which printer OS has to pass print job if in case of
more than one printer.

PrinterSetupInjBASEAndT24-R10.01 15
jLP Spooler
jLP, the jBASE spooler, accepts multiple print reports generated by PRINT statements
in jBASE programs, or directly from the jBASE
command line processors such as jQL or jCL.

Spooling involves buffering data that is transferred from a processor to peripheral


devices, such as printers, to reduce processing delays

The jLP spooler controls the temporary storage of print jobs and arbitrates between
multiple users who are creating print jobs,
and the multiple devices for which they are intended. This means that several users
can share the same system resources without
each having to wait for an exclusive connection.

In jBase, we create from queues. Form queues are like the logical printers that get
created in Windows. They would point to a physical printer device.

Submitted print reports are allocated a print job number and assigned to a formqueue.
Each formqueue is associated with a
specific device which will receive the despooled (print job is despooled to execute the
print job on the printer) output. Multiple formqueues are supported, providing
simultaneous despooling facilities to many different logical device types. The
formqueues effectively comprise lists of print jobs waiting to be printed, in order of
priority.
Use the SP-CREATE or SP-DEVICE commands to assign logical devices to
formqueues.
These commands are also available from the SPSTATUS
menu.

A logical device can be any one of the following types:

LPTR - output is directed to a specific UNIX device name.


TAPE - output is directed to a tape device via jBASE tape
support.
PORT - output is directed to a port via the PORT-DESPOOL command.
PROG - output is redirected to an external UNIX program.
UNIX
A formqueue named TRG is associated with LPTR device type file for which is
available under /dev/lptr. You can see the status as assigned and the device type as
LPTR.
Note : SP-CREATE or SP-STATUS both commands you can use to create a form
queue. In above example SP-CREATE command has been showed as you go along
you will understand you can use SP-STATUS command as well for the same as well
as for other functionalities.

PrinterSetupInjBASEAndT24-R10.01 18
PROG stands for program is a logical device type referrs to an external UNIX program. There
is a background process running which takes care of sending data from the print job to the
command line.

lp –d prints a file in a format suitable for sending to a line printer.


Form queue named TRAINING is associated with a device type PROG which is further
mapped to the physical printer called inprn-3left.
In this example SP-STATUS is command used to create a form queue.

PrinterSetupInjBASEAndT24-R10.01 20
Form queues can get associated with device types called PORT which is nothing but a
logical port available at OS level. Again for each PORT there is a device file available
under /dev directory. This queues print jobs for output to a port.

PrinterSetupInjBASEAndT24-R10.01 21
Form queue named TRN associated with device type called PORT for which device
file is available under /dev directory

PrinterSetupInjBASEAndT24-R10.01 22
Another logical device type called TAPE is available under /dev directory at OS as well
as at jBASE level. Since you learned before that printers available at OS level are all
available under jBASE level. Meaning you will find /dev directory at jBASE level as
well which is altogether same as OS level /dev direcotry (UNIX only).

PrinterSetupInjBASEAndT24-R10.01 23
A form queue named TRNTP is associated with device type TAPE streaming cartridge
tape device 0 which should configured in the jBASE.

PrinterSetupInjBASEAndT24-R10.01 24
UNIX device type despools print job to a default UNIX printer. So you don’t have to
mention device name in this case it takes default printer configured for printing.

PrinterSetupInjBASEAndT24-R10.01 25
Note device name has been left blank will despool job to unix default printer.

PrinterSetupInjBASEAndT24-R10.01 26
jBASE spooler supports all spooler commands mentioned these commands will help
you if you need to troubleshoot if thing are not gone right.
Use of these commands you will understand as you go along.
TAFC_HOME holds the path of spooler directory you can export new value to this
environment variable by using export command.
Along with this variable there other jBASE environment variable you need to verify
depends on which platform you are working.

PrinterSetupInjBASEAndT24-R10.01 28
SP-NEWTAB
Creates a new spooler structure.

COMMAND SYNTAX
SP-NEWTAB (Unix)
SP-NEWTAB (Windows)

WARNING SP-NEWTAB removes all print jobs and form queues. The STANDARD form queue is
recreated.

NOTES
This command can only be executed by root or an administrator.
The default directory in which the spooler files are created is called jspooler however SP-NEWTAB allows
a different directory to
be specified. Before the spooler can be accessed by a user, it's location must be specified using the
environment variable
JBCSPOOLERDIR. On Unix platforms, SP-NEWTAB prompts for the owner and group to be assigned to
the spooler files. If not specified
the owner is set to root and the group is set to lp.

jsh r10NG ~ -->echo $JBCSPOOLERDIR


/usr/jspooler

jsh r10NG ~ -->cd /usr/jspooler


jsh r10NG /usr/jspooler -->ls
jobs jobs]D jspool_log jspool_log]D

jobs
The jobs directory contains the entries as below.
formqueue_0
formqueue_1
Each of the entries refer to a form queue. Formqueue_0 refers to the standard formqueue.

jspool_log
Prints jobs are identified by number. The jBASE spooler uses a control record in the jspool_log file -
NextJobNumber - to assign print job numbers. The structure of this record is:
<1> Date job number was last reset
SP-NEWTAB allows security settings for form queues and print jobs. These can be
changed subsequently by using the commands SPSECURITY,
SP-SECURITY-JOBS, SP-SECURITY-OWNER and SP-SECURITYQUEUE.

Please refer to the documentation for a full discussion of the security settings.
The SP-NEWTAB command does not kill despooling daemons. If a process was
assigned to any formqueue other than STANDARD
when the SP-NEWTAB command was executed, the process will be assigned to NO
QUEUE.

The default form queue STANDARD is re-initialized with a LPTR logical device type.
SP-NEWTAB helps in creating spooler structure which will be your next step to
configure printer in Jbase.
Once the directory has been created you need assign full permissions with command
called chmod
777 exhibits R (Read – 4) W(Write – 2) X (Execute – 1) permission for a user, for a
local group and for a global group.

PrinterSetupInjBASEAndT24-R10.01 31
Form queue Creation and Assignment
Form queues can be created by using the SP-CREATE command (or the create option from the SP-
STATUS menu).

For example:
SP-STATUS – Option1
or
SP-CREATE PAYROLL LPTR /dev/lptr
will create the formqueue PAYROLL and assigned it to logical device type LPTR. LPTR is associated with
device /dev/lptr which
will receive the output print job data.

Formqueue PAYROLL could then be reassigned to any alternative logical device type by using the SP-
DEVICE command (or the change device option from the SP-STATUS menu), like this:
SP-STATUS – Option 4
or
SP-DEVICE PAYROLL PORT /dev/tty8b

Despooling from a formqueue is initiated by the SP-RESUME command


(or from the resume option of the SP-JOBS menu).

Despooling to the UNIX Spooler


Despooling to the UNIX spooler can be achieved by using a logical device type of
PROG and specifying the lp command together with
the device name, if required. As each print job is closed it will be despooled to the
UNIX lp command.

Despooling to jBASE Logical Devices


A jBASE background despooler daemon is started for each defined formqueue when
the :REST-SPOOLER command is executed. Each daemon
SP-STATUS allows you to create a form queue apart from other functionalities. A
form queue named TRAINING with device PROG has been created which prints to a
physical printer inprn-3left

PrinterSetupInjBASEAndT24-R10.01 33
To set a printer as a default printer you use command called SP-ASSIGN.
TRAINING is the form queue set as default which will further print to inprn-3left.

PrinterSetupInjBASEAndT24-R10.01 34
Syntax Elements
formqueue defines the name of the formqueue to which print jobs are queued.
The default formqueue is STANDARD.
options define the spooler assignment options which will be assigned to the
subsequent print jobs when queued to.? displays current assignment.
copies defines the number of copies of the print report data are required to be
output.

n defines the print report channel to be assigned in the range 0 to 127. The default
value for n is zero. If a print report channel is specified a formqueue must also be
specified.
0 is the default print report channel number. jBASE processors like jQL and jCL
produce print reports on print channel zero. The default PRINT statement will also
direct output to print report channel zero.
Print report channels 1-127 can be assigned by the SP-ASSIGN command and used
within jBASE programs to direct output to separate print reports simultaneously by
using the PRINT ON statement.
Print report channels 128-254 are reserved. Print report channel 255 is reserved for
log reporting by the jBASE Background Task Processor, jBTP.
A jspprint despooler dequeues print jobs from each assigned queuename.
The jBASE command jlp can also be used to print files directly or
from stdin.
e.g. jlp FileName echo Output | jlp

Unix
:SP-NEWTAB - Clear all spooler entries.
:REST-SPOOLER - Restart all spooler queues.

jsh r10NG ~ -->REST-SPOOLER

Restarting spooler for form queue TRAINING

FORM QUEUE TRAINING IS ALREADY ACTIVE


Spooler information can also be obtained directly using the
following jspstatus functions:

jspstatus 1 Display device information


jspstatus 2 Display print job information
jspstatus 3 Display assignment information
jspstatus 4 Display open job information
In above example a form queue named TRAINING is associated with logical device
called PROG which points to physical device called inprn-3left

PrinterSetupInjBASEAndT24-R10.01 38
SP-JOBS
Manipulates and displays status of print jobs.
COMMAND SYNTAX
SP-JOBS
NOTES
The SP-JOBS screen displays a list of print jobs together with their status and formqueue assignment. At
the bottom of the
screen 14 action codes are displayed. Each action code, except code 99, corresponds to a jBASE
command that performs the same
function.

Note: The SP-JOBS command displays only the print jobs associated with the jBASE spooler. The
command does not display information
about the UNIX spooler.
Print jobs can be filtered to display only those jobs generated from a specific port
number. At the Action Code / Options prompt,
enter PT followed by a port number.
For example,
Action Code / Options (P#; PT#; A acctname; Q queuename; S
status) : PT 42
will display the first page of print jobs generated from port 42.
Print jobs can be filtered to display only those jobs belonging to a specific form queue.
At the Action Code / Options prompt,
enter Q followed by a the name of a formqueue.

For example,
Action Code / Options (P#; PT#; A acctname; Q queuename; S
status) : Q TRG
will display the first page of print jobs belonging to the TRG form queue.
Print jobs can be filtered to display only those jobs with a specific STATUS. At the
Action Code / Options prompt, enter S
followed by a status of either QUEUED, PRINT, FINISH, OPEN, HOLD,KILLED or
EDIT. For example,
Action Code / Options (P#; PT#; A acctname; Q queuename; S status) :
S FINISH
will display the first page of print jobs whose current status is FINISH indicating all jobs
which have been completely despooled.
SP-FQDELETE
Deletes a formqueue.
PROMPT
QUEUE-NAME:
COMMAND SYNTAX
SP-FQDELETE formqueue
SYNTAX ELEMENTS
formqueue is the name of the formqueue to be deleted.
NOTES
A formqueue cannot be deleted if the formqueue is not empty or the formqueue is
assigned to logical device type.
The formqueue should be changed to a device type of zero and any print jobs either
deleted or reassigned to another formqueue. Any
processes currently assigned to the deleted formqueue will change to NO QUEUE and
any attempt to spool a job will display an error
message.
SP-PURGEQ
Purges a formqueue of a specific print or all print jobs. This command will delete the
print job or jobs irrespective of status.
If all jobs are requested the jspprint despool will also be stopped.
PROMPT
FORM-QUEUE PRINT JOB LIST (OR * FOR ALL):
COMMAND SYNTAX
SP-PURGEQ
NOTES
This command can only be run by root (Unix) or an Administrator (NT).
SP-SECURITY
This is a menu driven interface to the previously mentioned SPSECURITY-xx
commands. It is also available from option 11 of SPSTATUS.
When run, it presents the user with a screen that looks like this:
17:32:20 12 FEB 1998 SECURITY PAGE 1 OF 1 PAGES

QUEUE NAME Queue Job Queue Owners

STANDARD -none- -q.owners- lp greg jbase ted

1. QUEUE SECURITY 3. QUEUE OWNERS 5. RETURN TO SP-STATUS


2. JOB SECURITY 4. RETURN TO SP-JOBS 99. EXIT

ENTER ACTION CODE / PAGE NUMBER (P#) ?

QUEUE NAME
This is the name of the form queue.

QUEUE
This is the security for the form queue, and can be one of three possibilities:
-none- There is no security and any user can modify the definition of the form queue.
-q.owners- The security state is such that all the form queue owners shown in the field
"Queue Owners"
have permissions to modify the form queue.
No need worry if a form queue is down you can reassign form queue to a different
device.

PrinterSetupInjBASEAndT24-R10.01 46
Formqueue De-activation and Re-assignment
A formqueue can be de-activated and re-assigned to another available logical device
without having to be stopped and
restarted. After reassignment the next print job to be despooled will be directed to the
new logical device type.

For example, if formqueue REPORTS is despooling to logical device type PROG lp -d


lptr and you issue the command:

SP-DEVICE REPORTS PROG lp -d laser


the next and all subsequent print jobs will be output to the logical device PROG lp -d
laser. In other words, the command will
redirect REPORTS to the UNIX spooler lp for device name laser.
(1) User gives print command to print an enquiry or a deal slip
(2) A record in ENQUIRY.REPORT /DEAL.SLIP.FORMAT has been read and get the
id of REPORT.CONTROL
(3) Understands the FORM TYPE with the help of REPORT.CONTROL record id
(4) A record in DE.FORM.TYPE has been read loads from settings and understands
PRINTER.ID
(5) A record in PRINTER.ID has been read to obtain name of jBASE level form queue
(6) Associated device type has been searched with the form queue name in jBASE
(7) Based on the deice type which points further to a physical device to process the
print request
All these applications are involved to setup printer in T24.
Which is elaborated further as you go along.

PrinterSetupInjBASEAndT24-R10.01 49
(1) The PRINTER.ID application is used to define valid printers on the system.
(2) This application translates a logical printer name to the actual physical printer
defined at the Operating System level
(3) There exists a ‘SYSTEM’ record that is the default for all output from T24 if not
otherwise specified.
(4) Output could be sent to HOLD as well, instead of it being printed.
(5) The Prime Printer Id of the printer is the actual physical destination of the output. If
HOLD is specified, then output is not printed.

STEP 1
Applications to Spool the report to the formqueue created, let us assume the name of
the formqeue created is ‘TRAINING'.

From SP-STATUS output:

TRAINING PROG inprn-3left ASSIGNED 0 1


(1) This table defines the width and depth of each printed form (page layout).
(2) The printer to be used is also defined here.
(3) Printer id must be a valid record on the PRINTER.ID file.

STEP 2
Create a record in DE.FORM.TYPE with PRINTER.ID field set to the PRINTER.ID
record id created in step 1.
As the name suggests, this application has control of the printing of all reports in T24.
It links the enquiry report with the page layout and the printer details. All reports that
need to be produced by T24 must be defined here. This file contains the description of
the report; the printer environment, the date and time last produced and spooled etc.

(1) This table defines the FORM TYPE

STEP 3
Create a record in REPORT.CONTROL with FORM.NAME field set to the
DE.FORM.TYPE record id created in step 2.
Form Name must be a valid record on DE.FORM.TYPE
Spool entry gets generated in HOLD.CONTROL file which holds details of your report
which you have configured using REPORT.CONTROL.

PrinterSetupInjBASEAndT24-R10.01 53
The application that links the ENQUIRY application to the REPORT.CONTROL is the
ENQUIRY.REPORT application.
It contains the name of the ENQUIRY, selection criteria if required and the
REPORT.CONTROL id that is in charge of the actual print process.

STEP 4
Create an ENQUIRY.REPORT record and set the REPORT.CONTROL field to the
REPORT.CONTROL id created in step 3.

PrinterSetupInjBASEAndT24-R10.01 54
You can see why we get these spooler error messages and reason behind.

PrinterSetupInjBASEAndT24-R10.01 55
(1) Possible Causes
You used one of the following commands without specifying a print queue or printer device, and the
PRINTER and LPDEST environment variables specify nonexistent queues or devices:

cancel qadm
enq qcan
lp qpri
lpr qprt
lprm

Procedures for Recovery


Ensure that the PRINTER or LPDEST environment variables specify valid queue or printer names.

Note: The system checks the LPDEST environment variable first; if it is set, it is used. If the LPDEST
environment variable is not set, the PRINTER environment variable is checked.
Determine the name of existing queues or printers by issuing one of the following commands at the
command line:

lpstat
Lists all the queues and corresponding devices defined for the system.
lsallq
Lists all configured queues.
lsquedev
Lists all devices (printers) configured for a specified queue.

Change the value of the PRINTER or LPDEST environment variable in one of the following ways:

If you are in sh (Bourne) shell, enter one of the following commands:

PRINTER=NewValue; export PRINTER


OR

LPDEST=NewValue; export LPDEST


If you are in csh (C) shell, enter one of the following commands:

setenv PRINTER=NewValue
PrinterSetupInjBASEAndT24-R10.01 57
PrinterSetupInjBASEAndT24-R10.01 58
PrinterSetupInjBASEAndT24-R10.01 59
PrinterSetupInjBASEAndT24-R10.01 60

You might also like