Part_1 - Contents - Demo


Part_2 - Contents - Operating Instructions

Part_3 - Contents - PCL5 coding

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

Part_1. uvoverlay - concatenate laser printer overlay with data

Part 1 - Contents - Demo


1A1. Introduction & Background

1B1. Overlay Printing Demonstration
- uvadm subdirs relevant to overlay printing
- mockup of UV Software letterhead used for the demo

1B2. Files supplied for Overlay Demo
- files derived from MS WORD version of letterhead
  (manually coded version demo'd in Part_3)

1B3. Setup for Overlay Printing Demo

1C1. Op. Instrns. to Demo Overlay Printing

1C2. using 'pcloverlay' to convert '.prn' files to overlays

1C3. using 'uvoverlay' to set margins, cpi, lpi, etc for data file

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1A1. concatenate laser printer overlay with print data

Overlay Printing

Overlays can eliminate the need for pre-printed forms such as letterheads, tax notices, etc.

An 'overlay' is a file that is loaded into the memory of a laser printer, prior to sending a report file to the printer. When each formfeed is received, the overlay is superimposed upon the variable data for that page.

Background

The development of 'uvoverlay' was suggested by a customer. I had helped convert that site from a mainframe to unix in 2000. I returned in 2006 to help him move the JCL/scripts, programs,& data to new hardware.

When we converted in 2000, we had replaced the line printer with laser printers & we used the 'uvlist' scripts to get the mainframe style reports (with 132 columns & 66 lines) onto 8 1/2 by 11 3 hole punched paper.

In 2006 the customer asked if I could help him to use overlay printing & eliminate several preprinted forms (letterheads, tax notices, etc). The text data for these forms was generated by COBOL programs in his JCL/scripts & printed via 'uvlist' scripts.

I searched the web for unix programs to create overlays from forms created by Microsoft WORD & I found the 'pcloverlay' program, freeware downloadable from https://www.shady.com & 'kevin@shady.com'.

I then developed 'uvoverlay' to prepend the overlay with the report file. 'uvoverlay' does more than just concatenate the files, it allows you to specify laser printer options to adjust the report data. You can modify the cpi, lpi, margins, etc to match the overlay form you are printing.

Good example of Vancouver Utilities

Overlay printing is a good example of adding a new feature to your existing applications (of JCL/scripts & COBOL programs). Part_2 shows you how to add overlay printing to applications previously converted from a mainframe, using the directory structures, as documented at: https://www.uvsoftware.ca/mvsjcl.htm.

Even if you do not immediately need overlay printing, I am sure you will learn a lot by studying the procedures & directory setups used to implement an application such as this.

You might like to start by developing overlay printing for your own letterhead as shown in 'Part_1'.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1B1. uvoverlay.doc - Overlay Printing Demonstration

Overlay Printing Demonstration

This assumes that you have installed the Vancouver Utilities & setup your profile as documented in install.htm or in admjobs.htm.

We recommend setting up a 'uvadm' login account to administer Vancouver Utilities (unzip software, setup profiles, perform compiles, etc). Un-zipping the supplied uvadm.zip (or un-taring uvadm.tar) results in about 25 subdirs at /home/uvadm. The subdirs relevant to the overlay demo are:

 /home/uvadm/
 :-----bin       - binaries for programs (pcloverlay & uvoverlay)
 :-----doc       - documentation for all Vancouver Utilities (text files)
 :-----env       - profiles supplied for uvadm & users of Vancouver Utilities
 :--*--ovl    <-*- files supplied to demo Overlay Printing
 :-----src       - source for programs (pcloverlay.c & uvoverlay.c)
 :-----....      - about 20 other subdirs not shown
 :--*--tmp    <-*- use the tmp subdir for your output files

Note that 'pcloverlay.c' is a freeware program supplied by Kevin Smith (kevin@shady.com or https://www.shady.com). 'uvoverlay.c' is 1 of several Vancouver Utility C programs.

demo overlay supplied

Through out this documentation, we will use the UV Software letterhead as a basis for our overlay demos. Source files are supplied in /home/uvadm/ovl & there are 3 different names for this same letterhead.

uvlh1.pcl1
  • text with hand coded PCL5
uvlh2.doc
  • Microsoft WORD document
formxx.doc
  • MS WORD doc renamed as formxx.doc
  • for more generic operating instructions
 *============================================================================*
 |                          UV Software Inc.                                  |
 |  4667 Hoskins Rd., North Vancouver BC, Canada V7K2R3  tel: 604-980-5434    |
 |           Email: owen@uvsoftware.ca  Web: https://www.uvsoftware.ca         |
 *============================================================================*

The above is an attempt to show you what the UV Software letterhead looks like. We can not show you the 'real thing' (with various type sizes & bolding) because this documentation is 'all text' & usually all printed at 12 cpi. Note that this text documentation is maintained with the vi editor & automatically converted to HTML for the web site using HTMLjobs.htm.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1B2. uvoverlay.doc - Overlay Printing Demonstration

files supplied for Overlay Demo

The demo will convert the UV Software letterhead (MS WORD uvlh2.doc) to an overlay & then use that overlay with the uvoverlay program to print a few pages of text (actually some of this documentation).

Do not confuse uvlh2.doc (which is a MicroSoft Word .doc), with the other .doc files in /home/uvadm/doc (which are text files documenting Vancouver Utilties & converted to HTML for the web site).

Also note that there is a parallel series of files with base name 'uvlh1', which are derived from 'uvlh1.pcl', which is the same letterhead, but was manually coded in PCL5 (native HP printer language). These will be used in 'Part_3'.

/home/uvadm/ovl contains the following files to demo 'Overlay Printing'. 'uvlh2.*' files are used in Part_1. 'uvlh1.*' files are used in Part_3.

files derived from MS WORD version of letterhead

  1. uvlh2.doc - the UV Software letterhead (as an MS WORD .doc) - you can FTP to windows & create a .prn via 'print to file'

  2. uvlh2.prn - result of 'print to file' from uvlh2.doc & MS WORD - VITAL to use the LaserJet IIIP printer driver - do not need LJ IIIP hardware (just use 'print to file')

  3. uvlh2.ovl - output from 'pcloverlay', using uvlh2.prn as input

  4. uvlh_text - data file used to test overlay printing - actually a few pages of this documentation

  5. uvlh2_print - output from 'uvoverlay', created by concatenating 'uvlh2.ovl' + 'uvlh_text' = 'uvlh_print' - send to the printer via unix/linux 'lp uvlh_print' - OR, could pipe directly to lp from uvoverlay.

    formxx.... files

  6. formxx.doc - uvlh2.doc renamed as formxx.doc, used in Part 2 - for more generic operating instructions

  7. formxx.prn - same as uvlh2.prn, used in Part 2.

  8. formxx.ovl - same as uvlh2.prn, used in Part 2.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1B3. uvoverlay.doc - Overlay Printing Demonstration

Demo Overlay Printing

Part 1 allows you to test/demo overlay printing quickly with no extra setup required. You can run these demos as soon as you have installed the Vancouver Utilities & setup the profiles, as documented in install.htm or admjobs.htm.

But to prepare your own overlays, please use the Part_2 instructions to setup your own directories (do not operate in /home/uvadm). Please see admjobs.htm#Part_2 for the directory designs recommended for your testing & production.

Demo using /home/uvadm/ovl/...

For these Part 1 demos, you can operate in /home/uvadm/ using the 'ovl/...' test files described on the previous page, but please note:

  1. Do not modify the provided test files in /home/uvadm/ovl/... - so you can compare with your outputs in tmp/...

  2. Direct your output files into the 'tmp' subdir (/home/uvadm/tmp).

  3. Do not change into the subdirs (/home/uvadm/ovl or /home/uvadm/tmp).

  4. Remain in /home/uvadm (the working directory), so you can address input files in the 'ovl' subdir & direct your output files into 'tmp'.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1C1. uvoverlay.doc - Overlay Printing Demonstration

create uvlh2.prn on Windows or use supplied file ?

If desired, you can transfer the provided uvlh2.doc (MS WORD version of letterhead) over to windows, recreate the uvlh2.prn file,& transfer it back for conversion to uvlh2.ovl.

Or, you can skip the above & use the uvlh2.prn provided in /home/uvadm/ovl as your starting poiint.

Recreating uvlh2.prn on Windows (optional)

  1. Logon to a Windows PC

  2. Add a printer for the LaserJet IIIP (if not already present).

  3. FTP uvlh2.doc from unix/linux to Windows

  4. Add a printer for the 'LaserJet IIIP' (if not already present) - do not need the actual hardware, since we will 'print to a file'

  5. Open uvlh2.doc with MS WORD

  6. 'print to file' specifying LJ IIIP - name the output as 'uvlh2.prn' & save in a convenient subdir

  7. FTP the 'uvlh2.prn' file back to unix/linux

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1C2. uvoverlay.doc - Overlay Printing Demonstration

Demo 'pcloverlay' on unix/linux


 #1. Logon as uvadm --> /home/uvadm

 #2. rm tmp/*      <-- clear all files from the 'tmp' subdir
     ========        - except for 'uvlh2.prn' if transferred from Windows

 #3. Convert the letterhead .prn PCL5 file (from MS WORD 'print to file')
     to an overlay to be pre-pended to the variable data file
     Use 1 of 2 files:
     a. tmp/uvlh2.prn, if you recreated it on Windows & transferred back
     b. ovl/uvlh2.prn, if you skipped Windows recreate & use provided file

 #3a. pcloverlay <tmp/uvlh2.prn >tmp/uvlh2.ovl
      ========================================
      - convert uvlh2.prn recreated on windows & transferred back to tmp/...
                 - - - OR - - -

 #3b. pcloverlay <ovl/uvlh2.prn >tmp/uvlh2.ovl
      ========================================
      - convert uvlh2.prn demo file supplied in ovl/...
Note
  • We will present 4 alternative methods of printing (4a+5a, 4b, 4c+5c,& 4d)

alternative 'a' - cat to a file & lp separately


 #4a. cat tmp/uvlh2.ovl ovl/uvlh_text >tmp/uvlh_print
      ===============================================
      - concatenate the overlay with the data file

 #5a. lp tmp/uvlh_print   <-- print the concatenated file
      =================     - use this method for easier reprinting ?

alternative 'b' - cat to a file pipe directly to lp


 #4b. cat tmp/uvlh2.ovl ovl/uvlh_text | lp
      ====================================
      OR - concatenate the overlay + data & pipe directly to 'lp'
Note
  • problem with 4a & 4b is that you will lose the 1st few lines each page
  • because the letterhead will overlay the 1st few lines
  • unless you create about 8 blank lines at the top of each page

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1C3. uvoverlay.doc - Overlay Printing Demonstration

using 'uvoverlay' to provide margins, etc

alternative 'c' - uvoverlay concat/create file & lp separately


 #4c. uvoverlay tmp/uvlh2.ovl ovl/uvlh_text p50s1 m360j900 >tmp/uvlh_print
      ====================================================================
      - use uvoverlay to concatenate overlay with data & create output file
      - and also provide options for lines/page, spacing, margins, etc

 #5c. lp tmp/uvlh_print   <-- print the concatenated file
      =================     - use this method for easier reprinting ?
                            - or if you wish to examine the concatenated file
                            - to see the PCL5 codes inserted by uvoverlay

alternative 'd' - uvoverlay concat files & pipe directly to lp


 #4d. uvoverlay tmp/uvlh2.ovl ovl/uvlh_text p50s1 m360j900 | lp
      =========================================================
      - use uvoverlay to concatenate overlay with data & pipe directly to lp
      - uvoverlay also provide options for lines/page, spacing, margins, etc

options provided by uvoverlay

Note
  • 2 option groups (p50s1 = format options, m360j900 = laser-print options)
  • 2 groups must be separated by a space, but no spaces within a group
  • options are a lower-case letter, often followed by a numeric value
p50
  • print 50 lines per page
  • space 1 (the default, but could try s2)
m360
  • left margin offset right by 360/720 inch = 1/2 inch
  • top margin offset down by 900/720 inch = 1.25 inches
Note
  • if you don't need any group1 options, you can specify '-'
  • you don't necessarily need either group1 or group2 options
  • if you have blank lines to space down below the letterhead overlay
  • see more options in uvlist.htm
  • or https://www.uvsoftware.ca/uvlist.htm
  • uvoverlay options are the same as for uvlist

alternative 'e' - uvoverlay with no options & pipe to lp


 #4e. uvoverlay tmp/uvlh2.ovl ovl/uvlh_text | lp
      ==========================================

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

Part_2. Integrating Overlay Printing into Test & Production systems

Part 2 - Contents - Op. Instrns.


2A1. Implementing Overlay Printing

2B1. Libraries & Data directories for Production

2B2. Create New Overlay - on Windows to create .prn from .doc

2B3. Create New Overlay - on Unix/Linux to create .ovl from .prn

2B4. Testing the overlay - manually first

2C1. Integrating Overlay printing in JCL/scripts

2C2. uvlpPS18, script for laser printing Portrait/Simplex at 18cpi
- report file only, without overlay printing
- sample JCL/script jar170.ksh calls uvlpPS18

2C3. Inserting 'uvoverlay' into JCL/scripts
- replaces any 'uvlp' script (printing w/o overlay)

2C4. formxxPS18, sample script for overlay printing
- reduces coding required to call uvoverlay directly

2D1. jar170.ksh - JCL/script calling uvlpPS18 (non overlay laser print)

2D2. jar175.ksh - JCL/script calling formxxPS18 (overlay printing)

2D3. Manual changes required in jar175.ksh
- after conversion of supplied JCL to Korn shell script
- modifying options for margins, cpi, lpi, etc

2D4. Executing jar175.ksh calling formxxPS18

2E1. pcloverlayA - script to convert all prns/*.prn to ovls/*.ovl

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

2A1. Integrating Overlay printing into Test & Production

Overlay Printing - Implementation

Part_1 was a demonstration of overlay printing. Here in Part 2, we will show you how to integrate overlay printing into your current test & production environments.

We will assume that you are using the profiles & directory structures that are described in these Vancouver Utilities for mainframe conversions and operations on unix/linux systems.

Please see these profiles & directory structures described in parts 1 & 2 of ADMjobs.htm or https://www.uvsoftware.ca/admjobs.htm.

The profiles & directory designs provide programmers with a 'test' environment and operators with a 'production' environment, with no need to change any JCL/scripts or programs when they are moved from test to production.

This is accomplished by defining 2 critical environmental variables (RUNLIBS & RUNDATA) differently in the profiles of programmers & operators.

Programmer profiles might define RUNLIBS & RUNDATA as follows:


 export RUNLIBS=/p1/testlibs
 ===========================
 export RUNDATA=/p1/testdata
 ===========================

Operator profiles might define RUNLIBS & RUNDATA as follows:


 export RUNLIBS=/p2/prodlibs
 ===========================
 export RUNDATA=/p2/proddata
 ===========================

You can see more explanation in ADMjobs.htm. For our purpose of showing you how to implement overlay printing, we will show you the testlibs & testdata directories on the next page.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

2B1. Integrating Overlay printing into Test & Production

Here are illustrations of the directories used for testing & production.

The directories relevant to overlay printing (prns,ovls,rpts,rptsovls) have been emphasized via '<-*-'. If they are not currently present, you can make them now.

                         ** Libraries for Testing **
 /p1/testlibs
 :-----cbls           - COBOL program source
 :-----cblst          - cobol source listings from compiles
 :-----cblx           - compiled COBOL programs (.int's)
 :-----cpys           - converted, ready for compiles
 :-----jcls           - JCLs converted to Korn shell scripts
 :-----docs        <-*- .doc files input to MS WORD 'print to a file'
                      - don't need on unix, but might be backup for windows
 :-----prns        <-*- .prn files output from MS WORD 'print to a file'
 :-----ovls        <-*- overlays to print forms+data (see pcloverlay & uvoverlay)
 :-----pf             - uvcopy jobs to replace utilities (easytrieve,etc)
 :-----sf             - for misc scripts you may wish to write
 :-----sfun           - korn shell functions (jobset41,logmsg,etc)
 :-----tmp            - tmp subdir used by various conversions

DATA Directories for Testing

 /p1/testdata
 :-----ap           <-- directories created for topnodes of data filenames
 :-----ar               (Accounts Payable, Accounts Receivable, etc)
 :-----gl
 :-----py
 :-----jobctl       <-- working directories shared by all applications
 :-----joblog
 :-----jobtmp
 :-----rpts        <-*- reports created by COBOL programs
 :-----rptsovls    <-*- some reports can be printed with overlays
 :-----sysout
 :-----tmp
 :-----wrk

Libraries & Data directories for Production

 /p2/prodlibs
 :-----...            - other subdirs same as above
 :-----...
 :-----prns        <-*- .prn files from MS WORD 'print to a file' for overlays
 :-----ovls        <-*- overlays to print forms+data (see pcloverlay & uvoverlay)
 :-----...
 /p2/proddata
 :-----...
 :-----rpts        <-*- reports created by COBOL programs
 :-----rptsovls    <-*- some reports can be printed with overlays
 :-----...

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

2B2. Integrating Overlay printing into Test & Production

Creating a New Overlay

Assume we want to create a new overlay for 1 of our existing reports.

We will base this example on 1 of the JCL/scripts supplied with the Vancouver Utilities conversion package (in /home/uvadm/mvstest/jcl0/JAR100).

This job creates a customer name & address list & we might want to create customized page headings & borders, etc. To keep our example generic, we will call our new form/overlay 'formxx'.

We will first document how we might create the new overlay & test it manually using command line instructions. Then we will document how to update the existing JCL/script to automatically print the report with the overlay.

Create New Overlay - on Windows MS WORD

  1. Use MS WORD to create your desired form. For these instructions, we called our sample form formxx.htm.

Note
  • as a demo, you can just use /home/uvadm/ovl/formxx.doc
  • transfer it over to windows, create formxx.prn,& transfer it back
  1. If not already performed, 'add a printer' for the LaserJet IIIP.

  2. Open formxx.doc & 'print to a file' (selecting the LJ IIIP driver).

  3. Transfer the resulting 'formxx.prn' to the unix/linux system. - store in the prns/... subdir of your /p1/testlibs (or whatever)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

2B3. Integrating Overlay printing into Test & Production

Create the Overlay - on Unix/Linux

  1. Login to unix/linux (using your login or appsadm). The following assumes the profiles & directories have been setup as described in part 1 & 2 of ADMjobs.htm. We will create & test our overlay in testlibs & later transfer it to prodlibs.


 #6. cdl              <-- change to the testlibs superdir
     ===                - see subdirs illustrated on page '2B1'
                          (cdl is an alias in our profile)
     cd /p1/testlibs  <-- 'cdl' is an alias for this
     ===============

 #7. mkdir prns ovls   <-- make these subdirs if not already present
     ===============

 #8. cp ???/formxx.prn prns  <-- copy the form from Windows into subdir 'prns'
     ======================

 #8a. cp /home/uvadm/ovl/formxx.prn prns  <-- OR just use supplied formxx.prn
      ==================================

 #9. pcloverlay <prns/formxx.prn >ovls/formxx.ovl
     ============================================
     - create the overlay from the print file

 #9a. pcloverlayA prns ovls   <-- convert all prns/*.prn to ovls/*.ovl
      =====================     - see script listed on page '2E1'

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

2B4. Integrating Overlay printing into Test & Production

test the overlay - manually 1st

We will assume that there is a report already present in the 'rpts' subdir of our testdata superdir (full path would be: /p2/testdata/rpts/customer.names).


 #10. cdd              <-- change to the testdata superdir
      ===                - see subdirs illustrated on page '2B1'
                           (cdd is an alias in our profile)
      cd /p1/testdata  <-- 'cdd' is an alias for this
      ===============

 #11. mkdir rptsovls   <-- make subdir for reports with overlays
      ==============     - not required if you pipe directly to the printer

 #12. uvoverlay $RUNLIBS/ovls/formxx.ovl rpts/customer.names
      ======================================================
                >rptsovls/customer.names
                ========================
      - use 'uvoverlay' to prepend the overlay to the report file
      - redirecting output to rptsovls, in case we wish to reprint
        (or investigate the changes made by uvoverlay)

 #13. lp rptsovls/customer.names     <-- print the report
      ==========================

alternative printing method

Unless you want to examine the file created by uvoverlay, you might as well pipe directly to the printer from the uvoverlay program. You will probably also need to use the options provided by uvoverlay (for margins, etc).


 #12a. uvoverlay $RUNLIBS/ovls/formxx.ovl rpts/customer.names - m360j900
       =================================================================
                 | lp $UVLPDEST
                 ==============
Note
  • the '-' must be used when you would otherwise have no group1 options.
  • the group2 options (m360j900) mean the following:
m360j900
  • means left margin offset right 360/720 inch
  • means top margin offset down 900/720 inch

Options are in 2 groups (page-format options & laser-printing options). Some other examples of group1 & group2 options are:

group1 options: p50s2 - 50 lines per page, space 2

group2 options: c14v6 - 14 cpi & 8 lpi

'v6' specifies lpi as 6/48", so 1 inch has 48/6 = 8 lines per inch

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

2C1. Integrating Overlay printing into Test & Production

Integrating Overlay printing in JCL/scripts

Please see MVSCOBOL.htm or https://www.uvsoftware.ca/mvscobol.htm for examples of JCL/scripts & COBOL programs that we can use to illustrate implementing overlay printing.

In particular, please see the following pages in MVSCOBOL.htm:

 2D1 - sample COBOL program BEFORE conversion from mainframe
 2D2 - sample COBOL program AFTER conversion to unix/linux for Micro Focus
 2F1 - sample JCL BEFORE conversion from mainframe
 2F2 - sample script AFTER conversion to unix/linux script
 2G1 - sample input file & output report

The JCL/script referred to above is for jar100.ksh & the COBOL program is car100.cbl. The JCL/script we will use for our demo is jar170.ksh, which is very similar to jar100.ksh & it calls the same COBOL (car100.cbl).

You can see the entire script for jar100.ksh listed at MVSCOBOL.htm#2F2, but here we will show only the essential lines for the COBOL step that writes the report file.

JCL/script jar170.ksh BEFORE Overlay Printing added

 exportfile CUSTMAS ar/customer.master   #<-- input data file
 exportfile NALIST rpts/customer.names   #<-- output report file
 #3-----------------------------------
 cobrun $ANIM $RLX/car100                #<-- COBOL program execution
 #4-----------------------------------
 uvlpPS18 $NALIST                        #<-- script to print report on laser
 #===============

We will show you the 'JCL/script AFTER Overlay Printing added' 2 pages ahead, But first we want to explain the 'uvlpPS18' script on the next page.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

2C2. Integrating Overlay printing into Test & Production

Notes re uvlpPS18

'uvlpPS18' is a script (calling 'uvlist') that is often used at conversion sites to print mainframe style reports (132 cols wilde, 66 lines deep) on 8 1/2 x 11 paper. The script specifies options to uvlist for 18 cpi, 8 lpi,& margin offsets to allow for 3 hole punced paper.

You can see the entire script listed at uvlist.htm#X9, but here is the 1 line that calls uvlist with the desired options:


 uvlist $1 hp88d2$2 a2c18p88m300j000,v=5.6,$3 | lp $UVLPDEST
 #==========================================================

uvlist accepts 3 arguments as follows:

arg1
  • $1 is of course the fieldname to be printed
arg2
  • group1 options: page formating excluding laser options
arg3
  • group2 options: laser printing options
 group1: h     = inhibit uvlist page headings (for mainframe rpts)
         p88   = 88 lines per page
         d2    = reduce multiple blank lines to 2 max
         $2    = for any options spcfd on cmd line (adds or overrides)
 group2: a2    = letter size paper
         c18   = 18 cpi = 132 chars across on 8 1/2" wide
         p88   = 88 lines per page
         m000  = top margin offset 000/720 inch (no change to default margin)
         m300  = left margin offset 300/720 inch (for 3 hole punches)
         v=5.6 = vertical spacing = 5.6/48" = 8.2 lines/inch

See more options explained at uvlist.htm#C1

uvlist output is piped to 'lp $UVLPDEST'. UVLPDEST is the destination printer & might be defined in the profile as follows:


 export UVLPDEST="-dlp0"
 #======================

Note that the printer name is 'lp0', but you must precede this with the '-d' option identifier.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

2C3. Integrating Overlay printing into Test & Production

JCL/script jar170.ksh AFTER Overlay Printing added

 exportfile CUSTMAS ar/customer.master   #<-- input data file
 exportfile NALIST rpts/customer.names   #<-- output report file
 #3-----------------------------------
 cobrun $ANIM $RLX/car100                #<-- COBOL program execution
 #4-----------------------------------
 ## uvlpPS18 $NALIST       <-- remove or #comment out 'uvlist' script
 #                           - add uvoverlay command as follows:
 uvoverlay $RUNLIBS/ovls/formxx.ovl $NALIST \
           hp88d2$2 a2c18p88m300j000,v=5.6,$3 | lp $UVLPDEST
 #==========================================================

Note that we have used the '\' to continue the command on the next line.

You can see that if we use the 'uvoverlay' program directly, we need a very long command line with complex options.

We could write a 'script' for the 'uvoverlay' program (similar to the script 'uvlpPS18' we used for the 'uvlist' program). Writing a script is especially beneficial if we need to use it in several JCL/scripts - it shortens the command to invoke it & it simplifies option changes (only need to be made in 1 place).

The new script is 'formxxPS18' & it replaces the 2 lines above with:


 formxxPS18 $NALIST
 #=================

See 'formxxPS18' script listed on the next page -->

After formxxPS18, we will show you a complete JCL/script (jar175.ksh) that calls formxxPS18 instead of calling uvoverlay directly.

See 'jar175.ksh' (calling formxxPS18) listed 2 pages ahead -->

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

2C4. Integrating Overlay printing into Test & Production

formxxPS18 - script to call uvoverlay

 #!/bin/ksh
 # formxxPS18 - Korn shell script from UVSI stored in: /home/uvadm/sf/util/
 # formxxPS18 - load overlay 'formxxPS18' & prints report file at 18 cpi & 7 lpi
 #            - Portrait, Simplex on 8 1/2 x 11
 #            - allows 132 chars across & 66 lines down
 #
 #usage: formxxPS18 filename [group1] [group2]  <-- may override default options
 #       =====================================
 #
 # This script is based on 'uvoverlay' (a Vancouver Utility C program)
 # - see uvoverlay.htm or https://www.uvsoftware.ca/uvoverlay.htm
 # - uvoverlay is similar to 'uvlist', with the addition of the 'overlay'
 # - see uvlist.doc for group1(file) & group2(laser printer) default options
 #
 #   group1: h      = inhibit uvlist page headings (for mainframe rpts)
 #           p88    = 88 lines per page (but *eject or ^L will occur before)
 #           d2     = reduce multiple blank lines to 2 max
 #           $2     - allows additional options on command line, for example:
 #           b50e60 = Begin print at page 50 & End print at page 60
 #
 #   group2: a2     = letter size paper
 #           c18    = 18 cpi = 132 chars across on 8 1/2" wide
 #           v=5.6  = vertical spacing = 5.6/48" = 8.2 lines/inch
 #           m300   = left margin offset 300/720 inch (for 3 hole punches)
 #           j900   = top margin offset 900/720 = 1.25 inch
 #           ****   - vital for data lines to follow overlay headings <---****
 #           $3     - allows additions/overrides on command line, for example:
 #           c14    = 14 cpi, modify default 18cpi if you only need 108 chars
 #
 # .profile should specify environmental variables for 'lp', for example:
 # export UVLPDEST="-dlp0"       #<-- destination 'lp0' ("-dLPT1" for SFU)
 # export UVLPDEST=""            #<-- null to use lpadmin default
 # export UVLPOPTN="-onobanner"  #<-- 'nobanner' option for lp
 # export UVLPOPTN=""            #<-- null disable for Windows SFU
 #
 #
 if [[ ! -f "$1" ]]; then
    echo "ERROR - arg1 $1 must be a report file"; exit 1; fi
 #
 uvoverlay $RUNLIBS/ovls/formxx.ovl $1 \
           hp88d2$2 a2c18p88m360j900,v=5.6,$3 | lp $UVLPOPTN $UVLPDEST
 #====================================================================
 exit 0
 #

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

2D1. Integrating Overlay printing into Test & Production

jar170.ksh - JCL/script calling uvlpPS18

 #!/bin/ksh
 ##JAR170   JOB  'ksh conversion demos print scripts uvlpPS18
 export JOBID2=JAR170; scriptpath="$0"; args="$*"
 if [[ -z "$JOBID1" ]]; then JOBID1=JAR170; fi; export JAR170
 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
 integer JCC=0 SCC=0 LCC=0  # init step status return codes
 autoload jobset51 logmsg1 logmsg2 exportgen0 exportgen1 exportgenp
 autoload exportgenx exportgenall exportfile stepctl51 stepctl52
 jobset51  # call function for JCL/script initialization
 #jobset51 stores any restart step# in alias 'goto' (must be last on line)
 goto
 S0000=A
 #1======================= begin step#S0010 CAR100 ========================
 S0010=A
 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 logmsg1 "Begin Step $JSTEP car100 (#$XSTEP)"
 ##STEP010  EXEC PGM=CAR100,PARM=2006
 export PROGID=car100
 export PARM="2006"
 exportfile CUSTMAS ar/customer.master
 exportfile NALIST rpts/customer.names
 exportfile SYSOUT $SYOT/${JSTEP}_SYSOUT
 #3----------------------------------------------------------------------
 cobrun $ANIM $RLX/car100
 #4----------------------------------------------------------------------
 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
 if ((S0010C != 0))
    then logmsg1 "step#$JSTEP car100 abterm $SCC"
    alias goto="<<S9900=A"; fi
 goto
 # * This job demos 'uvlpPS18' - laser print script calling 'uvlist'
 # * - with options for mainframe reports 132 cols & 66 lines on 8.5x11
 # * - options for 18 cpi, 7 lpi,& margin offsets for 3 hole punched
 # * Manual change after conversion from JCL to Korn shell script
 # * - move uvlpPS18 down after COBOL step status test (btwn goto & #*=)
 uvlpPS18 $NALIST   #<-- call laser print script (calls uvlist)
 #8======================================================================
 S9000=A
 uvtime W1D4 $JTMP/jobend $JTMP/jobbgn $JTMP/jobtimes
 logmsg1 "JobEnd=Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP"
 exit 0  #jclunix51 ver: 20060717  options: b0c0d0g15i1j0l20m1n3p0r0s0t1u0w0x0y0z0
 #9======================================================================
 S9900=A
 uvtime W1D4 $JTMP/jobend $JTMP/jobbgn $JTMP/jobtimes
 logmsg2 "JobEnd=Abnorm,JCC=$JCC,StepsEx=$XSTEP,LastStep=$JSTEP" RV
 exit $JCC

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

2D2. Integrating Overlay printing into Test & Production

jar175.ksh - JCL/script calling formxxPS18

 #!/bin/ksh
 ##JAR175   JOB  'ksh conversion demos overlay print script formxxPS18
 export JOBID2=JAR175; scriptpath="$0"; args="$*"
 if [[ -z "$JOBID1" ]]; then JOBID1=JAR175; fi; export JAR175
 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
 integer JCC=0 SCC=0 LCC=0  # init step status return codes
 autoload jobset51 logmsg1 logmsg2 exportgen0 exportgen1 exportgenp
 autoload exportgenx exportgenall exportfile stepctl51 stepctl52
 jobset51  # call function for JCL/script initialization
 #jobset51 stores any restart step# in alias 'goto' (must be last on line)
 goto
 S0000=A
 #1======================= begin step#S0010 CAR100 ========================
 S0010=A
 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 logmsg1 "Begin Step $JSTEP car100 (#$XSTEP)"
 ##STEP010  EXEC PGM=CAR100,PARM=2006
 export PROGID=car100
 export PARM="2006"
 exportfile CUSTMAS ar/customer.master
 exportfile NALIST rpts/customer.names
 exportfile SYSOUT $SYOT/${JSTEP}_SYSOUT
 #3----------------------------------------------------------------------
 cobrun $ANIM $RLX/car100
 #4----------------------------------------------------------------------
 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
 if ((S0010C != 0))
    then logmsg1 "step#$JSTEP car100 abterm $SCC"
    alias goto="<<S9900=A"; fi
 goto
 # * This job demos 'formxxPS18' script prepend overlay with report file
 # * formxxPS18 - calls uvoverlay to prepend formxx.ovl with report file
 # * - with options for 18 cpi & 7 lpi for 132 cols & 66 lines on 8.5x11
 # * Manual Changes Required after conversion from JCL to Korn shell script
 # * - move formxxPS18 down after COBOL step status test (after goto)
 # * - add grp1 option 'p40' for 40 lines/page
 # * - add grp1 option 's2' to double space report
 # * - add grp2 option 'c12' for 12 cpi (override script 18 cpi default)
 # * - add grp2 option 'j980' top margin 980/720" (override script dflt)
 formxxPS18 $NALIST p40s2 c12j980 #<-- call form overlay script
 #8======================================================================
 S9000=A
 uvtime W1D4 $JTMP/jobend $JTMP/jobbgn $JTMP/jobtimes
 logmsg1 "JobEnd=Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP"
 exit 0  #jclunix51 ver: 20060717  options: b0c0d0g15i1j0l20m1n3p0r0s0t1u0w0x0y0z0
 #9======================================================================
 S9900=A
 uvtime W1D4 $JTMP/jobend $JTMP/jobbgn $JTMP/jobtimes
 logmsg2 "JobEnd=Abnorm,JCC=$JCC,StepsEx=$XSTEP,LastStep=$JSTEP" RV
 exit $JCC

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

2D3. Integrating Overlay printing into Test & Production

Manual changes to jar175.ksh

Please see the note at line 34 in the jar175.ksh listing above:

 # * Manual Changes Required after conversion from JCL to Korn shell script
 # *   - move formxxPS18 down after COBOL step status test (after goto)

I embedded the call to formxxPS18 in the JCL before conversion on a '// PASS'. It then ends up out of place in the converted script, so I added the other comment lines to instruct you how to relocate tot he proper place, following the COBOL step that creates the report file.

formxxPS18 script saves coding vs uvoverlay

Script 'formxxPS18' was written to reduce the coding required when you call 'uvoverlay' directly.


 formxxPS18 $NALIST      #<-- call form overlay script
 #=================
Note
  • above call to formxxPS18 is the same as calling uvoverlay as below:
 uvoverlay $RUNLIBS/ovls/formxx.ovl $1 \
           hp88d2$2 a2c18p88m300j000,v=5.6,$3 | lp $UVLPOPTN $UVLPDEST
 #====================================================================

You can easily appreciate the advantage of using scripts to call uvoverlay If you need an overlay script in several different JCL/scripts, it will be much easier to make any changes you may need in future, because you can make the change in 1 place.

overlay scripts pass options to uvoverlay program

Also note that these scripts can be written to pass options thru to the uvoverlay program, for example:


 formxxPS18 $NALIST p40s2 c12j980  #<-- options will be passed to uvoverlay
 #==================*****=*******
group1 option 'p40'
  • 40 lines/page
group1 option 's2'
  • double space report
group2 option 'c12'
  • 12 cpi (override script 18 cpi default)
group2 option 'j980
  • top margin 980/720" (override script dflt)

formxxPS18 was written to print mainframe report maximums (132 cols x 66 lines). But JCL/script jar175.ksh & COBOL program car100.cbl were using only 96 print positions, so we coded option 'c12' to allow larger type & make the report easier to read.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

2D4. Integrating Overlay printing into Test & Production

Executing jar175.ksh calling formxxPS18

To execute jar175.ksh, you must have setup the test/demo system as shown in Part 1 of MVSJCL.htm#1A1 or https://www.uvsoftware.ca/mvsjcl.htm#1A1.

You must also setup your profile as shown in install.htm or even better at ADMjobs.htm or https://www.uvsoftware.htm/admjobs.htm. Copy the supplied /home/uvadm/env/stub_profile to your .profile for Korn shell users or .bash_profile for Bash users. Change the definition of 'UVLPDEST' to your laser printer, for example:


 export UVLPDEST=-dlaserxx   #<-- see line 115 in /home/uvadm/env/stub_profile
 #========================

Part_1 of MVSJCL.doc instructs you to setup user 'mvstest' (with homedir /home/mvstest) & copy over the supplied set of test/demo JCLs, COBOL programs, & DATA files from /home/uvadm/mvstest. Then you must run the procedures to convert the supplied JCL to Korn shell scripts & convert/compile the COBOL programs.

If you have done all the above, then you can:


 #1. login as mvstest --> /home/mvstest

 #2. Make the 1 manual change as described on page '2D3' above.

 #3. jar175.ksh      <-- execute overlay test/demo job
     ==========

This should print the name & address list using the supplied overlay 'formxx.ovl' (which is the UV Software letterhead renamed from uvlh2.ovl).

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

2E1. Integrating Overlay printing into Test & Production

pcloverlayA - script to convert all .prns to .ovls

 #!/bin/ksh
 # pcloverlayA - convert All print files to overlay files
 #             - by Owen Townsend, UV Software, October 2006
 #
 # - print files created by 'print to file' from MS WORD, Excel, etc
 # - overlay files to be prepended to reports for laser printings
 #
 if [[ -d "$1" && -d "$2" ]]; then :
    else echo "usage: pcloverlayA indir outdir  <-- 2 args must be subdirs"
         echo "       ========================"
         echo "example: pcloverlayA prns ovls"
         echo "         ====================="
         exit 1; fi
 #
 x=0
 for dfx in $1/*.prn
   { fx=$(basename $dfx)
     f=${fx%\.*}
     pcloverlay <$1/$f.prn >$2/$f.ovl
     #===============================
     let x=x+1
     echo "$x: pcloverlay <$1/$f.prn >$2/$f.ovl"
   }
 echo "$x files converted from $1 to $2"
 exit 0

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

Part_3. uvoverlay.doc - Manually coding PCL5

Part 3 - Contents - PCL5 coding


3A1. Manually coding PCL5, Introduction
- might use for simple forms (like letterheads)

3B1. Files supplied to demo manually coded PCL5
- based on uvlh1.pcl1 (UV Software letterhead)

3B2. Op Instrns - create uvlh1.ovl & demo printing

3C0. Investigating 'uvlh1*' files with 'uvhd'
- uvlh1.pcl1, uvlh1.pcl, uvlh1.ovl, uvlh1_text, uvlh1_print

3C1. uvlh1.pcl1 - the UV Software letterhead, manually coded in PCL5
- using '!'s pseudo escapes, later converted to true escapes

3C2. uvlh1.pcl - the UV Software letterhead, manually coded in PCL5
- with '!' pseudo escapes converted to true escapes (x'1B's)

3C3. uvlh1.prn <-- there is NO '.prn' file for manually coded overlays
- since MS WORD is not used & there is no 'print to file' output
- uvlh1.pcl is the input to pcloverlay to create uvlh1.ovl

3C4. uvlh1.ovl - output from 'pcloverlay', from uvlh1.pcl as input

3C5. uvlh_text - data file used to test overlay printing
- 2 pages of text from this documentation

3C6. uvlh1_print - output from 'uvoverlay', created by concatenating
'uvlh1.ovl' + 'uvlh_text' = 'uvlh1_print'

3D1. PCL5 codes described
- PCL5 codes used in print files w/o overlay
- PCL5 codes inserted at begin overlay
- PCL5 codes inserted at end overlay

3E1. uvlh2.ovl - uvhd hexdump of 1st 512 & last 512 of this 12,997 byte file
- shows the difference from hand coded uvlh1.ovl (only 363 bytes)

3F1. Modifying Overlays with 'uvhd'
- shift form left/right &/or up/down

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3A1. Manually coding PCL5 Documents & Overlays

Introduction to Part 3

Part_3 will illustrate how PCL5 can be manually coded to create documents & overlays for printing on PCL5 compatible laser printers. You probably wont want to do this, but this will give you some understanding of PCL5 codes & perhaps help you to investigate & diagnose problems that you might have with complex forms.

We will illustrate PCL5 coded documents, using the 'uvhd' utility which displays binary files such as these in 'vertical hexadecimal'. When & if you have problems with your overlays, you might be able to fix the problems with 'uvhd' (if you gain some understanding of PCL5 codes).

If you wish to learn more about PCL5 codes, I recommend you the following books:

  1. PCL5 Printer Language - Technical Reference - Manual Part# 5961-0509

  2. PCL5 Comparison Guide - Manual Part# 5961-0702

We will base the Part 3 demos on 'uvlh1.pcl1' which is supplied in /home/uvadm/ovl/...

First, we will present the Operating Instructions that you could use to convert the manually coded uvlh1.pcl1 to an overlay, and then use it to print a test file.

Then, we will illustrate & explain some of the PCL5 codes relevant to PCL5 documents & overlays.

Here is a summary of the files used to demo manually coded PCL5 documents & overlays - supplied in /home/uvadm/ovl/...

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3B1. Manually coding PCL5 Documents & Overlays

uvlh1... demo files supplied

  1. uvlh1.pcl1 - the UV Software letterhead, manually coded in PCL5 - using '!'s pseudo escapes, later converted to true escapes

  2. uvlh1.pcl - the UV Software letterhead, manually coded in PCL5 - with '!' pseudo escapes converted to true escapes (x'1B's)

  3. uvlh1.prn - NOT present, since we have manually coded the overlay - instead of using MS WORD to create a .doc - and instead of using 'print to file' to create '.prn' output

  4. uvlh1.ovl - output from 'pcloverlay', using uvlh1.pcl as input

  5. uvlh_text - data file used to test overlay printing - 2 pages of text from this documentation

  6. uvlh1_print - output from 'uvoverlay', created by concatenating 'uvlh1.ovl' + 'uvlh_text' = 'uvlh1_print'

    Demo with manually coded PCL5

You can run these demos in the /home/uvadm/ directory, but please:

  1. Do not change any of the supplied files in /home/uvadm/ovl/...

  2. Any files you create should be in the 'tmp' subdir (/home/uvadm/tmp) - clean out tmp (rm -f tmp/*) at the begining of a demo session

  3. Stay in /home/uvadm/. (the working directory)

  4. Do not change into /home/uvadm/ovl

  5. Address all files with the subdir prepended

Of course you could copy uvlh1.pcl1 to your own home or other directory & run the demos anyway you wish, but the above is trying to promote good working habits for unix & linux systems.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3B2. overlay printing with Manually coded PCL5

Op Instrns - create uvlh1.ovl & demo printing


 #1. login as uvadm --> /home/uvadm

 #2. rm -f tmp/*        <-- clean out the 'tmp' subdir
     ===========

 #3.  sed -e"s/\!/\x1B/g" ovl/uvlh1.pcl1 >tmp/uvlh1.pcl
     ==================================================
     - convert the '!'s used in manually coded PCL5 documents to real escapes
     - I use '!'s when hand coding PCL5 codes (to keep the document all text)
       ('vi' editor could create escapes via insert '^V' + '^L')
     - the '!'s must be converted to true escapes x'1B's before processing
Note
  • since the 'sed' command above is not 'user friendly'
  • I have supplied a script 'sedescape' (/home/uvadm/sf/demo/sedescape)

 #3a. sedescape ovl/uvlh1.pcl1 >tmp/uvlh1.pcl
      =======================================
      - alternate (easier) way to convert '!'s to true escapes x'1B's
  1. uvlh1.prn - NOT present, since we have manually coded the overlay - instead of using MS WORD to create a .doc - and instead of using 'print to file' to create '.prn' output

  2. Note that there is a step missing here compared to creating overlays from an MS WORD document where we would create a '.prn' file by the 'print to file' option in MS WORD & transfer the .prn file to unix.


 #5. pcloverlay <ovl/uvlh1.pcl >tmp/uvlh1.ovl
     ========================================
     - convert the PCL5 manually create '.pcl' file to an overlay
     - to an overlay to be pre-pended to the variable data file

 #6. uvoverlay ovl/uvlh1.ovl ovl/uvlh_text - m360j900 >tmp/uvlh1_print
     =================================================================
     - use uvoverlay to concatenate overlay with data & create output file
     - option 'm360' offsets left margin right 360/720 = .5 inch
     - option 'j900' offsets top margin down 900/720 = 1.25 inch
     - uvoverlay accepts 2 groups of options (format-options & laser-options)
     - '-' means group1 omitted, p50s1 would mean 50 lines/page & space 1
     - options are lower case letters + numeric digits with no spaces between

 #7. lp tmp/uvlh1_print  <-- print the concatenated file
     ==================    - so you can examine the concatenated file with uvhd
                           - to see the PCL5 codes inserted by uvoverlay

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3C0. overlay printing with Manually coded PCL5

Investigate 'uvlh1*' files with 'uvhd'

Note
  • the 'uvhd' printouts will be presented on the following pages.

 3C1. vi ovl/uvlh1.pcl1      <-- investigate the original letterhead file
     =================        - using '!'s to represent true escapes
                              - can use vi or cat, since this file is all text

 3C2. uvhd ovl/uvlh1.pcl s3  <-- investigate supplied PCL5 coded letterhead
     =====================    - '!'s were converted to x'1B's with 'sed'
     --> i2 <-- Immediately Print 2 blocks (of 256 bytes in vertical hex)

3C3. Note that there is no '.prn' file for manually coded overlays
- since MS WORD is not used & there is no 'print to file' output

 3C4. uvhd ovl/uvlh1.ovl s3  <-- investigate the output of pcloverlay
     =====================
     --> i2 <-- print 2 blocks (file now 364 bytes, 29 bytes added by pcloverlay)

3C5. 'uvlh_text' input data file is not listed
- since it is simply 2 pages of text from this documentation

 3C6. uvhd ovl/uvlh1_print   <-- investigate the
     ====================
     --> i2 <-- print 1st 2 blocks (file now 2803, text appended by uvoverlay)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3C1. File Investigation Results - Manually coded PCL5 Overlays

uvlh1.pcl1 - original file created with vi

This is the original source file for my letterhead, which I created with the 'vi' editor. As a convenience, I coded escape characters as '!'s, which I later converted to true escapes with 'sed' (see Op Instrns above).


 cat ovl/uvlh1.pcl1    <-- display original letterhead (coded with 'vi')
 ==================
 !E!&l0O!&l01X!&l200u-100Z!&k2G
 !&a0h0V!*c5400h800v0P
 !&a25h25V!*c5350h750v1P
 !&l300u-00Z!(s1P!(s30V!(s3B!(s4101T
                  UV Software Inc. !(s12V!&l12C
                 4667 Hoskins Rd., North Vancouver BC, Canada V7K2R3  tel: 604-980-5434
                               Email: owen@uvsoftware.ca  Web: https://www.uvsoftware.ca
 *============================================================================*
 |                          UV Software Inc.                                  |
 |  4667 Hoskins Rd., North Vancouver BC, Canada V7K2R3  tel: 604-980-5434    |
 |           Email: owen@uvsoftware.ca  Web: https://www.uvsoftware.ca         |
 *============================================================================*

The above is an attempt to show you what the UV Software letterhead looks like when it is printed with the PCL5 codes interpreted by the laser printer.

We can not show you the 'real thing' (with various type sizes & bolding) because this documentation is 'all text' & usually all printed at 12 cpi. Note that this text documentation is maintained with the vi editor & automatically converted to HTML for the web site using HTMLjobs.htm.

The '!'s (pseudo escapes) can be converted to x'1B's (true escapes) using 'sed' as shown on page '3B2' & repeated here for your convenience


 #3.  sed -e"s/\!/\x1B/g" ovl/uvlh1.pcl1 >tmp/uvlh1.pcl
     ==================================================

 #3a. sedescape ovl/uvlh1.pcl1 >tmp/uvlh1.pcl
      =======================================
      - alternate (easier) way to convert '!'s to true escapes x'1B's

Please see the result listed on the next page, using 'uvhd' since the file now contains binary characters not shown by vi, cat, etc.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3C2. File Investigation Results - Manually coded PCL5 Overlays

uvlh1.pcl - with '!'s converted to x'1B's


 #2. uvhd ovl/uvlh1.pcl s3  <-- investigate supplied PCL5 coded letterhead
     =====================    - '!'s were converted to x'1B's with 'sed'
     --> i2 <-- Immediately Print 2 blocks (of 256 bytes in vertical hex)
                      10        20        30        40        50        60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 .E.&l0O.&l01X.&l200u-100Z.&k2G..&a0h0V.*c5400h800v0P..&a25h25V.*
             1412634126335126333723335126340126363512633336333735012633633512
             B5B6C0FB6C018B6C2005D100AB6B27AB610806BA354008800600AB61258256BA
          64 c5350h750v1P..&l300u-00Z.(s1P.(s30V.(s3B.(s4101T.
             6333363337350126333723351273512733512734127333350222222222222222
             353508750610AB6C3005D00AB8310B83306B8332B8341014A000000000000000
         128   UV Software Inc. .(s12V.&l12C.                4667 Hoskins Rd.
             2255256677676246622127335126334022222222222222223333246766672562
             005603F64712509E3E0B83126B6C123A0000000000000000466708F3B9E3024E
         192 , North Vancouver BC, Canada V7K2R3  tel: 604-980-5434.
             2246776256666776724422466666253435322766323332333233330222222222
             C0EF248061E3F5652023C031E141067B2230045CA0604D980D5434A000000000
                      10        20        30        40        50        60
 r#        2 0123456789012345678901234567890123456789012345678901234567890123
         256                      Email: owen@uvsoftware.ca  Web: https://www.
          64 uvsoftware.ca.

notes re relevant PCL5 codes

Please see the HP PCL5 manuals if you wish to understand the usual PCL5 codes.

On page '3C4' we will discuss PCL5 codes relevant to overlays & that are inserted by 'pcloverlay'.

On page '3C5' we will discuss PCL5 codes that are modified by 'uvoverlay'.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3C3. File Investigation Results - Manually coded PCL5 Overlays

uvlh1.prn - result of 'print to a file' by MS WORD

Note
  • there is no '.prn' file for manually coded overlays
  • since MS WORD is not used & there is no 'print to file' output
  • we assign '.pcl1' extension to the manually coded file
  • we assign '.pcl' extension to the manually code file
  • after converting the '!' pseudo escapes to x'1B' true escapes

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3C4. File Investigation Results - Manually coded PCL5 Overlays

uvlh1.ovl - output from pcloverlay


 #4. uvhd ovl/uvlh1.ovl s3  <-- investigate the output of pcloverlay
     =====================
     --> i2 <-- print 2 blocks (file now 364 bytes, 29 bytes added by pcloverlay)
                      10        20        30        40        50        60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 .E.&l0O.&f1y0X.*r0F.&l0000u0000Z.&l200u-100Z.&k2G..&a0h0V.*c5400
             1412634126373512734126333373333512633372333512634012636351263333
             B5B6C0FB661908BA206B6C000050000AB6C2005D100AB6B27AB610806BA35400
          64 h800v0P..&a25h25V.*c5350h750v1P..&l300u-00Z.(s1P.(s30V.(s3B.(s41
             6333735012633633512633336333735012633372335127351273351273412733
             8800600AB61258256BA353508750610AB6C3005D00AB8310B83306B8332B8341
         128 01T.                 UV Software Inc. .(s12V.&l12C.
             3350222222222222222225525667767624662212733512633402222222222222
             014A000000000000000005603F64712509E3E0B83126B6C123A0000000000000
         192    4667 Hoskins Rd., North Vancouver BC, Canada V7K2R3  tel: 604
             2223333246766672562224677625666677672442246666625343532276632333
             000466708F3B9E3024EC0EF248061E3F5652023C031E141067B2230045CA0604
                      10        20        30        40        50        60
 r#        2 0123456789012345678901234567890123456789012345678901234567890123
         256 -980-5434.                              Email: owen@uvsoftware.c
             2333233330222222222222222222222222222222466663267664777667767626
             D980D5434A0000000000000000000000000000005D19CA0F75E0563F647125E3
          64 a  Web: https://www.uvsoftware.ca..&f1x10x4X
             6225663267773227772777667767626601263733735
             100752A08440AFF777E563F647125E31AB661810848

codes inserted by pcloverlay


 .&f1y0X.*r0F.&l0000u0000Z.&l200u-100Z  - bytes 7 thru 31 on 1st row
 =====================================  - '.'s are escapes x'1B's
 .&f1y0X       - assigns overlay #1 (1y) & marks begin overlay (0X)
 .*r0F         - sets raster mode (vs vector mode N/A for overlays)
 .&l0000u0000Z - resets left margin (u) & top margin (Z) to defaults (0000)
               - above inserted by pcloverlay, in case source file omitted
               - following was coded in this PCL5 source file
 .&l200u-100Z  - resets left margin right 200/720" & top margin up 100/720"
 .&f1x10x4X    - bytes 97-106 in 2nd block (last row) or 353-362 of file
               - marks end overlay (1x), marks as permanent,& enables overlay

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3C6. File Investigation Results - Manually coded PCL5 Overlays

3C5. uvlh_text - data file to test overlay printing

Note
  • the 'uvlh_text' data file used to test overlay printing is NOT listed
  • it is simply 2 pages of text from this documentation

3C6. uvlh1_print - uvoverlay concat overlay+data


 #5. uvhd ovl/uvlh1_print   <-- investigate the concatenated overlay + data
     ====================     - omit 's3' option to save space
     --> i2 <-- print 1st 2 blocks (file now 2803, text appended by uvoverlay)
                      10        20        30        40        50        60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 .E.&l0O.&f1y0X.*r0F.&l0000u0000Z.&l200u-100Z.&k2G..&a0h0V.*c5400
             1412634126373512734126333373333512633372333512634012636351263333
             B5B6C0FB661908BA206B6C000050000AB6C2005D100AB6B27AB610806BA35400
          64 h800v0P..&a25h25V.*c5350h750v1P..&l300u-00Z.(s1P.(s30V.(s3B.(s41
             6333735012633633512633336333735012633372335127351273351273412733
             8800600AB61258256BA353508750610AB6C3005D00AB8310B83306B8332B8341
         128 01T.                 UV Software Inc. .(s12V.&l12C.
             3350222222222222222225525667767624662212733512633402222222222222
             014A000000000000000005603F64712509E3E0B83126B6C123A0000000000000
         192    4667 Hoskins Rd., North Vancouver BC, Canada V7K2R3  tel: 604
             2223333246766672562224677625666677672442246666625343532276632333
             000466708F3B9E3024EC0EF248061E3F5652023C031E141067B2230045CA0604
                      10        20        30        40        50        60
 r#        2 0123456789012345678901234567890123456789012345678901234567890123
         256 -980-5434.                              Email: owen@uvsoftware.c
             2333233330222222222222222222222222222222466663267664777667767626
             D980D5434A0000000000000000000000000000005D19CA0F75E0563F647125E3
          64 a  Web: https://www.uvsoftware.ca..&f1x10x4X.&l240U.&l900Z.&l1H.&
             6225663267773227772777667767626601263733735126333512633351263412
             100752A08440AFF777E563F647125E31AB661810848B6C2405B6C900AB6C18B6
         128 l0S.&l63F.&l8C.(s0P.(s10H.(s0S.(s0B.(s4099T                   **
             6351263341263412735127334127351273412733335222222222222222222222
             C03B6C636B6C83B8300B83108B8303B8302B83409940000000000000000000AA
         192  Overlay Printing Demonstration **..This assumes that you have i
             2476766725766766624666677767666222005667267776672766727672667626
             0F652C190029E49E7045DFE342149FE0AAAA489301335D530481409F50816509

notes re relevant PCL5 codes


 .&f1x10x4X.&l240U.&l900Z.&l1.& <-- bytes 97-106 in 2nd block or 353-362 of file
 ==============================
 .&f1x10x4X                     <-- marks end overlay (1x), permanent,& enables
           .&l240U.&l900Z       <-- inserted from options on uvoverlay
                                  - left margin 240 right, top margin 900 down

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3D1. File Investigation Results - Manually coded PCL5 Overlays

PCL5 codes described

Here is a brief description of the PCL5 codes used in the UV Software letterhead shown earlier on page '3C1' (before conversion to an overlay).

 !E               - laser printer reset
 !&l0O            - Portrait (vs Landscape !&l1O)
                <-- overlay start codes will be inserted here
 !&l01X           - no of copies (dropped for overlay)
 !&l200u-100Z     - left margin 200/720"(right) & top margin -100/720" (up)
 !&k2G            - consider Line-Feed as Carriage-Return + Line-Feed
 !&a0h0V          - set cursor to 0 horizontal & 0 Vertical coordinates
 !*c5400h800v0P   - define rectangle 5400/720" Horizontal & 800/720 vertical
                  - then fill with BLACK (all pixels on)
 !&a25h25V        - set cursor to 25/720" horizontal & 25/720" Vertical coords
 !*c5350h750v1P   - define rectangle 5350/720" Horizontal & 750/720 vertical
                  - then fill with WHITE (all pixels off)
 !&l300u-000Z     - left margin 300/720"(right) & top margin -000/720" (n/c)
 !(s1P            - proportional spacing
 !(s30V           - character height = 30 points = 30/72"
 !(s3B            - strokeweight = BOLD
 !(s4101T         - typeface = CG Times
 UV Software Inc.
 !(s12V           - change character height to 12 points = 12/72"
 !&l12C           - change vertical motion to 12/48"
 4667 Hoskins Rd., North Vancouver BC, Canada V7K2R3  tel: 604-980-5434
 Email: owen@uvsoftware.ca  Web: https://www.uvsoftware.ca
                <-- overlay end codes will be inserted here

PCL5 codes inserted for overlays

The 'uvhd' hexdump on page '3C4' shows the following PCL5 codes inserted for overlays:

 .&f1y0X       - assigns overlay #1 (1y) & marks begin overlay (0X)
 .*r0F         - sets raster mode (vs vector mode N/A for overlays)
 .&l0000u0000Z - resets left margin (u) & top margin (Z) to defaults (0000)
               - inserted by pcloverlay, in case source file omitted u & Z

PCL5 codes inserted for end of overlays

 .&f1x10x4X    - codes inserted at end overlay
 .&f1x         - marks end overlay
      10x      - marks as permanent
         4X    - enables overlay

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3E1. File Investigation Results - overlay from MS WORD .doc

uvlh2.ovl created from MS WORD .doc

Here is a uvhd hexdump of the 1st 2 & last 2 blocks of uvlh2.ovl, which was created from MS WORD uvlh2.doc & uvlh2.prn.

uvlh2.ovl is 12,997 bytes (51 blocks of 512), whereas uvlh1.ovl (hand coded) is only 363 bytes.


 uvhd ovl/uvlh2.ovl s3     <-- investigate uvlh2.ovl
 =====================
     --> i2 <-- print 1st 2 blocks
                      10        20        30        40        50        60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 .E.&l0O.&f1y0X.*r0F.&l0000u0000Z.&l8c1E.*t300R.*b0M..*c16534D.)s
             1412634126373512734126333373333512636341273335126340126333334127
             B5B6C0FB661908BA206B6C000050000AB6C8315BA43002BA20DDBA3165344B93
          64 64W.@.....V...q...U.....p...........(..............Cache 16534..
             335040000050D070005080C0700000000F002080000000000004666623333300
             64700020006070101150C140001000000F3180C0000000000003138501653400
         128 ....(16534X.&d@.*c32E.(s464W.........7.:.8...............?......
             0001233333512641263341273335000000000303030FFFFF0FFC0FF003F00FF0
             000B8165348B640BA3325B83464740E10001070A0800FFF83FF07FF00FC01FC0
         192 ................................................................
             00F00FF000E00FF000E00FF000C00FF000C00FF000C00FF000C00FF000C00FF0
             0F001F8007000F8007000F8003000F8003000F8003000F8003000F8003000F80
                      10        20        30        40        50        60
 r#        2 0123456789012345678901234567890123456789012345678901234567890123
         256 ................................................................
             00C00FF000C00FF000C00FF000C00FF000C00FF000C00FF000C00FF000C00FF0
             03000F8003000F8003000F8003000F8003000F8003000F8003000F8003000F80
          64 ................................................................
             00C00FF000C00FF000C00FF000C00FF000C00FF000C00FF000C00FF000C00FF0
             03000F8003000F8003000F8003000F8003000F8003000F8003000F8003000F80
         128 ................................................................
             00C00FF000C00FF000C00FF000C00FF000C00FF000C00FF000C00FF000C00FF0
             03000F8003000F8003000F8003000F8003000F8003000F8003000F8003000F80
         192 ................................................................
             00C00FF000C00FF000C00FF000C00FF000C00FF000C00FF000800FF0008007F0
             03000F8003000F8003000F8003000F8003000F8003000F8007000F8007000F80

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3E2. File Investigation Results - overlay from MS WORD .doc

uvlh2.ovl created from MS WORD .doc

Here is a uvhd hexdump of the last 2 blocks of uvlh2.ovl, which was created from MS WORD uvlh2.doc & uvlh2.prn.


 uvhd ovl/uvlh2.ovl s3     <-- investigate uvlh2.ovl
 =====================
     --> 50 <-- set file pointer to block #50 (2nd last block)
     --> i2 <-- print last 2 blocks
                      10        20        30        40        50        60
 r#       50 0123456789012345678901234567890123456789012345678901234567890123
       12544 2W.............*b12W.............*b12W.............*b12W........
             35F0008F8FEF08126335F0008F8FEF08126335F0008F8FEF08126335F0008F8F
             2790071F1F2F00BA212790071F1F2F00BA212790071F1F2F00BA212790071F1F
          64 .....*b12W.............*p338Y.*b0M.*rB.*p640X.*r1A.*b2M.*b6W....
             EF08126335F0008F8FEF081273335126341274127333512734126341263501CF
             2F00BA212790071F1F2F00BA03389BA20DBA22BA06408BA211BA22DBA2670F1F
         128 ...*b6W...~.x.*b6W...~.x.*b6W.......*b6W.......*b6W.......*p374Y
             0F1263501C7071263501C7071263501CF0F1263501CF0F1263500CE0E1273335
             08BA2670E1E08BA2670E1E08BA2670F1F08BA2670F1F08BA267071700BA03749
         192 .*b0M.*rB.*p64X.*r1A.*b2M.*b10W...........*b10W...........*b0M.*
             1263412741273351273412634126335008F8FEF08126335008F8FEF081263412
             BA20DBA22BA0648BA211BA22DBA2107071F1F2F00BA2107071F1F2F00BA20DBA
                      10        20        30        40        50        60
 r#       51 0123456789012345678901234567890123456789012345678901234567890123
       12800 rB.*p56X.*r1A.*b2M.*b10W...........*b10W...........*b10W........
             741273351273412634126335078F8FEF0F126335078F8FEF0F126335078F8FEF
             22BA0568BA211BA22DBA21070F1F1F0F08BA21070F1F1F0F08BA21070F1F1F0F
          64 ...*b10W...........*b10W...........*b10W...........*b10W........
             0F126335078F8FEF0F126335078F8FEF0F126335078F8FEF0F126335078F8FEF
             08BA21070F1F1F0F08BA21070F1F1F0F08BA21070F1F1F0F08BA21070F1F1F0F
         128 ...*b10W...........*b10W...........*b10W...........*b0M.*rB.&f1x
             0F126335078F8FEF0F126335078F8FEF0F126335078F8FEF0F12634127412637
             08BA21070F1F1F0F08BA21070F1F1F0F08BA21070F1F1F0F08BA20DBA22B6618
         192 10x4X
             33735
             10848

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3F1. Modifying Overlays with uvhd

Modifying Overlays with uvhd

You can use 'uvhd' to modify overlays, For example, you might need to shift the form (left/right up/down), to improve the alignment of text data in the various form lines & boxes.

Note that we have already shown that the overlay program allows you to shift the data using option 'm' for left-/right+ & option 'j' for up-/down+.

The example we used earlier was to set the left margin to the right by 1/2" and set the top margin down 1 1/4", so the text is below the letterhead box.


 uvoverlay ovl/uvlh2.ovl ovl/uvlh_text - m360j900 | lp
 =====================================================

But, if you also want to modify the position of the overlay, then you can use 'uvhd' to update the overlay margin codes as shown below:

Of course it would be better to make these changes in the original MS WORD document on Windows, recreate the .prn file, re-transfer it to unix, and recreate the .ovl from the .prn.

But, if you want to make the change right now, you can use uvhd as shown below:

For our example, we will shift the letterhead right 3/16" & up 3/16". Margin offsets are specified in decipoints (1" = 720 decipoints), so 3/16" is 135 decipoints.

The uvoverlay program uses code 'm' for left-/right+ & code 'j' for up-/down+ but we are modifying PCL5 code, which uses code 'u' for left-/right+ & code 'Z' for up-/down+.

The equivalent of 'm360j900' (used on the uvoverlay command above), in PCL5 coding would be '!&l0360u0900Z'. '&l' is the command group code & the actual command codes 'u' & 'Z' follow the value (vs preceding as on uvoverlay).

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3F2. Modifying Overlays with uvhd

Demo Modify Letterhead Overlay

To demonstrate using uvhd to modify the overlay position, we will use /home/uvadm/ovl/uvlh2.ovl, but we will 1st copy it to the 'tmp' subdir to avoid modifying our original.


 #1. login uvadm      --> /home/uvadm

 #2. rm -f tmp/*      <-- remove any old files from tmp
     ===========

 #3. cp ovl/uvlh2.ovl tmp    <-- copy demo letterhead overlay to tmp subdir
     ====================

 #4. uvhd tmp/uvlh2.ovl r256s3u  <-- use uvhd with option 'u' for update
     ==========================
                      10        20        30        40        50        60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 .E.&l0O.&f1y0X.*r0F.&l0000u0000Z.&l8c1E.*t300R.*b0M..*c16534D.)s
             1412634126373512734126333373333512636341273335126340126333334127
             B5B6C0FB661908BA206B6C000050000AB6C8315BA43002BA20DDBA3165344B93
          64 64W.@.....V...q...U.....p...........(..............Cache 16534..
             335040000050D070005080C0700000000F002080000000000004666623333300
             64700020006070101150C140001000000F3180C0000000000003138501653400
         128 ....(16534X.&d@.*c32E.(s464W.........7.:.8...............?......
             0001233333512641263341273335000000000303030FFFFF0FFC0FF003F00FF0
             000B8165348B640BA3325B83464740E10001070A0800FFF83FF07FF00FC01FC0
         192 ................................................................
             00F00FF000E00FF000E00FF000C00FF000C00FF000C00FF000C00FF000C00FF0
             0F001F8007000F8007000F8003000F8003000F8003000F8003000F8003000F80

We will modify the margins by changing the default neutral zero values provided by the pcloverlay program. Note the string '&l0000u0000Z' at bytes 20-31 (zero relative).

 20(12) = '&l0000u0000Z'
 22(4) = '0000'  - value for code 'u' left-/right+ margin
 27(4) = '0000'  - value for code 'Z' up-/down+ margin

So , our commands to uvhd will be:

 --> u 22(4),'0135'  <-- change 'u' value to shift right 135/720"
 --> u 27(4),'-135'  <-- change 'Z' value to shift up 135/720"

'uvhd' displays the current block after each update. Please see the updated block on the next page:

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3F3. Modifying Overlays with uvhd

tmp/uvlh2.ovl - after update


 #4. uvhd tmp/uvlh2.ovl r256s3u  <-- use uvhd with option 'u' for update
     ==========================
Note
  • bytes 20-31 are now '&l0135u-135Z' (after updates above)
                      10        20        30        40        50        60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 .E.&l0O.&f1y0X.*r0F.&l0135u-135Z.&l8c1E.*t300R.*b0M..*c16534D.)s
             1412634126373512734126333373333512636341273335126340126333334127
             B5B6C0FB661908BA206B6C000050000AB6C8315BA43002BA20DDBA3165344B93
          64 64W.@.....V...q...U.....p...........(..............Cache 16534..
             335040000050D070005080C0700000000F002080000000000004666623333300
             64700020006070101150C140001000000F3180C0000000000003138501653400
         128 ....(16534X.&d@.*c32E.(s464W.........7.:.8...............?......
             0001233333512641263341273335000000000303030FFFFF0FFC0FF003F00FF0
             000B8165348B640BA3325B83464740E10001070A0800FFF83FF07FF00FC01FC0
         192 ................................................................
             00F00FF000E00FF000E00FF000C00FF000C00FF000C00FF000C00FF000C00FF0
             0F001F8007000F8007000F8003000F8003000F8003000F8003000F8003000F80

--> q <-- to quit uvhd

Now we will use uvoverlay with the modified overlay (tmp/uvlh2.ovl) & observe the changes in the position of the letterhead.


 #5. uvoverlay tmp/uvlh2.ovl ovl/uvlh_text - m360j900 | lp
     ==========***========================================

To see the differences, you can rerun using the original unmodified overlay (in ovl/uvlh2.ovl).


 #5. uvoverlay ovl/uvlh2.ovl ovl/uvlh_text - m360j900 | lp
     ==========***========================================

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

Visitor Counters for ThisYear and LastYear