Test/Demo the Vancouver Utilities

A1. Introduction & Overview
A2.  Vancouver Utilities homedir contents
A3.  setup your user account if not already present
A4.  copy test files from uvadm/... to your homedir/demo/...
A5.  list of testfiles used in this TestDemo tutorial
B1. Print this documentation for your operating instructions
B2.  Test/demo Guidelines & Recommendations
C1. 'vi' tutorial, Brief review of most useful commands
D1. Test files used to demonstrate the Vancouver Utilities
F1. uvcp - file copy with record selection & reformatting
G1. uvsort - file sort utility with record selection & much more
H1. uvlist - list text files, inserting laser printer control codes
I1. uvcopy - the most powerful Vancouver Utility (data manipulation, etc)
J1. table2 - pre-programmed table analysis of any field by any argument
J4. table3d - summarize target-words following key-words (all files in subdir)
K1. cobmap1 - create record layouts from COBOL copybooks
L1. uvqrpg - Quick Report Generator
M1. D-ISAM - test uvcp/uvsort processing Indexed Sequential Fixed length records
- compatible with Micro Focus COBOL IDXFORMAT1 files
M4. listISF - Pre-Programmed uvcopy job to list any C-ISAM/D-ISAM Indexed file
- options to extract 1st portion of each record & records in file
N1. scan1d - scan all files in a directory for matches to qualified patterns
O1. rep2 - copy files replacing patterns, qualified by other patterns
P1. prodfix1 - uvcopy equivalent of the rep2 pre-programmed job above
Q1. testint2 - uvcopy job to test 64 bit accumulators (vs 32 bit)
Q4.  test64c.c - C program to test 64 bit integers (independent of uvcopy)
R1. testIDXL - test uxcp processing Indexed Sequential Variable length records
- compatible with Micro Focus COBOL IDXFORMAT3 files
S1. tabfix1 - converting tabs to blanks
T1. tolower1 - translate any file to lowercase
T2. tolower2 - translate COBOL programs to lowercase
U1. toascii1 - translate EBCDIC to ASCII demo using dat1/vendormas0
U1. toascii1 - demo convert dat1/vendormas0 EBCDIC to ASCII
U4.  uvcopy options for EBCDIC to ASCII translate tables
- alternates for various countries
U5.  Illustrating Translate table differences
U8. toascii2 - demo convert dat1/custmas0 EBCDIC to ASCII
W1.  multicol1,2,3 - rearrange files for multi-column printing (tickets,labels)
- options for number of columns, width of each column,& spacing between
 ============================================================================
 Owen Townsend, UV Software, 4667 Hoskins Rd., North Vancouver BC, V7K2R3
         Tel:   604-980-5434          Fax: 604-971-4742
         Email: owen@uvsoftware.ca    Web: https://www.uvsoftware.ca
 Copyright(C) 1993-2019, UV Software Inc, All rights reserved
 ============================================================================

Goto:   Begin this document End this document UVSI Home-Page

A1. Test/Demo the Vancouver Utilities

Introduction & Overview

  1. These 'test/demo's should give you an appreciation of how useful these utilities can be to your Unix or Linux site. For Windows/DOS users, please see a similar set of test/demos in WindowsDOS.htm (installation guide for the Windows/DOS versions of Vancouver Utilities).

  2. If you have just installed the Vancouver Utilities, please run these test/demo's and confirm that you get the expected outputs as illustrated following each test. Please inform UV Software of any discrepancies and please call UV Software if you need any help running the test/demos.

  3. Even if you are just reading this on the web site, this is still a good place to start investigating & understanding what the Vancouver Utilities can do for you.

  4. Running these test/demos is a good way to learn how to use the Vancouver Utilities. After you have worked your way thru these test/demos, you can find additional exercises in uvtrain.htm & UVtoold.htm.

  5. Single users could run the test/demos while logged in as 'uvadm' (the Vancouver Utilities site administrator). At multi-user sites, each user/programmer should copy the test files to his/her own home directory as documented on page 'A4'.

  6. Each user/programmer must have setup his/her .profile or .bash_profile as described in install.htm. This is easy since you can simply copy a supplied file (/home/uvadm/env/stub_profile_uv) onto the end of your existing profile.

  7. This document is intended as a 'sampling' or 'grand tour' of the Vancouver Utilities. Most of these samples will refer you to a more primary document when you want to pursue an in-depth investigation of a particular subject.

  8. The Vancouver Utilities are well known for their Mainframe to Unix conversion tools, but this document is intended to illustrate the more general purpose usefulness of the package. Please see JCLcnv1demo.htm if you are interested in the Mainframe to Unix tools.

Goto:   Begin this document End this document UVSI Home-Page

A2. Test/Demo Vancouver Utilities

Vancouver Utilities homedir contents

 /home/uvadm           <-- $UV
 :-----bin               - binaries (uvcopy,uvsort,uvcp,uvhd,uvlist,etc)
 :-----ctl               - control files for various purposes
 :-----dat1              - test data files to demo various Vancouver Utilities`
 :-----doc               - Vancouver Utilities documentation (text)
 :-----dochtml           - documentation in HTML (same as on www.uvsoftware.ca)
 :-----demo            <-- demo files for this TestDemo tutorial
 :     :                 - to be copied to your $HOME/demo/...
 :     :-----dat1        - data files for uvsort,uvcopy,uvcp,etc
 :     :-----jcl0        - mainframe JCL samples (8)
 :     :-----jcl2        - JCLs cleaned up, lower cased
 :     :-----jcl3        - JCLs after conversion to Korn shell scripts
 :     :-----parms       - SYSIN control cards for various purposes
 :     :-----pf          - Parameter Files for uvcopy
 :     :-----rpts        - reports created by various demos (selects,etc)
 :     :-----sf          - Script Files for bash or ksh
 :     :-----sqls        - SQL scripts for demo table analysis
 :     :-----stats       - outputs from table3d table summaries
 :     :-----tf          - Test Files (similar to dat1/...)
 :     :-----tmp         - temporary files, outputs from demos
 :     :-----tmp1        - may clear tmp files before demos to see only new outputs
 :-----env             <-- profiles for users, PATHs to utilities & other software
 :-----hdr               - hdr files for C compiles
 :-----htmlcode          - merged into dochtml when text converted to HTML
 :-----lib               - libraries for C compiles (subfunctions,DISAM,etc)
 :-----mvstest           - test/demos for MVS JCL/COBOL MainFrame conversions
 :-----mf              <-- small versions of MainFrame testdata files
 :-----pf              <-- Parameter Files for uvcopy & uvqrpg
 :     :-----adm         - administrative jobs
 :     :-----demo        - demo jobs
 :     :-----IBM         - IBM mainframe conversion jobs
 :     :-----util        - utility jobs
 :-----sf              <-- Script Files
 :     :-----adm         - administrative scripts
 :     :-----demo        - demo scripts
 :     :-----IBM         - IBM mainframe conversion scripts
 :     :-----util        - utility scripts
 :-----sfun              - ksh functions used in converted JCL/scripts
 :-----src             <-- Vancouver Utilities C source code
 :-----srcf              - C source for various sub-functions
 :-----tf                - test files for various examples in doc
 :-----tmp               - tmp subdir (test/demo outputs)
 :-----vsetest           - test/demos for VSE JCL/COBOL MainFrame conversions

Note that the uvadm subdirs for 'sf' (Script Files) & 'pf' (uvcopy Parameter Files or uvcopy jobs) are further sub-directoried as shown above. See https://uvsoftwre.ca/intall.htm to Install Vancouver Utilities.

Goto:   Begin this document End this document UVSI Home-Page

A3. Test/Demo Vancouver Utilities

setup your user account if not already done

Here are instructions to setup a user account to run the demos. You could run the demos in the Vancouver Utilities admin account /home/uvadm/... But it is better to setup a user account & copy the demo files into your $HOME/demo/. We will refer to your user account as 'userxx', but you would use your name.


 #1. login as 'root'

 #2.  groupadd apps     <-- we assume a group has already been setup
      =============       - for users to access common libraries & datafiles

 #3a. useradd -m -g apps -s /bin/bash userxx
      ======================================
      - use option '-s' to specify login shell as 'bash'

 #3b. useradd -m -g apps -s /bin/ksh userxx
      =====================================
      - OR use option '-s' to specify login shell as 'ksh' (Korn shell)

 #4. passwd userxx           <-- setup password desired
     ==============

 #5. chmod 755 /home/userxx  <-- allow copying between your user accounts
     ======================    - optional

 #6. cp $UV/env/stub_profile_uv /home/userxx/.bash_profile
     =====================================================
     - copy supplied profile to homedir renaming to '.bash_profile'
     - calls the common profile from $APPSADM/env/common_profile_uv
     - see profiles listed above on pages '1B2' & '1B3'

 #7. Logout root     <-- logout of root
     ===========

Goto:   Begin this document End this document UVSI Home-Page

A4. Test/Demo Vancouver Utilities

copy demo files to your $HOME/demo

Note
  • the demo files for this TestDemo.doc are the same set as for UVtools.doc
  • so you may already have done this if you performed the UVtools tutorials

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

 #2. mkdir demo   <-- make demo directory
     ==========

 #3. cp -r $UV/demo/* demo   <-- copy demo files to your subdir
     =====================

 #3a. cp -r /home/uvadm/demo/* demo  <-- same as above
      =============================
       - if common_profile_uv has "export UV=/home/uvadm"

 #4. cd demo      ---> /home/usrxx/demo

 #5. llr    <-- alias to List Long Recursive (directories & files)
     ===        alias definition --> alias llr='ls -lR'

llr lists directories 1st

llr - list directory with long & Recursive options & pipe to more demo: -rw-rw-r-- 1 uvadm apps 162 Feb 21 16:28 1README drwxrwxr-x 2 uvadm apps 4096 Mar 25 17:26 dat1 drwxrwxr-x 2 uvadm apps 4096 Mar 26 15:59 jcl0 drwxrwxr-x 2 uvadm apps 4096 Feb 16 15:06 jcl2 drwxrwxr-x 2 uvadm apps 4096 Feb 16 14:34 jcl3 drwxrwxr-x 2 uvadm apps 4096 Feb 12 18:08 parms drwxrwxr-x 2 uvadm apps 4096 Mar 22 16:45 pf drwxrwxr-x 2 uvadm apps 4096 Feb 12 17:33 rpts drwxrwxr-x 2 uvadm apps 4096 Feb 25 12:19 sf drwxrwxr-x 2 uvadm apps 4096 Feb 16 11:26 sqls drwxrwxr-x 2 uvadm apps 4096 Feb 16 07:06 stats drwxrwxr-x 2 uvadm apps 4096 Mar 26 15:58 tf drwxrwxr-x 2 uvadm apps 4096 Mar 26 16:05 tmp drwxrwxr-x 2 uvadm apps 4096 Mar 26 16:05 tmp1

The demo directory within your home directory is your "working directory" for the tutorials in TestDemo.doc & UVtools.doc. The operating instructions assume this, so you must stay in /home/userxx/demo/... Do not change into the sub-directories, examine or edit files by coding 1 level of subdir.

Goto:   Begin this document End this document UVSI Home-Page

A5. Test/Demo Vancouver Utilities

test/demo files for TestDemo.doc & UVtools.doc

 demo/dat1:     <-- data files for uvsort,uvcopy,uvcp,etc
 -rw-rw-r-- 1 uvadm apps  834 Feb 25 14:13 accents1
 -rw-rw-r-- 1 uvadm apps  834 Feb 25 14:14 accents1.bak
 -rw-rw-r-- 1 uvadm apps  265 Feb 25 10:15 accents2
 -rw-rw-r-- 1 uvadm apps  265 Feb 25 11:39 accents2.bak
 -rw-rw-r-- 1 uvadm apps 8192 Mar 25 17:13 custmas0
 -rw-rw-r-- 1 uvadm apps 8192 Mar 25 17:13 custmas1
 -rw-rw-r-- 1 uvadm apps 8224 Mar 25 17:25 custmast.dat
 -rw-rw-r-- 1 uvadm apps 3072 Mar 25 17:25 custmast.idx
 -rw-rw-r-- 1 uvadm apps  450 Feb 22 09:58 nameadrs0e
 -rw-rw-r-- 1 uvadm apps  450 Feb 22 09:58 nameadrs1f
 -rw-rw-r-- 1 uvadm apps  427 Feb 22 09:58 nameadrs2t
 -rw-rw-r-- 1 uvadm apps 1280 Mar 25 17:13 sales2
 -rw-rw-r-- 1 uvadm apps 1280 Mar 25 17:13 sales3
 -rw-rw-r-- 1 uvadm apps  576 Mar 25 17:13 sales4
 -rw-rw-r-- 1 uvadm apps  256 Mar 25 17:25 trt256
 -rw-rw-r-- 1 uvadm apps  512 Mar 25 17:26 vendormas0
 -rw-rw-r-- 1 uvadm apps  249 Feb 18 12:29 vendormas3

demo/jcl0: -rw-rw-r-- 1 uvadm apps 648 Mar 25 17:02 jar100.jcl -rw-rw-r-- 1 uvadm apps 1458 Mar 25 17:02 jar200.jcl -rw-rw-r-- 1 uvadm apps 243 Mar 25 17:02 jgl100.jcl -rw-rw-r-- 1 uvadm apps 324 Mar 25 17:02 jgl200.jcl -rw-rw-r-- 1 uvadm apps 1242 Mar 25 17:02 jgl230.jcl -rw-rw-r-- 1 uvadm apps 1377 Mar 25 17:02 jgl320.jcl

demo/jcl2: -rw-rw-r-- 1 uvadm apps 480 Feb 13 14:56 jar100.jcl --- same as jcl0, lower-cased, ready to convert --- -rw-rw-r-- 1 uvadm apps 932 Feb 13 14:56 jgl320.jcl

demo/jcl3: -rwxrwxr-x 1 uvadm apps 1903 Feb 13 14:57 jar100.ksh --- converted to shell scripts (.jcl --> .ksh) --- -rwxrwxr-x 1 uvadm apps 3280 Feb 13 14:57 jgl320.ksh

demo/parms: -rw-rw-r-- 1 uvadm apps 138 Feb 12 18:08 ftpdemo1a -rw-rw-r-- 1 uvadm apps 135 Feb 12 18:08 ftpdemo1b -rw-rw-r-- 1 uvadm apps 134 Feb 12 18:08 ftpget1 -rw-rw-r-- 1 uvadm apps 137 Feb 12 18:08 ftpput1

Goto:   Begin this document End this document UVSI Home-Page

A6. Test/Demo Vancouver Utilities

test/demo files (continued)

 demo/pf:        <-- Parameter Files for uvcopy
 -rw-rw-r-- 1 uvadm apps 1118 Mar 22 16:45 removeCR_uvcopy
 demo/sf:        <-- Script Files for bash or ksh
 -rwxrwxr-x 1 uvadm apps 566 Feb 25 12:23 fixaccents2
 -rwxrwxr-x 1 uvadm apps 244 Feb 23 17:43 llsx
 -rwxrwxr-x 1 uvadm apps 244 Feb 23 17:47 llsx.bak
 -rwxrwxr-x 1 uvadm apps 296 Feb 24 13:25 llsy

demo/sqls: -rw-rw-r-- 1 uvadm apps 56 Feb 16 07:01 select_customers_all -rw-rw-r-- 1 uvadm apps 97 Feb 16 06:57 select_customers_basic -rw-rw-r-- 1 uvadm apps 152 Feb 16 07:12 select_customers_WA -rw-rw-r-- 1 uvadm apps 136 Feb 16 07:20 select_employee_dept123 -rw-rw-r-- 1 uvadm apps 115 Feb 16 07:17 select_employee_seattle -rw-rw-r-- 1 uvadm apps 79 Feb 16 06:57 select_orders_big -rw-rw-r-- 1 uvadm apps 306 Feb 16 11:26 select_patients_old -rw-rw-r-- 1 uvadm apps 129 Feb 16 07:13 select_students_failing

 demo/stats:   <-- outputs from uvcopy table3d (table summaries)
                 - an example may be shown here
                 - but you can clean out & recreate
 -rw-rw-r-- 1 uvadm apps 1385 Mar 25 10:47 jcl0_PGM_all
 demo/tf:       <-- Test Files (similar to dat1/... files
 -rw-rw-r-- 1 uvadm apps 671 Mar 26 15:56 IPreplace.tbl
 -rw-rw-r-- 1 uvadm apps 439 Mar 25 17:38 names2U
 -rw-rw-r-- 1 uvadm apps 726 Mar 25 17:38 sales3.cpy
 -rw-rw-r-- 1 uvadm apps 657 Mar 25 17:39 tabtest1
 demo/tmp:       <-- subdirs for test/demo outputs
 demo/tmp1:        - clean out between different tests
 demo/tmp2:

Goto:   Begin this document End this document UVSI Home-Page

B1. Test/Demo Vancouver Utilities

Print Documentation as your Tutorial Guide

If at all possible, please print this document, so you can follow the step by step operating instructions, leaving your screen free to enter commands & observe results, with added benefit of making notes & highlighting as desired.

Vancouver Utilities make it easy to print items such as $UV/doc/TestDemo.doc if you have a network printer near you that is configured to your unix/linux system.

The common_profile_uv defines UVLPDEST, for example my current printer is:


 export UVLPDEST=-dMS610
 =======================

You could override this in your .profile or .bash_profile, specifying another network printer nearer to your location. Add your definition after the call to the common_profile_...

The printer name is 'MS610', the '-d' is the destination option. Leave no space because the 'uvlp' scripts require no space. I recommend 'uvlp13D' to print Duplex at 13 cpi to allow 100 chars on 8 1/2 by 11 paper (3 hole punched if available). See various other 'uvlp' scripts on page 'H1' to print at various cpi, lpi, Simplex or Duplex, Portrait or Landscape.

Then you could print this documentation as follows:


 uvlp13D $UV/doc/TestDemo.doc
 ============================
 Note that the HTML on the internet is https://www.uvsoftware.ca/testdemo.htm
 - all lowercase names with .htm suffix vs .htm. I use .doc for my text
 documentation (unrelated to Microsoft Word documents).

I maintain the Vancouver Utility documentation (all text files) with 'vi', and periodically convert it to HTML with a uvcopy job, & upload it to the UV Software web site.

Goto:   Begin this document End this document UVSI Home-Page

B2. Test/Demo Vancouver Utilities

Test/Demo Guidelines & Recommendations

  1. You could login as uvadm & run these test/demos, but it is better (especially at multi-user sites), to login as yourself, setup subdir demo/, copy $UV/demo/* to your $HOME/demo, & run the test/demos form there.

  2. $HOME/demo is then your "working directory" with the subdirs listed on page 'A4' containing the files listed on page 'A5' (a few of the file contents listed on page 'D1' - D30.

  3. Stay in the working directory ($HOME/demo/...) & not change into its subdirs, because the operating instructions assume you are in the working directory $HOME/demo/... & they address the files thru 1 level of subdir, for example:


      uvsort "fili1=dat1/sales3,typ=LST,rcs=64,filo1=tmp/s3,key1=30(6)"
      =================================================================

      vi tmp/s3     <-- examine test/demo outputs thru 1 level of subdir
      =========
  1. Do not change into the subdirs (unless you are going to view multiple outputs), because you would have to change back out to run the next command.

  2. Clear the temporary directories frequently so you will see the outputs of your current tests (& not old outputs from previous tests). Note that your $HOME/demo/tmp has nothing to do with the unix /tmp directory. Some test/demos will also use $HOME/demo/tmp1 & tmp2 for outputs.


      rm -f tmp*/*       <-- clear tmp/* tmp1/* & tmp2/*
      ============

Goto:   Begin this document End this document UVSI Home-Page

C1. 'vi' tutorial - Brief review of most useful commands

'vi' 2 modes of operation - COMMAND or INSERT

  1. COMMAND mode - cursor movement, read/write files, etc

  2. INSERT mode - enter text (insert or replace) - ESCAPE to return to command mode

It is most important to understand that vi has TWO modes of operation. Switch to INSERT mode using commands such as the following:

i=insert, a=append, R=replace, o=open new line, cw=change word.

Switch back to command mode using 'ESCAPE'. Make it a habit to hit ESCAPE as soon as you finish text entry. If in doubt (COMMAND or INSERT mode) - hit ESCAPE, it will do no harm if already in command mode (will beep).

starting 'vi' to edit a file


 vi filename     - starts vi, reads the file,& displays 1st screen
 ===========       (or blank screen if creating a new file)

CURSOR MOVEMENT

                                 k
                                 |
                           h <-- . --> l
                                 |
                                 j
 'h'  - move cursor left
 'j'  - move cursor down
 'k'  - move cursor up
 'l'  - move cursor right
 ^d   - down 1/2 screen
 ^u   -  up  1/2 screen
 :1   - goto line# 1
 :500 - goto line# 500
 G    - goto end-of-file
 0    - move cursor to begining of current line
 $    - move cursor to end of current line

Goto:   Begin this document End this document UVSI Home-Page

C2. vi editor - command summary (minimum essentials)

INSERT text (ESCAPE to end insert)

i
  • enter insert mode at cursor location
a
  • append text after cursor location
A
  • append text onto the end of the current line
r
  • replace 1 character under the cursor
  • automatically returns to command mode (no need to ESCAPE)
R
  • replace (overwrite) text until ESCAPE
cw
  • change word (from cursor to end of word)
  • ESCAPE to end change & adjust line to new word length
o
  • open (insert) a new line BELOW the cursor
O
  • open (insert) a new line ABOVE the cursor

DELETE commands

x
  • delete character (under cursor)
dd
  • delete current line
D
  • delete from the cursor to end of line

5dd - delete 5 lines (current & next 4 lines below cursor)

COPY lines (YANK & PUT)

yy
  • yank current line (into current buffer)
  • move cursor to line above intended insert point
p
  • put (insert) buffer to line below cursor
 5yy - yank 5 lines into current buffer
     - move cursor to line above intended insert point
 p   - put (insert) buffer (5 lines) below cursor

MOVE lines (DELETE & PUT)

dd
  • delete current line (& store in current buffer)
  • move cursor to line above intended insert point
p
  • put (insert) buffer to line below cursor
 5dd - delete 5 lines (& store in current buffer)
     - move cursor to line above intended insert point
 p   - put (insert) buffer (5 lines) below cursor

Goto:   Begin this document End this document UVSI Home-Page

C3. vi editor - command summary (minimum essentials)

search commands

 /xxx - search for xxx anywhere in the file
      - search will wrap around EOF back to cursor location
n
  • repeat previous search (next)

substitution commands

 :1,$ s/xxx/yyy    - substitute 'xxx' with 'yyy'
                   - from 1st line to last line (1,$)
 :%s/xxx/yyy       - substitute 'xxx' with 'yyy'
                   - on ALL lines, '%' same as '1,$'
 :%s/xxx/yyy/g     - substitute 'xxx' with 'yyy'
                   - ALL lines ('%') & ALL occurrences on each line (/g)

Global command - to delete, etc

 :g/xxx/d          - on ALL lines (g=global), Delete lines with 'xxx'
 :g/xxx/p          - on ALL lines (g=global), Print lines with 'xxx'

miscellaneous commands

u
  • undo the last change command
U
  • Undo all changes to the current line (since cursor move to it)
 .  - repeat the previous change command
J
  • Join line below cursor onto current line
 :r file2 - read a file into the workspace
            (following the line with the cursor)
zz
  • reposition cursor line in center of screen
  • useful when 'n' next search finds match at bottom of screen

Goto:   Begin this document End this document UVSI Home-Page

C4. vi editor - command summary (minimum essentials)

mark command

m[a-z]
  • mark current line as a,b,c,... (any 1 of 26 alphas)
ma
  • mark current line as mark 'a'
  • can move cursor to some other line
mb
  • mark new current line as mark 'b'
 'a         - address mark 'a' (via prefix of single quote)
 'a,'b      - address a range of lines from previously marked a & b
 'a,'b m .  - move lines from mark 'a' thru mark 'b' to follow current line
            - deletes original lines
 'a,'b co . - copy lines from mark 'a' thru mark 'b' to follow current line
            - preserves original lines

WRITE & QUIT

 :w  - write workspace back to the file named on the vi entry command
 :w filename  - write workspace to a different file
 :q  - quit vi (warning if changes made without writing)

:wq - write & quit

ZZ
  • write & quit (same as :wq)

:q! - quit without writing

 :10,20 w filex  - write lines 10-20 to filex

vim References


 'https://linuxgazette.net/152/srinivasan.html'
 =============================================
 - excellent tutorial on 'vim', enhanced 'vi' on most Linux systems.

 'ftp://ftp.vim.org/pub/vim/doc/vimbook-OPL.pdf'
 ===============================================
 - download everything about vim 3.8 MB .pdf file

Goto:   Begin this document End this document UVSI Home-Page

C5. vi editor - command summary (minimum essentials)

.vimrc - vim settings (Run controls)

Here is our recommended version of '.vimrc' (vim Run Control file). It makes the vim experience much richer especially the HighLighting of search strings & the current cursor line.

We store as 'vimrc' (in $UV/env/vimrc) so it is visible. Copy to your home dir & rename as '.vimrc' as follows:


 cp $UV/env/vimrc $HOME/.vimrc
 =============================
 " vimrc - setups for vi/vim, stored in /home/uvadm/env/vimrc
 "       - copy to your homedir & rename as .vimrc
 "
 " set HighLighting for search matches & current cursor line
 set hlsearch     "<-- HighLights search words (yellow)
 set cursorline   "<-- Highlights cursor line (light blue)
 "
 " restore cusrsor to previous position when reopening a file
 if has("autocmd")
   au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
     \| exe "normal! g'\"" | endif
 endif
 "
 " increase yank max lines per buffer a-z, from default (50 lines) to 1000 lines
 set viminfo='20,<1000
 " note - the 20 is the max files to save buffers for
 "
 " Mar26/19 - set screenoff=999, search match line in center of screen
 " set so=999 <-- disabled disabled (annoying side effects)
 "  - better to use 'n' search next, then 'zz' to center search found line
 "
 " Insert ABreviations for 'vi' used by UV Software
 iab UVsw UV Software
 iab UVs Vancouver Utilities
 iab UVw www.uvsoftware.ca
 iab UVhw https://www.uvsoftware.ca/
 " -------------------- end of .vimrc ----------------------

Goto:   Begin this document End this document UVSI Home-Page

D1. Test Files for Vancouver Utility Demos

Here is a test data file that we will use for several of our demos. 'dat1/sales3' is a sales detail file, typical of COBOL applications that may have been transferred from a mainframe to Windows/DOS. These files were originally EBCDIC fixed length records without LineFeeds. We have of course translated to ASCII and we have also inserted LineFeeds (x'0A' in last byte). to make it easy for you to display & print with the usual Windows/DOS tools.

dat1/sales3 - record layout

        00-05 - CUST#
        10-11 - SLSMN#
        13-18 - DATE
        20-27 - INVOICE#
        30-35 - PRODUCT#
        38-43 - QTY      (separate trailing sign +/-)
        45-51 - PRICE
        53-61 - $AMOUNT  (separate trailing sign +/-)
        63-63 - line-feed

Note that the record field positions & record scale above are all zero relative since all field addressing in the Vancouver Utilities is zero relative.

           1         2         3         4         5         6
 0123456789012345678901234567890123456789012345678901234567890123
 CUST#    SLM  DATE   INV#     PROD#     QTY   PRICE    AMOUNT
 ================================================================
 130140    21 940802 IN111001  HAM001  00020+ 0000001 00000020+
 130140    21 940802 IN111001  SCR012  00021+ 0001001 00021021+
 139923    35 950802 IN111002  HAM001  00022+ 0002001 00044022+
 139923    35 950802 IN111002  TAB013  00023+ 0003001 00069023+
 139923    35 950807 CR5421    TAB013  00024+ 0004001 00096024+
 150825    44 960804 IN1122    HAM001  00025+ 0005001 00125025+
 150825    44 960804 IN1122    PLN012  00026+ 0006001 00156026+
 201120    44 970807 CR5234    WHIP75  00027+ 0007001 00189027+
 223240    65 980816 CR955     HAM001  00028+ 0008001 00224028+
 223240    65 980816 IN441     BIT001  00029+ 0009001 00261029+
 308685    75 990812 IN6605    SAW001  00010- 0000001 00000010-
 308685    75 990812 IN6605    WID115  00011- 0001001 00011011-
 308685    75 990812 CR8835    TAB013  00012- 0002001 00024012-
 315512    33 000805 IN2251    HAM001  00013- 0003001 00039013-
 315512    33 000805 IN2251    SAW051  00014- 0004001 00056014-
 315512    33 000805 IN2255    WID115  00015- 0005001 00075015-
 400002    85 010812 CR245     HAX129  00016- 0006001 00096016-
 406082    55 020815 IN33001   BBQ001  00017- 0007001 00119017-
 406082    55 020815 IN33001   TAB013  00018- 0008001 00144018-
 406082    65 020816 IN441     HAM001  00019- 0009001 00171019-

Please contrast this sales3 file to the custmas1 file on page 'D3'. 'sales3' is all character with LineFeeds & no packed decimal fields, which makes it easy to display/print with the usual Windows/DOS tools. 'custmas1' has no LineFeeds & does have packed decimal fields, which makes it impossible to display/print with the usual Windows/DOS tools.

Goto:   Begin this document End this document UVSI Home-Page

D2. Test Files for Vancouver Utility Demos

tf/test100 - test file for multicol1,2,3

 0001 one
 0002 two
 0003 three
 0004 four
 0005 five
 0006 six
 0007 seven
 0008 eight
 0009 nine
 0010 ten
 0011 eleven
 0012 twelve
 0013 thirteen
 0014 fourteen
 0015 fifteen
 0016 sixteen
 0017 seventeen
 0018 eightteen
 0019 nineteen
 0020 twenty
 -------- etc --------
 0090 ninety
 0091 ninety one
 0092 ninety two
 0093 ninety three
 0094 ninety four
 0095 ninety five
 0096 ninety six
 0097 ninety seven
 0098 ninety eight
 0099 ninety nine
 0100 one hundred

These records are 20 bytes each, with a LineFeed x'0A' in column 20 (byte 19). See usage on page 'W1' for uvcopy demo jobs multicol1,2,3.

Goto:   Begin this document End this document UVSI Home-Page

D3. Test Files for Vancouver Utility Demos

dat1/custmas1 - record layout

000-005 - customer# 008-008 - delete flag (D) 010-034 - customer name 035-059 - address 060-076 - city 077-078 - province 080-089 - postal code 090-101 - phone# 102-119 - contact name 120-179 - this year sales 12 x 5 byte packed fields 180-239 - last year sales 12 x 5 byte packed fields 240-243 - credit codes 244-249 - date of last change 250-255 - unused blanks (x'20's), Note - No LineFeed (x'0A') in last byte

'custmas1' is a typical file used in COBOL applications that have been transferred from a mainframe to Unix/Linux/Windows/DOS. These are Fixed length records, may be Indexed, may have packed decimal fields,& might not have terminating linefeeds. The packed fields & no linefeeds make it impossible to display or print these files with the usual Windows/DOS tools, so we will use Vancouver Utilities 'uvhd' (see below & see more details on the next page).


 uvhd dat1/custmas1 r256  - execute uvhd to display dat1/custmas1
 =======================    (1st record shown below)
 rec#=1 rsize=256 fptr=0 fsize=8192 records=32
                      10        20        30        40        50        60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD          NANA
             3333332222454545444244545524542222233332445442544422222222224444
             130140000056527255E0DF4F230C44E0000181502F75E02F140000000000E1E1
          64 IMO          BC V9S1H1    250-754-5531 LARRY WRENCH     ..4V|...
             4442222222222442535343222233323332333324455525544442222201357000
             9DF00000000002306931810000250D754D55310C12290725E38000000246C000
         128 .........W0....`........)X}..f3.....\.................4V}...f...
             0000000005300016000000002570063100095000000000000000013570016000
             0C0000C0270D0540C0000C0098D0263C0444C0000C0000C0000C0246D0056C00
         192 .E|...V}.......................f.....<........f.C 20190320
             0470005700000000880000000018000680001300000000694233333333222222
             35C0046D0000C0023C0000C0083C0056D0012C0000C0016D3020190320000000

'uvhd' will be invaluable if you have files like this in your shop. If Indexed, 'listISF' could be used to extract the character portion (omitting packed fields) outputting to a text file which we can display/print with the usual unix tools. Here are 1st 80 bytes from 1st 3 records extracted by listISF, full list page 'M4'.

 130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD          NANAIMO          BC
 132588    GEECOE GENERATOR SERVICESUNIT 170 - 2851 SIMPSON  RICHMOND         BC
 139923    JOHNSTONE BOILER & TANKS 1250 EAST PENDER STREET  VANCOUVER        BC

Goto:   Begin this document End this document UVSI Home-Page

E1. Test/Demo the Vancouver Utilities

uvhd - display binary files in Vertical HexaDecimal

'uvhd' is especially useful for displaying fixed length record files that contain packed or binary fields or do not have line feeds & therefor are not easily displayed by the usual editors or word processors. Records are displayed 256 bytes at a time by default (if record size not specified) in 4 groups of 3 vertical hex lines as follows:

         ......record in character format '.' for non-display characters......
         ...........hex representation of character zones...................
         ...........hex representation of character digits..................

 uvhd dat1/custmas1 r256s2   <-- try this command to display the testfile
 =========================       options: r256=record-size, s2=double space
                      10        20        30        40        50        60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD          NANA
             3333332222454545444244545524542222233332445442544422222222224444
             130140000056527255E0DF4F230C44E0000181502F75E02F140000000000E1E1
          64 IMO          BC V9S1H1    250-754-5531 LARRY WRENCH     ..4V|...
             4442222222222442535343222233323332333324455525544442222201357000
             9DF00000000002306931810000250D754D55310C12290725E38000000246C000
         128 .........W0....`........)X}..f3.....\.................4V}...f...
             0000000005300016000000002570063100095000000000000000013570016000
             0C0000C0270D0540C0000C0098D0263C0444C0000C0000C0000C0246D0056C00
         192 .E|...V}.......................f.....<........f.C 20190320
             0470005700000000880000000018000680001300000000694233333333222222
             35C0046D0000C0023C0000C0083C0056D0012C0000C0016D3020190320000000

rec#=1 rsize=256 rcount=32 fsize=8192 fptr=0 null=next,r#=rec,s=search,u=update,x=undo,p=print,i=iprint,w=write,e=count ,R#=Recsize,h1=char,h2=hex,g=genseq#,c=chkseq#,t=translate(ta,te,tu,tl,tc,tp) ,q=quit,k0=helpoff,k1=helpon,?=HelpScreens --> q

Any non-display characters are represented by periods on the character line (1st line of 3 vertical hex lines). The above example has a lot due to the multiple packed decimal fields.

In this example we entered 'q' to quit after the 1st 256 bytes of the file was displayed, but we could have used any of the various commands to browse, search, select, update, tally, etc. Enter '?' at the prompt for the 'help' screens which show you the command formats.

See 'uvhd.doc' for the more details, examples,& tutorials.

Goto:   Begin this document End this document UVSI Home-Page

F1. Test/Demo the Vancouver Utilities

uvcp test/demo - record selection

Suppose we wanted to select all sales record for hammers 'HAM001' in bytes 30-35 of our test data file (listed on the previous page). Run the following uvcp command & confirm that your output matches the output shown below.


 #1. uvcp "fili1=dat1/sales3,typ=RST,rcs=64,filo1=tmp/s3,sel1=30(6):HAM001"
     ======================================================================

 #2. cat tmp/s3     <-- display output file (should match following)
     ==========
 130140    21 940802 IN111001  HAM001  00020+ 0000001 00000020+
 150825    44 960804 IN1122    HAM001  00025+ 0005001 00125025+
 223240    65 980816 CR955     HAM001  00028+ 0008001 00224028+
 315512    44 000805 IN2251    HAM001  00013- 0003001 00039013-
 406082    65 020816 IN441     HAM001  00019- 0009001 00171019-

You can play with different record selections, for example we could add another criteria - select hammers, but only for salesman '44'. For brevity, I will omit most of the original command above & repeat only the 'sel' commands.


 #1. uvcp "fili1=...as above...,sel1=30(6):HAM001,sel2=10(2):44"
     ===========================================================

 #2. cat tmp/s3     <-- display output file (should match following)
     ==========

150825 44 960804 IN1122 HAM001 00025+ 0005001 00125025+ 315512 44 000805 IN2251 HAM001 00013- 0003001 00039013-

Please see the complete documentation in uvcp.htm and several other test/demos in uvtrain.htm

Note that we have described our test file as 'typ=RST' with record size 64. This means the records are all exactly 64 bytes long with a Terminator (LineFeed x'0A') in the last byte. The output file typ is assumed to be the same. The LineFeeds are a convenience for vi, cat, more, lp, uvlp12, etc. Many COBOL applications have no LineFeeds & would use typ=RSF for faster processing.

Please see the various file types & options in uvcp.htm, or briefly on page 'M1' in this document.

Goto:   Begin this document End this document UVSI Home-Page

G1. Test/Demo the Vancouver Utilities

uvsort test/demo - record sorting plus

'uvsort' is a powerful utility which has most of the functionality of the well known & expensive 'SyncSort' utility often used to replace the mainframe sort when mainframes are converted to Unix, Linux, or Windows.

As an example we will sort our test file dat1/sales3 by product# bytes 30-35. Please see the original file in customer# sequence listed on page 'D1'.

We will also demonstrate 'data reduction' (dropping duplicate records for the specified sort keys). For example we might wish to determine only which products are selling by retaining only 1 record for each product#.

Run the following uvsort & confirm that your output matches the output shown.


 #1. uvsort "fili1=dat1/sales3,typ=LSTt,rcs=64,filo1=tmp/s3,key1u1=30(6)"
     ====================================================================

 #2. cat tmp/s3     <-- display output file (should match following)
     ==========

201120 44 970807 CR5234 BBQ001 00027+ 0007001 00189027+ 308685 21 990813 IN6605 BIT075 00011- 0001001 00011011- 130140 21 940804 IN111001 CHR001 00022+ 0002001 00044022+ 130140 21 940802 IN111001 HAM001 00020+ 0000001 00000020+ 150825 44 960805 IN1122 HAX129 00026+ 0006001 00156026+ 308685 21 990812 IN6605 SAW051 00010- 0000001 00000010- 130140 21 940803 IN111001 SCR012 00021+ 0001001 00021021+ 139923 35 950802 IN111002 TAB013 00023+ 0003001 00069023+

Compare this to the original on page 'D1' & note that the output records are in product# sequence & that duplicates have been dropped.

Data reduction is requested by option 'u1' of the sort key 'key1u1=30(6)'.

You combine data reduction with record selections, for example wish to select sales after 1999, then our uvsort command might be as shown below. (I will omit most of the original above & repeat only the 'key' & the 'sel' commands).


 #1. uvsort "fili1=...as above...,key1u1=30(6),sel1=13(2)<10"
     ========================================================

 #2. cat tmp/s3     <-- display output file, should be as above
     ==========         without any records for years 1999 & older.

Please see many other powerful features in the complete documentation in uvsort.htm and several other test/demos in uvtrain.htm

Goto:   Begin this document End this document UVSI Home-Page

H1. Test/Demo the Vancouver Utilities

uvlist - Program Description

uvlist will list ascii text files (on stdout by default) but with the main intention of piping to a printer. Several scripts are provided (such as uvlp12) which includes pipe to the printer, so you can list your text files with a minimum of keystrokes.

Many options are provided for laser printers, for example you can list 132 column reports on 8 1/2 width paper using the 'uvlp18' script which includes the option to print at 18 characters per inch.

uvlist will help you get organized & stay organized by allowing you to file your important listings in standard 8 1/2 x 11 3 ring binders & by ensuring that all listings have page headings that identify the file name & the last modification date.

Here are a few sample commands for uvlist, but uvlist is not usually run directly, but rather by using 1 of the many supplied scripts with convenient pre-defined options, such as 'uvlp12' (see below).


 uvlist file [format-options] [HP laser-options]  <-- command format
 ===============================================

 uvlist filename                  <-- display file contents on the screen
 ===============                    - standard output is the default

 uvlist file | lp                 <-- redirect output to the printer
 ================

 uvlist file p60 c12m300 | lp     <-- format options for 60 lines/page (dflt)
 ============================         laser options 12 cpi, margin 300/720"

 uvlp12 file                      <-- same as above, uvlp12 script includes
 ===========                          these options & redirects to the printer

 uvlp12 file b91e95               <-- same as above, with options to
 ==================                   begin on page 91 & end on page 95

uvlp12 script

Here is just the 1 essential line extracted from the 'uvlp12' script.


 uvlist $1 p60z2$2 a2t1c12$3 | lp $UVLPDEST $UVLPOPTN
 #===================================================

You can see that $1 is the filename & $2/$3 are optional addons to the default options for the uvlp12 script. Note the 2 sets of options (format & laser). Your .profile should include 'export UVLPDEST="-dlp0"' to set the destination & 'export UVLPOPTN="-onobanner"' to set other desired options.

Please see many more options & examples documented in uvlist.htm.

Goto:   Begin this document End this document UVSI Home-Page

H2. Test/Demo the Vancouver Utilities

Shell Scripts provided for uvlist

The following scripts (based on the uvlist utility) are very useful for printing programs, scripts, or miscellaneous text files when you would like to have page headings & page numbering, with various other pre-defined options.

uvlist Korn Shell scripts

uvlp
  • Portrait at 10 cpi (76 chars on 8 1/2" wide)
uvlp12
  • Portrait at 12 cpi (90 chars on 8 1/2" wide)
uvlp13
  • Portrait at 12 cpi (100 chars on 8 1/2" wide) <-- my favorite
uvlp14
  • Portrait at 14 cpi (108 chars on 8 1/2" wide)
uvlp16
  • Portrait at 16 cpi (120 chars on 8 1/2" wide)
uvlp18
  • Portrait at 18 cpi (134 chars on 8 1/2" wide)
uvlp18v8
  • Portrait at 18 cpi across & 8 lpi down
    (134 chars across & 80 lines down on 8 1/2 portrait)
  • use to print COBOL reports on 8 1/2 x 11 Portrait Simplex
uvlp12L
  • Landscape at 12 cpi (128 chars on 11" wide)
uvlp14L
  • Landscape at 14 cpi (150 chars on 11" wide)
uvlp16L
  • Landscape at 16 cpi (170 chars on 11" wide)

preferred scripts to print COBOL reports

uvlp13L
  • Landscape Simplex at 13 cpi & 8 lpi
  • 136 chars across, 60 lines down
  • use to print COBOL reports on 8 1/2 x 11 Landscape Simplex
uvlp13LD
  • Landscape Duplex at 13 cpi & 8 lpi
  • 136 chars across, 60 lines down
  • use to print COBOL reports on 8 1/2 x 11 Landscape Duplex
uvlp18LD
  • Landscape Duplex at 18 cpi & 8 lpi
  • 180 chars across, 56 lines down

Please see more uvlist scripts documented in uvlist.htm.

Goto:   Begin this document End this document UVSI Home-Page

I1. Test/Demo the Vancouver Utilities

uvcopy job=sltbl1 - table analysis demo

uvcopy is the most powerful of the Vancouver Utility programs. uvcopy is the basis for many of the conversion tools & for hundreds of pre-programmed jobs that do various useful things, such as table analysis. Here is an example based on the dat1/sales2 file previously listed in full on page 'D1'.

sample input file - 1st 3 of 20 records

           1         2         3         4         5         6
 0123456789012345678901234567890123456789012345678901234567890123
  cust# slsm#  date  invoice# product#    qty   price    amount
 130140    21 940802 IN111001  HAM001  000020 0000001 000000020
 130140    21 940802 IN111001  SCR012  000021 0001001 000021021
 139923    35 950802 IN111002  CHR001  000022 0002001 000044022

Our test/demo uvcopy job=sltbl1 will read thru the file, building a table in memory of sales quantity & $amount by product code. At end of file the table will be printed with line item % calculated of the 100% total lines.


 #1. cd ~uvadm     - change to UV superdir with subdirs dat1, tmp, & pf/demo

 #2. uvcopy sltbl1,fili1=dat1/sales2,filo1=tmp/sltbl1.rpt   <-- the hard way
     ===================================================
 #2a. uvcopy sltbl1    <-- the easy way (the I/O filenames default as above)
      =============
 #3. cat               <-- enter 'cat' when prompted for report disposition
     ===                 - will display report (from tmp/sltbl1.rpt)

sample output report

 sltbl1  2019/03/20_10:50:31  sales analysis by product# of qty & amt dat1/sales3
 tbl#0001  tblt1f3 a30(6)                      -acum#1-    %        -acum#2-    %
 line#     count  %    1strec#  product#      sales qty            sales amt
     1         3  15         8  BBQ001               39   39        3,310.39   73
     2         2  10        12  BIT075               26-  26-         860.26-  19-
     3         1   5         3  CHR001               22   22          440.22    9
     4         5  25         1  HAM001               41   41        1,390.41   30
     5         2  10         7  HAX129               10   10          600.10   13
     6         2  10        11  SAW051               24-  24-         560.24-  12-
     7         1   5         2  SCR012               21   21          210.21    4
     8         4  20         4  TAB013               17   17           29.83-   0
              20*100             *TOTAL*            100 *100        4,501.00 *100

See the uvcopy job=sltbl1 code listed on next the next page --->

Before you look, guess how many instructions were required to create the report shown above. This job demonstrates the power & conciseness of uvcopy. It would take thousands of lines of COBOL code to create similar table analysis summary reports.

Goto:   Begin this document End this document UVSI Home-Page

I2. Test/Demo the Vancouver Utilities

pf/demo/sltbl1 - uvcopy job to demo table analysis

 rop=r1x2  #run option to prompt at EOJ for report disposition (vi,cat,more,etc)
 fili1=?dat1/sales3,typ=RSF,rcs=64
 filo1=?tmp/sltbl1.rpt,typ=LSTt,rcs=80
 @run
        opn     all
 # begin loop to get & table until EOF
 man20  get     fili1,a0             get next record
        skp>    eof                  (cc set > at EOF)
        tblt1f3 a30(6),'product#; sales qty; sales amt',a38(6),a53(9)
        skp     man20                return to get next record
 # EOF - dump table to report file & display report
 eof    tbpt1s2 filo1,'sales analysis by product# of qty & amt $fili1'
        cls     all
        eoj

Only 12 uvcopy instructions were required to create the report. All uvcopy instructions are documented in uvcopy3.htm (vol 3 of UVdoc). All instructions are 3 characters & may be followed by options.

The options used on 'tbl' & 'tbp' (2 most pertinent instructions in this job) are described below:

        tbl     - build table in memory
        ___t1   - option t1 for table#1 (t2 for table #2, etc)
        _____f2 - option f2 for format 2 (acum1=quantity, acum2=dollars/cents)
        tbp     - print table (write memory table to output file for later use)
        ___t1s2 - options to identify table#1 & space 2 after table written

Here is the good news - you don't have to learn the uvcopy code before you can use it - there are hundreds of pre-programmed jobs that do many useful things (such as the table analysis demonstrated above). You can use the pre- programmed jobs on your own files since they solicit filenames, record-sizes, etc (vs the demo job above designed for 1 specific test file).

The next page will demonstrate using 'table2' (a uvcopy pre-programed job) to generate a report similar to that shown on the previous page. Sometimes, you may still want to write your own uvcopy job (as above) to use some of the more powerful features, for example:

  1. May accumulate up to 6 fields + count (vs only 1 field + count)
  2. May customize editing as required (quantity vs dollars & cents)
  3. May create up to 255 tables in 1 job (vs only 1 table in table2 GP job)
  4. Increase table entries (run option v) from default v8000 up to available memory.
  5. May create multi-part table arguments. For example to summarize sales by product# within each salesman, you can move slsmn# & product# together in a work area & specify the combination as the table argument.
  6. May identify the field headings more explicitly.

Goto:   Begin this document End this document UVSI Home-Page

J1. Test/Demo - Pre-Programmed jobs

table2 - table analysis for fixed length records

'table2' is a 'pre-programmed' uvcopy job that you can run on any fixed-length record file to create a table summary of record counts & 2 other qty/amt fields by a specified argument field. No programming required, just run 'uvcopy table2'.

'table2' solicits the filename & options which define displacement & length of the table argument,& 1 or 2 fields to be accumulated. table2 then reads through the file & displays or prints the accumulated totals sorted & summarized to one line per unique key field value.

demo input file - dat1/sales3

            1        2         3         4         5         6
 0123456789012345678901234567890123456789012345678901234567890123
  cust# slsm#  date  invoice# product#    qty   price    amount
 130140    21 940802 IN111001  HAM001  00020+ 0000001 00000020+
 130140    21 940803 IN111001  SCR012  00021+ 0001001 00021021+
 130140    21 940804 IN111001  CHR001  00022+ 0002001 00044022+
 139923    35 950802 IN111002  TAB013  00023+ 0003001 00069023+
 139923    35 950807 IN111002  TAB013  00024+ 0004001 00096024+
 150825    44 960804 IN1122    HAM001  00025+ 0005001 00125025+
 150825    44 960805 IN1122    HAX129  00026+ 0006001 00156026+
 201120    44 970807 CR5234    WHIP75  00027+ 0007001 00189027+
 223240    65 980816 CR955     HAM001  00028+ 0008001 00224028+
 223240    65 980817 IN441     BBQ001  00029+ 0009001 00261029+
 308685    21 990812 IN6605    SAW051  00010- 0000001 00000010-
 308685    21 990813 IN6605    WHIP75  00011- 0001001 00011011-
 308685    21 990814 CR8835    TAB013  00012- 0002001 00024012-
 315512    44 000805 IN2251    HAM001  00013- 0003001 00039013-
 315512    44 000806 IN2251    SAW051  00014- 0004001 00056014-
 315512    44 000807 IN2255    WHIP75  00015- 0005001 00075015-
 400002    85 010812 CR245     HAX129  00016- 0006001 00096016-
 406082    35 020815 IN33001   BBQ001  00017- 0007001 00119017-
 406082    35 020816 IN33001   TAB013  00018- 0008001 00144018-
 406082    65 020816 IN441     HAM001  00019- 0009001 00171019-

Operating Instructions


 uvcopy table2,fili1=dat1/sales3,uop=a30b6c38d6e53f9g3r64,filo1=stats/sales3_product.tbl
 =======================================================================================

 uvcopy table2     <-- alternative, minimal entry & reply to prompts
 =============       - for filename & options
                     - filenames default as shown above (for this demo)

--> see options & prompts illustrated on the next page -->

Goto:   Begin this document End this document UVSI Home-Page

J2. Test/Demo - Pre-Programmed jobs

Op. Instrns. for 'table2' demo


 uvcopy table2        <-- enter this command
 =============          - will display options & prompt as follows:
 uop=a0b0c0d0e0f0g1p0r0 - option defaults
 uop=a0                 - argument displacement (0 rel)
 uop=  b0               - argument length
 uop=              note - may omit options c,d,e,f,p for record counts only
 uop=    c0             - acum#1 displacement (0 rel)
 uop=      d0           - acum#1 length
 uop=        e0         - acum#2 displacement (0 rel)
 uop=          f0       - acum#2 length
 uop=            g1     - edit all acums as qty (commas, no decimal)
 uop=            g2     - edit all acums as $ (commas & decimal point)
 uop=            g3     - edit acum#1 qty, acums#2-#6 $amount
 uop=            g__    - table formats g1-g12 see uvcopy.doc tbf f1-f12
 uop=        p0         - acum-fields unpacked, "p1" packed, "p2" binary
 uop=          r8192    - input record size (max 8192)
 uop=              note - if file type LST specify r > largest possible
 uop=a30b6c38d6e53f9g3r64  <-- ENTER this for demo with dat1/sales3 file
     ====================
 product#;quantity;amount  <-- ENTER this for demo Field Headings
 ========================
 Summary of Qty & Amt by Product#  <-- ENTER this for demo Report Heading
 ================================
               <-- ENTER null at filename prompt to accept demo input
                   Notes re: input File TYPE prompts
 RSF (default) <-- Record Seqntl Fixed (recsize option r must be correct)
 LST           <-- Line Seqntl Terminated (specify r > largest possible)
 User OPtion (uop) defaults  = q1a0b0c0d0e0f0g1p0r0
 null to accept or re-specify (1 or more)

 --> a30b6c38d6e53f9g3r64   <-- suggested options
     ====================
 enter table header fieldnames separated by semicolons (argument;acum1;acum2)
 --> product;qty;amt        <-- suggested field headings
     ===============

enter table heading (optional, prints above fieldnames) --> summary of qty & amt by product# <-- suggested report headings ================================

 dat1/sales3 = default fili01 - null accept or reenter ?
 -->         <-- null to accept default input file
 RSF = typ default fili01 - null accept or enter new typ ?
 -->         <-- null to accept default file type (fixed)
 EOJ, Output File written to: stats/sales3_product.tbl
 enter command: vi,cat,more,lp,uvlp12,null --> cat
 --> cat     <-- enter 'cat' to display report on screen
               - see report on the next page ----->

Goto:   Begin this document End this document UVSI Home-Page

J3. Test/Demo - Pre-Programmed jobs

table2 - sample output report

 table2  2019/03/20_10:53:57  summary of qty & amt by product# uop=a30b6c38d6e53f9g3r64
 tbl#0001  tblo1t1 n0($rn32)                          -acum#1-    %        -acum#2-    %
 line#     count  %    1strec#
     1         3  15         8  BBQ001                      39   39        3,310.39   73
     2         2  10        12  BIT075                      26-  26-         860.26-  19-
     3         1   5         3  CHR001                      22   22          440.22    9
     4         5  25         1  HAM001                      41   41        1,390.41   30
     5         2  10         7  HAX129                      10   10          600.10   13
     6         2  10        11  SAW051                      24-  24-         560.24-  12-
     7         1   5         2  SCR012                      21   21          210.21    4
     8         4  20         4  TAB013                      17   17           29.83-   0
              20*100             *TOTAL*                   100 *100        4,501.00 *100

Please see more examples in TABLEjobs.htm and alternate job 'table1' for variable length delimited text files.

Goto:   Begin this document End this document UVSI Home-Page

J4. Test/Demo - Pre-Programmed jobs

table3d - table summary for text files (JCL,COBOL,etc)

'table3d' is a more useful than 'table2' for JCL/script & COBOL conversions because it is designed to process entire directories of files. 'table3d' allows you to specify a 'key-word', preceding a 'target-word'. The job searches all lines of all files in the directory & the report shows one line for each target-word with the counts & percentages of the total line.

We will demo by table sumamrizing all programs executed in a directory of mainframe JCL (before conversion to scripts). Here are 2 of the program EXEC PGM=... lines targeted by the table3d command below.

//STEP010 EXEC PGM=CAR100,PARM=2008 //STEP020 EXEC PGM=CAR200,COND=(4,LT,STEP010),PARM=2006

Op. Instrns to summarize Programs in JCL


 #1. uvcopy table3d,fild1=jcl0,arg1=PGM,arg4=ce (ce for Comma & Equal)
     ==========================================
      fild1 - directory containing the JCL
      arg1  - search pattern
      arg2  - qualifier present (not required for this example)
      arg3  - qualifier absent  (not required for this example)
      arg4  - characters to blank '=' & '.' for word separation
            - specify on cmd line as arg4=ce (Comma & Equal)

sample report - summary of Programs in all JCL


 #2. cat stats/jcl0_PGM_ce
     =====================
 # /home/userxx/demo/stats/jcl0_PGM_ce  <-- This report created by uvcopy:
 # uvcopy table3d,fild1=jcl0,arg1=PGM,arg4=ce
 # =====================================================================
 # - scan all files in directory for a keyword & table countsof following word
 # InDir=jcl0  Keyword=PGM  Qual1=   Qual2=
 # WordSepsBlank=,=  Options=q1a0b3c0d0f0j0l0m0p1t0x0w1
 # - default selects following word, use option w2 to table 2nd word, etc
 # - specify arg1=Keyword,arg2=Qualifier-present,arg2=Qualifier-absent
 # &\,$=/>-<:(.');_*[|]"<--- arg4=punctuation to blank for word separation
 # abcdefghjklpqrsuALPRQ<--- equivalents, easier to enter, may enter "all"
 # Date=2019/03/28_11:46:15, Site=UV_Software, Host=uvsoft5, User=userxx
 #===============================================================================
 #---> uvcopy table3d,fild1=jcl0,arg1=PGM,arg4=ce
 table3d  2019/03/28_11:46:23  Counts by Targetword followingspecified Keyword
 tbl#0001  tblt1f7 e0(48)
 line#     count  %    1strec#  target-word
     1         1  12         3   CAR100
     2         1  12        13   CAR200
     3         1  12        23   CGL100
     4         1  12        15   CGL200
     5         1  12        11   IDCAMS
     6         1  12         6   IEBGENER
     7         2  25         5   SORT
               8*100             *TOTAL*

Goto:   Begin this document End this document UVSI Home-Page

J5. Test/Demo - Pre-Programmed jobs

table3d - full console log


 uvcopy table3d,fild1=dir,arg1=keyword,arg2=qual1,arg3=qual2,arg4=chars2blank,uop=...
 ====================================================================================
 - use : delimiter for multiple keywords (keyword1:keyword2:keyword3:etc)
 uop=a0b3c0d0f0j0l0m0p1t0x0w1 - option defaults
     a1                   - "&" variable end "#", insert space after "#" force endword
     a2                   - discard variables not ending with"#"
       b3                 - assume 1 blank before & after keyword (default)
       b1                 - assume 1 blank before & no blank after
       b2                 - assume no blank before & 1 blank after
       b0                 - assume no blank before or after
         c1               - bypass comments in COBOL programs(* column 7)
         c2               - bypass comments in shell scripts (# column 1)
         c4               - bypass comments in JCL //* cols 1-3
           d1             - insert blank before "$", allow arg1=$
             f0           - do not prepend/append table entrywith filename
             f1           - prepend table argument with filename
             f2           - append table argument with filename
               j1         - insert blank before search word in data
               j2         - insert blank after search word indata
               j3         - insert blank & after search word in data
                 l0       - translate lower case before matching patterns
                   m1     - look for multiple keywords on 1 line
                   m2     - look for multiple keywords & prepend targetword
                   m4     - look for multiple keywords & append targetword
                     p1   - qualifier#1 present & qualifier#2absent
                     p2   - qualifier#1 present & qualifier#2present
                     p4   - qualifier#1 absent  & qualifier#2absent
                       t1 - translate to lower-case
                       t2 - translate to UPPER-case
                     w1   - target word is 1st word followingkeyword
                     w2   - target word is 2nd word followingkeyword
                     w0   - target word is same as keyword (partial def)
                   x1     - table w# word (search will ignorekeyword)
                          - specified keyword will be inserted in outfilename
                 y#       - table multiple target words (4 max)
                 y3       - would table target word + following 2 words
               z1         - convert x"A3" to "@" in data for keyword "@"
 special chars to separate words, use with option w# offset from search word
 ------> &\,$=/>-<:(.`);_*[|]" <--- arg4 punctuation chars toblank
 ------> abcdefghjklpqrsuALPRQ <--- OR enter equivalents OR enter "all"
 User OPtion (uop) defaults  = q1a0b3c0d0f0j0l0m0p1t0x0w1
 -->null to accept or enter/override -->
 190328:114623:table3d: EOF fili01 rds=28 size=1242: jcl0/jgl230.jcl hits=3
 190328:114623:table3d: EOF fili01 rds=18 size=1458: jcl0/jar200.jcl hits=2
 190328:114623:table3d: EOF fili01 rds=8 size=648: jcl0/jar100.jcl hits=1
 190328:114623:table3d: EOF fili01 rds=3 size=243: jcl0/jgl100.jcl
 190328:114623:table3d: EOF fili01 rds=4 size=324: jcl0/jgl200.jcl
 190328:114623:table3d: EOF fili01 rds=17 size=1377: jcl0/jgl320.jcl hits=2
 190328:114623:table3d: EOF fild01 rds=8 size=4096: jcl0 hits=8
 190328:114623:table3d: EOF filo01 wrts=20 size=1322: stats/jcl0_PGM_ce
 EOJ, Output File written to: stats/jcl0_PGM_ce
 default command = null, OR enter: vi,cat,more,lp,uvlp12,etc -->

Goto:   Begin this document End this document UVSI Home-Page

J6. Test/Demo - Pre-Programmed jobs

using table3d on converted JCL/scripts

 We can create the same report from the JCL after conversion to shell scripts,
 - using PROGID as our keyword
 - here is the relevant lines extracted from 1 of the JCL/scripts:
 #==================== jar100 begin step#S0010 CAR100 COBOL ================
 logmsg2 "********** Begin Step $JSTEP/$XSTEP car100 COBOL **********"
 export PROGID=car100  # XREFID=COBOL:car100,jar100
 exportfile  CUSTMAS data1/ar.customer.master #SHR
 exportfile  NALIST data1/ar.customer.nameadrs.list100 #(,CATLG,DELETE)
 exportfile SYSOUT $SYOT/${jobid2}_${JSTEP}_SYSOUT_$(date +%y%m%d_%H%M%S)
 #3----------------------------------------------------------------------
 cobrun $ANIM $CBLX/car100
 #4----------------------------------------------------------------------

 #1. uvcopy table3d,fild1=jcl3,arg1=PROGID,arg4=e (or could use arg4==)
     ============================================

 #2. cat stats/jcl3_PROGID_e
     =======================
 # /home/userxx/demo/stats/jcl3_PROGID_e  <-- This report created by uvcopy:
 # uvcopy table3d,fild1=jcl3,arg1=PROGID,arg4=e
 # =====================================================================
 # - scan all files in directory for a keyword & table countsof following word
 # InDir=jcl3  Keyword=PROGID  Qual1=   Qual2=
 # WordSepsBlank==  Options=q1a0b3c0d0f0j0l0m0p1t0x0w1
 # - default selects following word, use option w2 to table 2nd word, etc
 # - specify arg1=Keyword,arg2=Qualifier-present,arg2=Qualifier-absent
 # &\,$=/>-<:(.');_*[|]"<--- arg4=punctuation to blank for word separation
 # abcdefghjklpqrsuALPRQ<--- equivalents, easier to enter, may enter "all"
 # Date=2019/03/28_11:48:01, Site=UV_Software, Host=uvsoft5, User=userxx
 #===============================================================================
 #---> uvcopy table3d,fild1=jcl3,arg1=PROGID,arg4=e
 table3d  2019/03/28_11:48:03  Counts by Targetword followingspecified Keyword
 tbl#0001  tblt1f7 e0(48)
 line#     count  %    1strec#  target-word
     1         1   9        23   car100
     2         1   9        52   car200
     3         2  18        70   cgl100
     4         2  18        50   cgl200
     5         1   9        49   idcams
     6         1   9        26   iebgener
     7         3  27        25   sort
              11*100             *TOTAL*

Goto:   Begin this document End this document UVSI Home-Page

K1. more Pre-Programmed jobs for the uvcopy interpreter

There are over 300 pre=programmed jobs provided with the Vancouver utilities to do various things found useful at customer sites. For example COBOL shops have found the 'cobmap1' job most useful. cobmap1 reads a COBOL copybook & creates a report showing the field start, end, length,& type on the right side.

cobmap1 - calculate record layout from COBOL copybook

As an example, we will generate the 'cobmap' for the dat1/sales3 file that we have been using for some of our demo jobs (see listing on page 'D2').


 uvcopy cobmap1,fili1=tf/sales3.cpy,filo1=tmp/sales3.map
 =======================================================

 uvcopy cobmap1       <-- just this will prompt you for filenames
 ==============
    --> tf/sales3.cpy <-- enter desired input filename (default if null entry)
    -->               <-- output filename will default tmp/cobmap if null entry)

 cat tmp/sales3.map   <-- display record layout created by cobmap1
 ==================
 cobmap1  start-end bytes for cobol record fields    200303291315  pg# 0001
 cpy1/sales3.cpy                                   RCSZ=00064  bgn  end  lth typ
 * sales3 - cobol copy book for sales3 test/demo file
      10 sl-cust       pic  9(6).                             0000 0005  006 n  6
      10 filler001     pic  x(4).                             0006 0009  004
      10 sl-slsmn      pic  9(2).                             0010 0011  002 n  2
      10 filler002     pic  x.                                0012 0012  001
      10 sl-date       pic  9(6).                             0013 0018  006 n  6
      10 filler003     pic  x.                                0019 0019  001
      10 sl-inv        pic  x(8).                             0020 0027  008
      10 filler004     pic  x(2).                             0028 0029  002
      10 sl-prod       pic  x(6).                             0030 0035  006
      10 filler005     pic  x(2).                             0036 0037  002
      10 sl-qty        pic  s9(6).                            0038 0043  006 ns 6
      10 filler006     pic  x.                                0044 0044  001
      10 sl-price      pic  9(4)v99 sign trailing separate.   0045 0051  007 n  7
      10 filler007     pic  x.                                0052 0052  001
      10 sl-amount     pic  9(6)v99 sign trailing separate.   0053 0061  009 n  9
      10 filler008     pic  x(2).                             0062 0063  002
 *RCSZ=00064                                                       0064

The mainframe to unix conversions also use cobmap1 as the 1st step in generating jobs to automatically convert mainframe EBCDIC files to ASCII preserving packed decimal fields. See details in DATAcnv1.htm.

Goto:   Begin this document End this document UVSI Home-Page

L1. test/demo Vancouver Utilities - uvqrpg Report Writer

qrpgEX1 - sales analysis by customer within salesman

dat1/sales4 record layout

 01-02 - salesman#       <-- control level #2 (major)
 04-09 - customer#       <-- control level #1 (minor)
 14-19 - date
 21-28 - invoice#
 31-36 - product code
 39-44 - quantity        <-- to be accumulated in acum1
 46-52 - price
 54-62 - amount          <-- to be accumulated in acum2

dat1/sales4 - test/demo data

 sl# cust#    date   invoice   product  qty    price   amount
           1         2         3         4         5         6
 0123456789012345678901234567890123456789012345678901234567890123
 ================================================================
 21 130140    960802 IN111001  HAM001  000010 0001000 000010000
 21 130140    960802 IN111001  SAW012  000020 0002000 000040000
 21 139923    970802 IN111002  CHR001  000030 0003000 000080000
 21 139923    970802 IN111002  TAB013  000042 0004000 000160000
 21 139923    970807 CR5421    TAB013  000050 0005000 000250000
 44 250825    980804 IN1122    HAM001  000060 0006000 000360000
 44 250825    980804 IN1122    SAW012  000070 0007000 000490000

 uvqrpg qrpgEX1        <-- execute uvqrpg demo
 ==============          - see uvqrpg job listed on next page -->

qrpgEX1 report - tmp/sales4.rpt

 Sales Analysis by customer within salesman   2019/03/20_13:08:34 page0001 uvadm
 sl# cust#  date   invoice  product quantity       price         amount
 ======================================================================
 21  130140 960802 IN111001 HAM001        10       10.00         100.00
            960802 IN111001 SAW012        20       20.00         400.00
                                          30 *                   500.00 *
     139923 970802 IN111002 HAM001        30       30.00         800.00
            970802 IN111002 TAB013        42       40.00       1,600.00
            970807 CR5421   TAB013        50       50.00       2,500.00
                                         122 *                 4,900.00 *
                                         152 **                5,400.00 **
 44  250825 980804 IN1122   HAM001        60       60.00       3,600.00
            980804 IN1122   SAW012        70       70.00       4,900.00
                                         130 *                 8,500.00 *
     401210 990816 CR955    HAM001        80       80.00       6,400.00
            990816 IN441    BIT001        90       90.00       8,100.00
                                         170 *                14,500.00 *
                                         300 **               23,000.00 **
                                         452 ***              28,400.00 ***

Goto:   Begin this document End this document UVSI Home-Page

L2. test/demo Vancouver Utilities - uvqrpg Report Writer

qrpgEX1 - coding required to create sample report

 # qrpgEX1 - uvqrpg example - sales analysis by customer within salesman
 #         - see uvqrpg.doc for input file layout & sample report expected
 #
 # uvqrpg qrpgEX1,fili1=dat1/sales4,filo1=tmp/qrpgEX1.rpt <-- run job (hard way)
 # ======================================================
 #
 # uvqrpg qrpgEX1   <-- run job (easy way, filenames default as shown above)
 # ==============
 #
 fili1=?dat1/sales4,rcs=64,typ=LST
 filo1=?tmp/$jobname.rpt,rcs=80,typ=LSTt
 head2=h2000(45),'Sales Analysis by customer within salesman '
 head2=h2045(25),'$datetime $page####'
 head1s2p55u4=h1000(50),'sl# cust#  date   invoice  product quantity'
 head1=h1050(30),'price         amount'
 ctll2=a0(2),'sl#'
 ctll1=a3(6),'cust#'
 ref=a13(6),'date'
 ref=a20(8),'invoice'
 ref=a30(6),'product'
 acum1=a38(6),'quantity',,'zz,zz9-'
 ref=a45(7),'price',,'zz,zzz.99-'
 acum2=a53(9),'amount',,'zzzzz,zzz.99-'

<-- Please relate the report on the previous page to the uvqrpg code above.

  1. Note that the fieldnames on 'ctl,ref,acum' must match the fieldnames on 'head1' & the print positions of the ctl,ref,acum data contents will be determined by the placement of the matching fieldnames within head1.

  2. Alphanumeric fields (ctl & ref) will be left justified to their matching fieldnames within head1, but numeric fields (acum) will be right justified.

  3. 'head1' is coded on 2 lines for convenience - h1000(50) & h1050(30). We could code on 1 line, but the parameter file listing would not be nice.

  4. The head1 options s2p55u4 must be on the 1st line (starting at h1000) 's2p55u4' means space 2, 55 lines per page, underline headings with '='s

  5. Re: ctl1=a3(6),'cust#' <-- indicates level 1 total control field This causes level 1 totals to print automatically at the end of each cust# record control group (cust# in bytes 3-8 of all input records).

  6. Re: acum1=a38(6),quantity,,'zz,zz9-' This edits the quantity from bytes 38-43 of each input record into the print line right justified under the matching fieldname in head1. The record field contents are accumulated to all 8 total levels. Combined with ctll1 & ctll2, acum automatically causes the printing of cust#, slsmn#,& final totals as the control fields break.

Please see more examples in uvqrpg.htm.

Goto:   Begin this document End this document UVSI Home-Page

M1. Test/Demo D-ISAM Indexed Files (using uvcp, uvsort,& uvcopy)

The Vancouver Utilities will be especially useful to Micro Focus COBOL users, since the D-ISAM indexed file handler is compatible with Micro Focus COBOL. uvcp, uvsort,& uvcopy make it easy to perform various maintenacne & utility functions (load, unload, sort, list, extract, reorganize, clear fields, etc).

D-ISAM files have 2 parts. The data & index are separate files, for example:

 cusmaster.dat     <-- data partition of customer master file
 cusmaster.idx     <--index partition of customer master file

Actually Micro Focus COBOL does not expect the '.dat' extension, and D-ISAM was modified for Vancouver Utilities to default to no extension. But this is optional & controlled by the following export/set. I suggest you activate this now, so it is easier to distinguish between sequential & indexed files on the following test/demos.


 export DISAMEXT=dat   <-- causes .dat extension when DISAM files created
 ===================

UV file type codes

typ=RSF
  • Record Sequential Fixed length records
typ=RST
  • Record Sequential Terminated (by LF x'0A' last byte) fixed length
typ=LST
  • Line Sequential Terminated (text records, variable length with LFs)
typ=ISF
  • Indexed Sequential Fixed length records
typ=IDXf3
  • Indexed Sequential Variable length records
typ=IDXf8
  • Indexed Sequential Variable length records (allows > 2 gig)

These are the most common file types & relevant to the following exercises (please see uvcp.htm#F1 page F1 for the complete list). To load an indexed file the input file type would usually be typ=RSF or typ=LST & the output type would usually be typ=ISF. We will not cover typ=IDXf3/IDXf8 here (see uvcp.htm#F3).

Goto:   Begin this document End this document UVSI Home-Page

M2. Test/Demo D-ISAM Indexed Files (using uvcp, uvsort,& uvcopy)

Load an Indexed file using uvcp


 #1. del tmp/*             - delete any old files from the tmp subdir

 #2. uvcp "fili1=dat1/sales3,typ=RSF,rcs=64,filo1=tmp/s3,typ=ISF,isk1=0(6d)"
     =======================================================================

 #3. dir tmp               - list output files created
     --> s3.dat            - data partition
     --> s3.idx            - index partition

 #4. uvhd tmp/s3.dat r65h2 - inspect data partition with uvhd
     =====================   (1st record shown below)
                      10        20        30        40        50        60
             0123456789012345678901234567890123456789012345678901234567890123
           0 130140    21 940802 IN111001  HAM001  00020+ 0000001 00000020+ .
             3333332222332333333244333333224443332233333223333333233333333220
             130140000021094080209E1110010081D0010000020B00000001000000020B0A
          64 .
             0
             A
 rec#=1 rcount=20 rsize=65 fsize=1300 tmp/s3
 null=next,r#=rec,s=search,u=update,p=print,i=iprint,w=write,t=tally,c=checkseq
 ,R#=Recsize,h1=char,h2=hex,q=quit,?=help -->

Note that the output records are 65 bytes. D-ISAM adds an extra byte at the end of the record x'0A', which is changed to a x'00' for a deleted record. Our input records already had a x'0A' (LineFeed) in the the 64th byte (0 relative 63) since this was a test/demo file & we wanted you to be able to inspect the records with the editor.

Note that the Indexed Sequential Key is specified by 'isk1=0(6d)'. This is the customer# in the 1st 6 bytes, 0 displacement (6 long). The 'd' means duplicates allowed. Please see more details on page uvcp.htm#D1.


 #5. uvhd tmp/s3.idx       - inspect index partition with uvhd
     ===============

There is no point in looking at the index partition, we cannot understand it without the technical D-ISAM documentation. If it becomes corrupted, you can recreate it from the data partition using uvcp (as above) or uvsort to create a more efficient indexed file (see uvsort.htm).

Goto:   Begin this document End this document UVSI Home-Page

M3. Test/Demo D-ISAM Indexed Files (using uvcp, uvsort,& uvcopy)

Unloading an Indexed file using uvcp


 #1. uvcp "fili1=tmp/s3,typ=ISF,rcs=64,filo1=tmp/s3a,typ=LSTt"
     =========================================================

 #2. uvhd tmp/s3a t1h2     - inspect output file (confirm just 1 LF)
     =================

Sort & Reload an Indexed file


 #1. uvsort "fili1=tmp/s3,typ=ISF,rcs=64,filo1=tmp/s3,isk1=0(6d),key1=0(6)"
     ======================================================================

Goto:   Begin this document End this document UVSI Home-Page

M4. Test/Demo D-ISAM Indexed Files (using uvcp, uvsort,& uvcopy)

listISF - list any Indexed file

'listISF' is a pre-programmed job to list any C-ISAM/D-ISAM IDXFORMAT1 indexed file without having to specify record size or keys. By default it will output the 1st 80 bytes of each record into a text file (with options to change output records size, & record counts to bypass, copy,& stop). This job is quite useful to extract the front end character portion from long records with trailing packed fields that cannot be displayed or printed with out special tools such as uvhd. For example we could extract the name & address portion (1st 80) from our custmast demo Indexed file (of 256 byte records with many trailing packed fields). Here is the 1st record (illustrating the packed fields) from the uvhd demo on page 'E1'. Note that we will use 'dat1/custmast' the Indexed version of dat1/custmas1 & Indexed files have 2 partitions - custmast.dat & custmast.idx in this case.

 rec#=1 rsize=256 fptr=0 fsize=8192 records=32
                      10        20        30        40        50        60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD          NANA
             3333332222454545444244545524542222233332445442544422222222224444
             130140000056527255E0DF4F230C44E0000181502F75E02F140000000000E1E1
          64 IMO          BC V9S1H1    250-754-5531 LARRY WRENCH     ..4V|...
             4442222222222442535343222233323332333324455525544442222201357000
             9DF00000000002306931810000250D754D55310C12290725E38000000246C000
         128 .........W0....`........)X}..f3.....\.................4V}...f...
             0000000005300016000000002570063100095000000000000000013570016000
             0C0000C0270D0540C0000C0098D0263C0444C0000C0000C0000C0246D0056C00
         192 .E|...V}.......................f.....<........f.C 20190320
             0470005700000000880000000018000680001300000000694233333333222222
             35C0046D0000C0023C0000C0083C0056D0012C0000C0016D3020190320000000

 uvcopy listISF,fili1=dat1/custmast,rop=c6,uop=r80 <-- may enter cmd line args
 =================================================
 uvcopy listISF         <-- easy demo (files & options default as above)
 ==============
 rop     - run options for bypass & list counts (may enter on command line)
           ex: uvcopy listISF,fili1=xx,filo1=yy,rop=b20c10
 Run OPtion (rop) defaults = q1b0c10
  null to accept or re-specify (1 or more) ---> c6    <-- may modify copy option
 uop=r80 - output rec-size option (default=80)
     r80 - rcsz will be 1st 80 (default)
     r0  - indicates full size will be listed
  null to accept or re-specify (1 or more) ---> r80   <-- may modify extract rcsz
 display/edit/print ? (more/edit/type/null)---> type  <-- display output file
 130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD          NANAIMO          BC
 132588    GEECOE GENERATOR SERVICESUNIT 170 - 2851 SIMPSON  RICHMOND         BC
 139923    JOHNSTONE BOILER & TANKS 1250 EAST PENDER STREET  VANCOUVER        BC
 142175    LILLY ELECTRIC (1973) LTD16809 - 24TH AVENUE      SURREY           BC
 145264  D MAGRATH SUPPLIES LTD.    1939 KIRSCHNER ROAD      KELOWNA          BC
 147615    O'CONNER R.V. CENTRE     44430 YALE ROAD WEST     CHILLIWACK       BC

Goto:   Begin this document End this document UVSI Home-Page

N1. Pre-Programmed jobs for Scan & Replace

scan1d - scan a directory for matches to 1,2,or 3 patterns

'scan1d' is a pre-programmed job that will scan any directory of text files for matches on any pattern, qualified by any 2 other patterns that must be or must not be present (default 1 present, 1 absent).


 uvcopy scan1d,fild1=/home/uvadm/doc <-- start job,specifying input dir#1=doc
 ===================================   - answers prompts as shown below:
 uop=q1a1b99999c0d256e0p1 - option defaults
       a1                 - begin scan at line #1 (default) of input file
       a0                 - causes prompt for search pattern to BEGIN scan
         b99999           - end scan at line #99999 (dflt) of input file
               c0         - begin scan at col #1 (zero rel) of input lines
                 d256     - length of scan area default 256 bytes
                       p1 - 1 present qual(31-60) & 1 absent qual(61-80)
                       p2 - 2 present quals(31-60+61-80) & NO absent quals
                       p4 - 2 absent quals(31-60+61-80) & NO present quals
 User OPtion (uop) defaults  = q1a1b99999c0d256e0p1
  null to accept or re-specify (1 or more) --------->            <-- null OK
 enter your search pattern (max 64 bytes)  ---------> conversion <-- enter
 1st qual, dflt present, absent(p4), null=disable --> jclunix51  <-- enter
 2nd qual, dflt absent, present(p2), null=disable -->            <-- omit
 match options: i=case-insens,p=patterns(@,#,etc)
 enter match options: i,p,q1/q2/q3,n,or null      --> i          <-- case-insen
 display/edit/print ? (enter: more/vi/lp/null)    --> more       <-- display
 Job: scan1d  Dir: /home/uvadm/doc  Search: conversion  Qual1: jclunix51  Qual2:
  SearchBgn:    SearchEnd:    MatchOps: i  UserOps: q1a1b99999c0d256e0p1
 ====================================================== 2019/03/20_14:49:45
 00206 exit $JCC  # jclunix51 version=20180601, conversion on 20180605:080937
 00261 exit $JCC  # jclunix51 version=20180601, conversion on 20180605:080937
 00900                   2 hits @EOF: /home/uvadm/doc/bcpload_bcpunload.doc
 01585 exit $JCC  # jclunix51 version=20180705, conversion on 20180705:161515
 03896                   1 hits @EOF: /home/uvadm/doc/jclcnvtest.doc
 01191 'jclxx51' is a script that executes the 'jclunix51' conversion program
 11479                   1 hits @EOF: /home/uvadm/doc/MVSCOBOL.doc
 03614 'jclxx51' is a script that executes the 'jclunix51' conversion program
 03720 vi tmp/jclunix51.err          <-- inspect JCL conversion Error Log
 03727 uvlp12 tmp/jclunix51.err      <-- print the JCL conversion Error Log
 06630 jclunix51 conversion program. Several options are specified on line 1:
 18371                   4 hits @EOF: /home/uvadm/doc/MVSJCL.doc
 ====================================================== 2019/03/20_14:49:47
  EOD: 00008 hits in 0004 files of 0152 total (44382 lines)

The report tells me the line#s, making it easy locate them in the editor.

Goto:   Begin this document End this document UVSI Home-Page

O1. Pre-Programmed jobs for Scan & Replace

rep2 - table driven search/replace

'rep2' is a pre-programmed job to copy any text file searching & replacing depending on a table of patterns (search, replace, qualify present & absent).

For our test/demo we will use the table shown below. The table patterns must be '~' tilde filled to indicate pattern length & the table is ended by a line of all tildes.

cols 001-030
  • search pattern (tilde filled)
cols 031-060
  • replace pattern (tilde filled)
cols 061-080
  • 1st qualifier, optional, default present
cols 031-060
  • 2nd qualifier, optional, default absent

 #1. cat tf/rep2demo.tbl   <-- inspect search/replace table
     ===================
Note
  • the audit report below will list the table contents,
  • followed by data file lines that have been modified.

 #2. uvcopy rep2,fili1=dat1/sales3,filo1=tmp/s3,fili2=tf/rep2demo.tbl <--run demo
     ================================================================

audit report - tmp/sales3.aud

 Job: rep2  InFile: dat1/sales3  OutFile: tmp/s3  Table: tf/rep2demo.tbl
 SearchBgn:    SearchEnd:    MatchOptns: df2g2  UserOptns: q1a1b99999c0d256p1
 ====================================================== 2019/03/20_14:57:46
 HAM001~~~~~~~~~~~~~~~~~~~~~~~~HAM201~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 TAB013~~~~~~~~~~~~~~~~~~~~~~~~TAB213~~~~~~~~~~~~~~~~~~~~~~~~ 21 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 TAB013~~~~~~~~~~~~~~~~~~~~~~~~TAB313~~~~~~~~~~~~~~~~~~~~~~~~ 35 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ====================================================== 2019/03/20_14:57:46
 00001 130140    21 940802 IN111001  HAM201  00020+ 0000001 00000020+
 00004 139923    35 950802 IN111002  TAB313  00023+ 0003001 00069023+
 00005 139923    35 950807 IN111002  TAB313  00024+ 0004001 00096024+
 00006 150825    44 960804 IN1122    HAM201  00025+ 0005001 00125025+
 00009 223240    65 980816 CR955     HAM201  00028+ 0008001 00224028+
 00013 308685    21 990814 CR8835    TAB213  00012- 0002001 00024012-
 00014 315512    44 000805 IN2251    HAM201  00013- 0003001 00039013-
 00019 406082    35 020816 IN33001   TAB313  00018- 0008001 00144018-
 00020 406082    65 020816 IN441     HAM201  00019- 0009001 00171019-
 ====================================================== 2019/03/20_14:57:46
 EOF: 00009 reps on 00000 lines of 00020 total line

Only the audit report (tmp/sales3.aud) is shown, you can also inspect the output file (tmp/s3) & confirm that only 9 lines have been changed. This job 'rep2' modifies only 1 file at a time, also see 'rep2d' in REPjobs.htm to search/ replace all files in a directory while copying to a 2nd directory.

Goto:   Begin this document End this document UVSI Home-Page

P1. Test/Demo the Vancouver Utilities

sample uvcopy job for mass change to data files

This is a follow-on to the preceding demo of pre-programmed job 'rep2' to make mass changes to data files based on a search/replace table. Note that rep2 is intended for text files, for data files it is usually better to write a special purpose uvcopy job to be certain to preserve the exact record layout. Please run the supplied uvcopy job (pf/demo/prodfix1) as follows:


 #1. uvcopy prodfix1,fili1=dat1/sales3,filo1=tmp/sales3a  <-- run the demo job
     ===================================================

 #2. cat tmp/sales3a   <-- display outfile & confirm prod# changes
     ===============       (via lookup table coded in job below)
 # prodfix1 - uvcopy Parameter File from UVSI stored in: /home/uvadm/pf/demo/
 # prodfix1 - modify product#s via a lookup table
 #
 #usage: uvcopy prodfix1,fili1=dat1/sales3,filo1=tmp/sales3a
 #       ===================================================
 #
 rop=r1   # EOF prompt for outfile viewing (vi, cat, more, etc)
 fili1=?dat1/sales3,rcs=64,typ=RSF
 filo1=?tmp/sales3a,rcs=64,typ=RST
 lod=c0(20)             # load table of 20 byte entries
 HAM001 HAM201          # lookup prod# 0(6), replacement 7(6)
 SAW001 SAW201
 TAB013 TAB213
 ~~~~~~~~~~~~~~~~~~~~   # table ended by all tildes entry
 @run
        opn    all
 # begin loop to get,process,put records until EOF
 loop   get    fili1,a0              get record into area 'a'
        skp>   eof                   (cc set > at EOF)
        mvc    b0(64),a0             copy inrec to outarea 'b'
        lokz1  cc0(20),c0(6),a30(6)  lookup table by 6 char prod#
        skp!   put1                  if nofind - go output as is
 rep1   mvc    b30(6),cc7            replace outrec prod# with table prod#
        mvc    b7(1),'*'             set updated flag '*'
 put1   put    filo1,b0              write the output record
        skp    loop                  return to next record
 eof    cls    all
        eoj

For brevity, this job does not qualify the prod# replacement by salesman#. Please see pf/demo/prodfix2 if you wish to see the qualified replacement that was illustrated in the previous 'rep2' demo (5 more instructions).

Please see uvcopy3.htm for details of the instructions used above. This document is not intended to explain the details, but rather to illustrate that you can do anything required with the uvcopy utility. You will not find yourself wishing for more powerful data manipulation capability as is often the case with other utilties.

Goto:   Begin this document End this document UVSI Home-Page

P2. Test/Demo the Vancouver Utilities


 #1. uvcopy prodfix1,fili1=dat1/sales3,filo1=tmp/sales3a
     ===================================================
     <-- see previous page for the uvcopy job & command to execute

tmp/sales3a - output file from uvcopy prodfix1

 130140 *  21 940802 IN111001  HAM201  00020+ 0000001 00000020+
 130140    21 940803 IN111001  SCR012  00021+ 0001001 00021021+
 130140    21 940804 IN111001  CHR001  00022+ 0002001 00044022+
 139923 *  35 950802 IN111002  TAB213  00023+ 0003001 00069023+
 139923 *  35 950807 IN111002  TAB213  00024+ 0004001 00096024+
 150825 *  44 960804 IN1122    HAM201  00025+ 0005001 00125025+
 150825    44 960805 IN1122    HAX129  00026+ 0006001 00156026+
 201120    44 970807 CR5234    BBQ001  00027+ 0007001 00189027+
 223240 *  65 980816 CR955     HAM201  00028+ 0008001 00224028+
 223240    65 980817 IN441     BBQ001  00029+ 0009001 00261029+
 308685    21 990812 IN6605    SAW051  00010- 0000001 00000010-
 308685    21 990813 IN6605    BIT075  00011- 0001001 00011011-
 308685 *  21 990814 CR8835    TAB213  00012- 0002001 00024012-
 315512 *  44 000805 IN2251    HAM201  00013- 0003001 00039013-
 315512    44 000806 IN2251    SAW051  00014- 0004001 00056014-
 315512    44 000807 IN2255    BIT075  00015- 0005001 00075015-
 400002    85 010812 CR245     HAX129  00016- 0006001 00096016-
 406082    35 020815 IN33001   BBQ001  00017- 0007001 00119017-
 406082 *  35 020816 IN33001   TAB213  00018- 0008001 00144018-
 406082 *  65 020816 IN441     HAM201  00019- 0009001 00171019-

The uvcopy job (pf/demo/profix1) flags records updated with '*' in col 8. Product#'s are updated as per the table embedded in the job, but if desired the table could be read in from an external file. See the 'rtb' command documented at https://uvsoftware.ca/uvcopy3.htm#rtb

Here are the relevant lines of the prodfix1 job with INSERTs & OMITs

 #      ---
 fili1=?dat1/sales3,rcs=64,typ=RSF
 filo1=?tmp/sales3a,rcs=64,typ=RST
 fili2=?ctl/product_updts.tbl,rcs=80,typ=LST  #<-- INSERT file def for table
 # lod=c0(20)                        #
 # HAM001 HAM201                     #<-- OMIT table content from uvcopy job
 #      ---                          #
 @run
        opn    all
        rtb    fili2,c0(80),c0(20)   #<-- INSERT
 # begin loop to get,process,put records until EOF
 loop   get    fili1,a0              get record into area 'a'
 #      ---
        lokz1  cc0(20),c0(6),a30(6)  lookup table by 6 char prod#
 #      ---
Note
  • rtb op2 'c0(80)' defines table records as 80 bytes
  • but op3 'c0(20)' defines the length loaded in each entry as 20 bytes
  • allows coding comments on the extra 60 bytes of table file records

Goto:   Begin this document End this document UVSI Home-Page

Q1. TESTING the Vancouver Utility programs

testint2 - test conversion decimal to binary & back

Here is uvcopy job to test uvcopy processing of 32 & 64 bit integers. This processing depends on how you compiled uvcopy. '#1' below compiles on an Intel LINUX system in 32 bit mode. You should change 'LNX' to the proper code for your system (SUN,HP,AIX,SFU,etc). See install.htm#C1. On the next page we will recompile in 32 bit mode & rerun the test.


 #1. ccuv uvcopy LNX H32 uvlib32.a disamLNX32  - compile Linux 32 bit mode
     ========================================  - DISAM indexed files

 #2. uvcopy testint2          - execute uvcopy job 'testint2'
     ===============          - displays output via 'more'

 #3. uvlp12 tmp/testint2.H32  - OR print output from file created
     =======================
 # Date=20040621, Machine=LNX, Bits=H32
 cycle      decimal-value  hex native        hex swapped
 01  00000000000000000001  0100000000000000  0100000000000000
 02  00000000000000000002  0200000000000000  0200000000000000
 03  00000000000000000004  0400000000000000  0400000000000000
 04  00000000000000000008  0800000000000000  0800000000000000
 05  00000000000000000016  1000000000000000  1000000000000000
 06  00000000000000000032  2000000000000000  2000000000000000
 07  00000000000000000064  4000000000000000  4000000000000000
 08  00000000000000000128  8000000000000000  8000000000000000
 09  00000000000000000256  0001000000000000  0001000000000000
 10  00000000000000000512  0002000000000000  0002000000000000
 11  00000000000000001024  0004000000000000  0004000000000000
 12  00000000000000002048  0008000000000000  0008000000000000
 13  00000000000000004096  0010000000000000  0010000000000000
 14  00000000000000008192  0020000000000000  0020000000000000
 15  00000000000000016384  0040000000000000  0040000000000000
 16  00000000000000032768  0080000000000000  0080000000000000
 17  00000000000000065536  0000010000000000  0000010000000000
 18  00000000000000131072  0000020000000000  0000020000000000
 19  00000000000000262144  0000040000000000  0000040000000000
 20  00000000000000524288  0000080000000000  0000080000000000
 21  00000000000001048576  0000100000000000  0000100000000000
 22  00000000000002097152  0000200000000000  0000200000000000
 23  00000000000004194304  0000400000000000  0000400000000000
 24  00000000000008388608  0000800000000000  0000800000000000
 25  00000000000016777216  0000000100000000  0000000100000000
 26  00000000000033554432  0000000200000000  0000000200000000
 27  00000000000067108864  0000000400000000  0000000400000000
 28  00000000000134217728  0000000800000000  0000000800000000
 29  00000000000268435456  0000001000000000  0000001000000000
 30  00000000000536870912  0000002000000000  0000002000000000
 31  00000000001073741824  0000004000000000  0000004000000000
 32  000000000=214748364x  0000008000000000  0000008000000000 <-- 32 bit limit
 33  00000000000000000000  0000000000000000  0000000000000000

Goto:   Begin this document End this document UVSI Home-Page

Q2. TESTING the Vancouver Utility programs


 #1. ccuv uvcopy LNX H64 uvlib64.a disamLNX64  - compile Linux 64 bit mode
     ========================================  - DISAM indexed files

 #2. uvcopy testint2          - re-execute uvcopy job 'testint2'
     ===============          - displays output via 'more'

 #3. uvlp12 tmp/testint2.H64  - OR print output from file created
     =======================
 # Date=2019/03/20, Machine=LNX, Bits=$longbits
 cycle      decimal-value  hex native        hex swapped
 01  00000000000000000001  0100000000000000  0000000000000001
 ..    ----- 30 lines omitted, same as previous page -----
 31  00000000001073741824  0000004000000000  0000000040000000
 32  00000000002147483648  0000008000000000  0000000080000000 32 bit limit
 33  00000000004294967296  0000000001000000  0000000100000000
 34  00000000008589934592  0000000002000000  0000000200000000
 35  00000000017179869184  0000000004000000  0000000400000000
 36  00000000034359738368  0000000008000000  0000000800000000
 37  00000000068719476736  0000000010000000  0000001000000000
 38  00000000137438953472  0000000020000000  0000002000000000
 39  00000000274877906944  0000000040000000  0000004000000000
 40  00000000549755813888  0000000080000000  0000008000000000
 41  00000001099511627776  0000000000010000  0000010000000000
 42  00000002199023255552  0000000000020000  0000020000000000
 43  00000004398046511104  0000000000040000  0000040000000000
 44  00000008796093022208  0000000000080000  0000080000000000
 45  00000017592186044416  0000000000100000  0000100000000000
 46  00000035184372088832  0000000000200000  0000200000000000
 47  00000070368744177664  0000000000400000  0000400000000000
 48  00000140737488355328  0000000000800000  0000800000000000
 49  00000281474976710656  0000000000000100  0001000000000000
 50  00000562949953421312  0000000000000200  0002000000000000
 51  00001125899906842624  0000000000000400  0004000000000000
 52  00002251799813685248  0000000000000800  0008000000000000
 53  00004503599627370496  0000000000001000  0010000000000000
 54  00009007199254740992  0000000000002000  0020000000000000
 55  00018014398509481984  0000000000004000  0040000000000000
 56  00036028797018963968  0000000000008000  0080000000000000
 57  00072057594037927936  0000000000000001  0100000000000000
 58  00144115188075855872  0000000000000002  0200000000000000
 59  00288230376151711744  0000000000000004  0400000000000000
 60  00576460752303423488  0000000000000008  0800000000000000
 61  01152921504606846976  0000000000000010  1000000000000000
 62  02305843009213693952  0000000000000020  2000000000000000
 63  04611686018427387904  0000000000000040  4000000000000000
 64  =922337203685477580x  0000000000000080  8000000000000000 <-- 64 bit limit
 65  00000000000000000000  0000000000000000  0000000000000000

See the uvcopy job (testint2) listed on the next page --->

Goto:   Begin this document End this document UVSI Home-Page

Q3. TESTING the Vancouver Utility programs

uvcopy job to test 32/64 bit acums

 # testint2 - uvcopy Parameter File from UVSI stored in: /home/uvadm/pf/adm
 # testint2 - test conversion from decimal to binary & back
 #          - 2,147,483,648 limit for 32 bits, huge for 64 bits
 #
 # uvcopy testint2,filo1=tmp/testint2
 # ==================================
 # uvcopy testint2        <-- same as above, files default as shown above
 # ===============
 # vi/uvlp12 tmp/testint2.H32    <-- output file suffix .H32 or .H64
 # ==========================
 # vi/uvlp12 tmp/testint2.H64
 #
 # Note - output display will be different depending on machine architecture
 # BigEndMachines = HP, SUN, AIX
 # LittlEndMachines = INTEL, LINUX, DEC-ALPHA, DWIN, CWIN, UWIN, SFU
 opr='$jobname - test conversion from decimal to binary & back'
 opr='uop=c66 - default options'
 opr='    c66 - number of cycles (64 bit limit, 19 digits)'
 uop=q1c66      # default options
 rop=r1x4       # r1 = prompt for report disposition, x4 = default 'more'
 filo1=?tmp/$jobname.$bits,rcs=128,typ=LSTt
 @run
        opn    all
        mvfv3  b0(80),'# Date=$date, Machine=$machine, Bits=$longbits'
        putb   filo1,b0(80)        write info to 1st line of report
        mvfv3  b0(80),'cycle      decimal-value  hex native        hex swapped'
        putb   filo1,b0(80)        write info to 1st line of report
        mvn    $ca1,1              init accumulator
        mvn    $ca3,1              init counter for cycles option limit test
 #
 # begin loop to convert, print, double,& repeat
 man20  clr    b0(80),' '          clear output area
        mvn    b0(2),$ca3          cycle#
        mvn    b4(20),$ca1         decimal value in 20 bytes
        hxc    b26(16),$ca1        convert to hex display
        mvn    c0(8bs),$ca1        swap BigEnd/LittleEnd
        hxc    b44(16),c0(8)       convert to hex display
        cmn    $ca1,2147483648     32 bit limit ?
        skp!   1
        mvf    b61(20),'32 bit limit'
        put    filo1,b0            write output
        mpy    $ca1,2              double for next cycle
        add    $ca3,1              count cycles
        cmn    $ca3,$uopbc         test cycles limit ?
        skp<   man20
 #
 eof    cls    all
        eoj
 # rop=r1x4, r1 = prompt for report disposition, x4 = default 'more'
Note
  • compare the above uvcopy job to the C program on the next page --->

Goto:   Begin this document End this document UVSI Home-Page

Q4. TESTING the Vancouver Utility programs

Here is a C program to test 64 bit integers. This would prove that your system software can process 64 bit integers (independently from uvcopy). Compile & test as shown below as /* comments */ within the program & you should get the results listed below.

C program to test 64 bit integers

 /* test64c.c - test long long for unix/linux, lcc-win32, etc              */
 /*           - convert numstring to long long, multiply by 4, convert back*/
 /*           - see alternate program test64d.c for Windows SFU            */
 /*           - also see test64a.c & test64b.c which allow you to specify  */
 /*             initial value, multiplier,& no of cycles                   */
 /*           - also see uvcopy job 'testint2' similar to this C program   */
 /*             (uvcopy job testint2 stored at /home/uvadm/pf/adm/testint2 */
 /*                                                                        */
 /*         - defines a long long 64 bit field                             */
 /*         - uses 'strtoll' to convert numeric strings to initial value   */
 /*         - multiply by 4, repeat 15 cycles, print result to see limits  */
 /*         - uses printf '%015lld' to convert 64 bit integers to numstrings*/
 /*                                                                        */
 /*compile: cc src/ttestC/est64c.c -obin/test64c                           */
 /*         ====================================                           */
 /*                                                                        */
 /*usage: bin/test64c     <-- execute                                      */
 /*       ===========       - expected result below                        */
 /*                                                                        */
 /* 00. 0000000000004096 * 04 = 0000000000016384 = 00 40 00 00 00 00 00 00 */
 /* 01. 0000000000016384 * 04 = 0000000000065536 = 00 00 01 00 00 00 00 00 */
 /* 02. 0000000000065536 * 04 = 0000000000262144 = 00 00 04 00 00 00 00 00 */
 /* 03. 0000000000262144 * 04 = 0000000001048576 = 00 00 10 00 00 00 00 00 */
 /* 04. 0000000001048576 * 04 = 0000000004194304 = 00 00 40 00 00 00 00 00 */
 /* 05. 0000000004194304 * 04 = 0000000016777216 = 00 00 00 01 00 00 00 00 */
 /* 06. 0000000016777216 * 04 = 0000000067108864 = 00 00 00 04 00 00 00 00 */
 /* 07. 0000000067108864 * 04 = 0000000268435456 = 00 00 00 10 00 00 00 00 */
 /* 08. 0000000268435456 * 04 = 0000001073741824 = 00 00 00 40 00 00 00 00 */
 /* 09. 0000001073741824 * 04 = 0000004294967296 = 00 00 00 00 01 00 00 00 */
 /* 10. 0000004294967296 * 04 = 0000017179869184 = 00 00 00 00 04 00 00 00 */
 /* 11. 0000017179869184 * 04 = 0000068719476736 = 00 00 00 00 10 00 00 00 */
 /* 12. 0000068719476736 * 04 = 0000274877906944 = 00 00 00 00 40 00 00 00 */
 /* 13. 0000274877906944 * 04 = 0001099511627776 = 00 00 00 00 00 01 00 00 */
 /* 14. 0001099511627776 * 04 = 0004398046511104 = 00 00 00 00 00 04 00 00 */
 /* 15. 0004398046511104 * 04 = 0017592186044416 = 00 00 00 00 00 10 00 00 */
 /*                                                                        */
 /*Note - the 32 bit limit is at #09 above 1,073,741,824 is OK in 32 bits  */
 /*     - following entries zeros or garbage if 64 bit software not working*/

Goto:   Begin this document End this document UVSI Home-Page

#include <stdio.h> #include <stdlib.h>

 /*Note - this test64c codes initial value1s as numeric string           */
 /*     - then converts to value1 via 'strtoll' <-- problem in June2004  */
 /*     - strtoll problem fixed by coding base 10 explicitly (vs 0 default)*/
 char value1s[16] = "4096";    /* inital value as num string for strtoll */
 long long value1 = 0;         /* initial value                          */
 int mult = 4;                 /* multiplier                             */
 int cycles = 15;              /* no of calc cycles                      */
 long long value2;             /* save current for printing              */
 int ii;                       /* loop index                             */
 /* union to hold long long & 8 byte char array in same memory positions*/
 /* - 8 byte character array (for hex representation conversion)        */
 union LLCH
 { long long ll;
   unsigned char ch[8];
 } llch;

/* test conversions, numstring to long long, multiply,& convert back */ int main(int argc, char *argv[]) { /* convert initial value num string to long long for mult by 4, 15 cycles*/ value1 = strtoll(value1s,(char**)0,10); /* <-- MUST code base 10 for lcc-win32*/

 /* begin loop to calc & print results                                    */
 for (ii=0; ii <= cycles; ii++)
   { value2 = value1;                  /* save current value for printing */
     value1 *= mult;                   /* multiply value by mplr          */
     llch.ll = value1;                 /* store value in union for hex cnvrt*/
 printf(
 "%02d. %015lld * %02d = %015lld = %02X %02X %02X %02X %02X %02X %02X %02X\n"
     ,ii,value2,mult,value1
     ,llch.ch[0],llch.ch[1],llch.ch[2],llch.ch[3]
     ,llch.ch[4],llch.ch[5],llch.ch[6],llch.ch[7]);
   }
 return(0);
 }

Goto:   Begin this document End this document UVSI Home-Page

R1. TESTING the Vancouver Utility programs

test uxcp for Indexed Sequential Variable length files

'uxcp' supports Indexed Sequential Variable length record files & must be compiled with the Micro Focus COBOL 'cob' command as shown in install.htm#D3. You can test uxcp using test files provided as shown below:

dat1/testIDXL - test file to demo uxcp

 0010.0080 testIDXL - test file to create ISAM Variable length file
 0020.0080          - input to 'cblIDX31.bat' which writes variable file
 0030.0080          - this file is Line Sequential, layout as follows:
 0040.0080 01-04=ISAM key, 05=.separator,06-09=recsize,10-400 text
 0050.0080 - output record varies from 60 to 256 depending on recsize 06-09
 0060.0060 - here is an 60 byte record-------------------------->
 0070.0080 - here is an 80 byte record------------------------------------------>
 0080.0160 - here is a 160 byte record...........................................-----------------------------------------------
 0090.0240 - here is a 240 byte record (last record in file).....................-----------------------------------------------

uxcp - READ text file (typ=LST), WRITE Indexed file (typ=IDXf3)


 #1.  uxcp "fili1=dat1/testIDXL,rcs=256,typ=LST\
      ============================================
             ,filo1=tmp/testIDXI,rcs=254,typ=IDXf3v60,isk1=0(4)"
             ===================================================

 #1a. uvhd tmp/testIDXI v    <-- examine output data partition with 'uvhd'
      ===================
Note
  • See uvhd output (in vertical hexadecimal) on the next page --->

uxcp - READ Indexed file (typ=IDXf3), WRITE text file (typ=LSTt)


 #2.  uxcp "fili1=tmp/testIDXI,rcs=256,typ=IDXf3,filo1=tmp/testx,typ=LSTt"
      ====================================================================

 #2a. vi tmp/testx           <-- examine output file with 'vi'
      ============

This converts the typ=IDXf3 file back to a text file (typ=LSTt) which should be the same as the original file used in step #1.

Goto:   Begin this document End this document UVSI Home-Page

R2. TESTING the Vancouver Utility programs

Note
  • Here is the output from the 'uxcp' conversion of a TEXT file
    (shown on the previous page) to a typ=IDXf3 file (shown below).
    The uxcp & uvhd commands are repeated for your convenience.

uxcp - READ text file (typ=LST), WRITE Indexed file (typ=IDXf3)


 #1.  uxcp "fili1=dat1/testIDXL,rcs=256,typ=LST\
      ==========================================
             ,filo1=tmp/testIDXI,rcs=254,typ=IDXf3v60,isk1=0(4)"
             ===================================================

 #1a. uvhd tmp/testIDXI v    <-- examine output data partition with 'uvhd'
      ===================
                       1         2         3         4         5         6
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 0~......0302201201162403022012011624.>.......................<..
             370000003333333333333333333333333333030000000000000000000F000300
             0E00000003022012011624030220120116240E0200000000100000000E000C00
          64 ............................................X.6.................
             00000000000000000000000000000000000000000000503E0000000000000000
             0000000000002010000000000000000000000000000080600000000000000000
Note
  • typ=IDXf3 file header record above has binary fields (requiring uvhd).
  • See file header layout documented on page 'I3' (same as typ=RSV file).
  • Output Records 2-6 are omitted to save space, Please see input text
    records on previous page.
                       1         2         3         4         5         6
 r#        7 0123456789012345678901234567890123456789012345678901234567890123
         740 @<0060.0060 - here is an 60 byte record---------------------->..
             4333332333322266762672662332677627666762222222222222222222222300
             0C0060E00600D0852509301E060029450253F24DDDDDDDDDDDDDDDDDDDDDDE00
                       1         2         3         4         5         6
 r#        8 0123456789012345678901234567890123456789012345678901234567890123
         804 @P0070.0080 - here is an 80 byte record-------------------------
             4533332333322266762672662332677627666762222222222222222222222222
             000070E00800D0852509301E080029450253F24DDDDDDDDDDDDDDDDDDDDDDDDD
          64 ----------------->..
             22222222222222222300
             DDDDDDDDDDDDDDDDDE00
                       1         2         3         4         5         6
 r#        9 0123456789012345678901234567890123456789012345678901234567890123
         888 @.0080.0160 - here is a 160 byte record.........................
             4A33332333322266762672623332677627666762222222222222222222222222
             000080E01600D08525093010160029450253F24EEEEEEEEEEEEEEEEEEEEEEEEE
          64 ..................----------------------------------------------
             2222222222222222222222222222222222222222222222222222222222222222
             EEEEEEEEEEEEEEEEEEDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
         128 --------------------------------->..
             222222222222222222222222222222222300
             DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDE00

Goto:   Begin this document End this document UVSI Home-Page

S1. TestDemo: tabfix1 - convert tabs to blanks

Have you ever wished you had an easy way to convert tabs to blanks ? The Vancouver Utilities includes 3 pre-programmed jobs to do this.

tabfix1
  • convert tabs to blanks, with option to specify how many blanks
  • tab value option default 4 cols, but could specify 8 or whatever.
tabfix2
  • convert tabs to blanks depending on tab value option & current column
tabfix3
  • convert tabs to blanks depending on a tab-rack (multiple tab-stops).
  • tab stops solicited from operator as options a,b,c,etc

All of these are documented in UVjobs1.htm. Here we will demonstrate a simple version of tabfix1 to replace each tab with 4 blanks.


 #1. cat tf/tabtest1  - display test file (note tab expansion when displayed)
     ===============
     - the line below between === has 1 tab between words & without expansion
       would appear as follows (using periods to represent the tabs):

     a.bb.ccc.dddd.eeeee.ffffff.ggggggg.hhhhhh                       <-- periods
     ================================================================
     a	bb	ccc	dddd	eeeee	ffffff	ggggggg	hhhhhh      <-- tabs
     ================================================================

 #2. uvhd tf/tabtest1 t1l100  - use uvhd hexdump utility to see the tabs (x'09')
     =======================  - option t1 text file (records ended by LF x'0A')
                              - option 'l100' to display lines up to 100 bytes
        --> enter null 8 times to advance to line #9 (with x'09' tabs)
                  10        20        30        40        50        60        70        8
 r#    9 01234567890123456789012345678901234567890123456789012345678901234567890123456789
     536 a    bb    ccc    dddd    eeeee    ffffff    ggggggg    <-- tab x'09' delimited.
         62222662222666222266662222666662222666666222266666662222322276627233226666667660
         10000220000333000044440000555550000666666000077777770000CDD0412087097045C9D9454A

 #3.  uvcopy tabfix1,fili1=tf/tabtest1,filo1=tmp/tabtest1,uop=t4 <-- hard way
      ==========================================================
 #3a. uvcopy tabfix1    - easy way (I/O files & options default as shown above)
      ==============

 #4.  cat tmp/tabtest1  - display output (note tabs converted to blanks)
      ================  - but use uvhd to see the 4 x'20's replacing each x'09'

 #5.  uvhd tmp/tabtest1 t1l100  - verify tabs x'09' to blanks x'20'
      ========================  - same options as #2 above & advance to line #9
                  10        20        30        40        50        60        70        8
 r#    9 01234567890123456789012345678901234567890123456789012345678901234567890123456789
     536 a    bb    ccc    dddd    eeeee    ffffff    ggggggg    <-- tab x'09' delimited.
         62222662222666222266662222666662222666666222266666662222322276627233226666667660
         10000220000333000044440000555550000666666000077777770000CDD0412087097045C9D9454A

You can see that each tab x'09' (uvhd #2 above) has been converted to 4 blanks x'20's here in uvhd #5.

Goto:   Begin this document End this document UVSI Home-Page

S2. TestDemo: tabfix1 - convert tabs to blanks

tabfix1 - uvcopy job to convert tabs to 4 blanks

 # tabfix1 - uvcopy Parameter File from UVSI stored in: /home/uvadm/pf/util/
 # tabfix1 - convert tabs to blanks (1 to 8, default 4)
 #
 # uvcopy tabfix1,fili1=infile,filo1=outfile,uop=t4    <-- command format
 # ================================================
 # uvcopy tabfix1,fili1=dat1/tabtest1,filo1=tmp/tabtest1 <-- demo defaults
 # =====================================================
 # uvcopyx tabfix1 indir outdir uop=q0i7t4 <-- uvcopyx script repeats for
 # =======================================     all files in directory
 #
 opr='$jobname - convert tabs to blanks option t value 1-8'
 opr='uop=t4   - option defaults'
 opr='    t4   - replace each tab with 4 blanks (t1-t8 allowed)'
 uop=q1t4      #<-- option defaults
 rop=r1x4      # r1 = EOF prompt for out file view, x4 = cat (vs vi,more,etc)
 fili1=?dat1/tabtest1,typ=LST,rcs=1024
 filo1=?tmp/$fili1,typ=LSTt,rcs=1024
 @run
       opn   all
       mvn   $rt,$uopbt    load rgstr t with option t (no of blanks desired)
 #
 # begin loop to copy records until EOF
 loop  get   fili1,a0(1024)           get current record
       skp>  eof
       mvc   b0(1024),a0              move input record to output area
 #---------------------------------
       rep   b0(1024),x'09',c0($rt8)  replace any tabs with blanks ($rt value)
 #---------------------------------
       put   filo1,b0(1024)           write record to output file
       skp   loop
 # end of file - close files & end job
 eof   cls   all
       eoj
 #

These uvcopy jobs are easily changed (or copied & renamed) if you have other conversions that you would like to perform. For example, if you wanted to also convert formfeeds to linefeeds, (replacing page skips with blank lines), you could add a 2nd 'rep'lace instruction following that shown above:

 #---------------------------------------------------------------
       rep   b0(256),x'09',c'    '  replace tabs with 4 blanks
       rep   b0(256),x'0C',x'0A'    replace FormFeed with LineFeed <-- add
 #---------------------------------------------------------------

Goto:   Begin this document End this document UVSI Home-Page

S3. TestDemo: tabfix1 - convert tabs to blanks

using 'uvlist' as a filter

Here is an easier way to modify text files, similar to the above, but with many more options that can be selected at will. You can use the 'uvlist' utility as a filter with various combinations of the following options:

t1-t9
  • convert TABs to specified number of blanks
u1-u9
  • expand TABs depending on column position
  • normal UNIX tab expansion, u4 every 4 cols, u8 every 8 cols
c1
  • convert any unprintable characters to periods (or blanks if c2)
d1
  • reduce multiple consecutive blank lines to 1 blank line
d2
  • reduce multiple consecutive blank lines to 2 blank lines
f1
  • convert formfeeds to blank lines
w1
  • convert Carriage Returns to blanks

Here is the uvlist version of the demo shown above:


 uvlist tf/tabtest1 t4i1h0p0 >tmp/tabtest1
 =========================================

The other options shown (i1h0p0) are required to prevent uvlist from inserting Laser printer PCL5 codes & page headings.

Goto:   Begin this document End this document UVSI Home-Page

T1. TestDemo: More Pre-Programmed Jobs

tolower1 - translate any file to lowercase

'tolower1' is a pre-programmed job to translate any text file to lowercase, could do with unix --> tr '[:upper:]' '[:lower:]' <--, but you can add options to the uvcopy job for added value. For example the existing 'tolower1' job has an option to make the 1st letter of each word Uppercase, which might be used for Name & Adress files. Here is a demo:


 #1. cat tf/names2U     <-- show input file
     ==============
      OWEN TOWNSEND;UV SOFTWARE;5436 VICTORIA DR;VANCOUVER BC CANADA;V5P 3V8
      J. CHRETIEN;PRIME MINISTER;24 SUSSEX DRIVE;OTTAWA, ONTARIO;K1Y 2L6 CANADA
      BILL CLINTON;PRESIDENT OF USA;1600 PENNSYLVANNIA AVE.;WASHINGTOM DC;00001 USA
      BILL GATES;MICROSOFT CORP.;1 MICROSOFT WAY;REDMOND, WA USA;98052-6399

 #2. uvcopy tolower1,fili1=tf/names2U,filo1=tmp/names2Ulower,uop=f1
     ==============================================================
      - convert Upper to lower with option 'f1' first letter each word Upper

 #3. cat tf/names2Ulower    <-- show output file
     ===================
      Owen Townsend;Uv Software;5436 Victoria Dr;Vancouver Bc Canada;V5P 3V8
      J. Chretien;Prime Minister;24 Sussex Drive;Ottawa, Ontario;K1Y 2L6 Canada
      Bill Clinton;President Of Usa;1600 Pennsylvannia Ave.;Washingtom Dc;00001 Usa
      Bill Gates;Microsoft Corp.;1 Microsoft Way;Redmond, Wa Usa;98052-6399

uvcopy job tolower1 - translate to lowercase

 opr='uop=q1f0 - default options'
 opr='      f1 - make first char of each word UPPER case'
 uop=q1f0      # default options
 fili1=?tf/names2U,typ=LST,rcs=512     # default input for test/demo
 filo1=?tmp/$fili1.L,typ=LSTt,rcs=512  # outname dflts to tmp/inputbasename.L
 @run
        opn    all                     open input filename
 # begin loop to get/process/output until EOF reached
 man20  get    fili1,a0(512)           get each record into area 'a'
        skp>   eof                     (cc set > at EOF)
        mvc    b0(512),a0              move record to output area 'b'
        trl    b0(512)                 translate assuming no option f1
        cmn    $uopbf,1                option f1 make 1st char Upper
        skp<   man40
        mvc    b0(512),a0              refresh area b from original input area a
        trlf1  b0(512)                 translate to lower, making 1st char Upper
 man40  put    filo1,b0(512)           write record to output file
        skp    man20                   repeat loop
 # EOF - close files & end job
 eof    cls    all                     close all files
        eoj                           end job

Goto:   Begin this document End this document UVSI Home-Page

T2. TestDemo: More Pre-Programmed Jobs

tolower2 - translate COBOL programs to lowercase

 For mainframe conversions, you might convert COBOL program coding to lowercase,
 since that is much easier to work with using the unix 'vi' editor. You could use
 uvcopy job 'tolower2' - it has options to NOT translate to lower within quotes
 - OK to translate the COBOL code but not any literals which must match data files
 which are still in UPPERcase. You might also use the optoins to clear cols 1-6
 & 73-80 (a relic of the punch card days).

 #1. cat tf/CAR101.cbl     <-- show input demo program snippet
     =================
 000010 IDENTIFICATION DIVISION.                                         CAR101
 000020* CAR101 - TEST/DEMO MAINFRAME CONVERSION TO MICRO FOCUS COBOL    CAR101
 000040 PROGRAM-ID. CAR100.                                              CAR101
 000080     SELECT CUSTMAS ASSIGN CUSTMAS                                CAR101
 000090            ORGANIZATION SEQUENTIAL ACCESS MODE SEQUENTIAL.       CAR101
 000140 FD  CUSTMAS RECORD CONTAINS 256 CHARACTERS.                      CAR101
 000150     01 CM1. COPY "CUSTMAS.CPY".                                  CAR101
 000220 01  PAGE-HDNGS.                                                  CAR101
 000230     05 FILLER            PIC X(40) VALUE                         CAR101
 000240        'CAR100: CUSTOMER NAME & ADDRESS LIST    '.               CAR101

 #2. uvcopy tolower2,fili1=tf/names2U,filo1=tmp/names2Ulower,uop=f1
     ==============================================================
      - convert Upper to lower with option 'f1' first letter each word Upper

 #3. cat tmp/CAR101.cbl      <-- show output results
     ==================
        identification division.
       * car101 - test/demo mainframe conversion to micro focus cobol
        program-id. car100.
            select custmas assign custmas
                   organization sequential access mode sequential.
        fd  custmas record contains 256 characters.
            01 cm1. copy "CUSTMAS.CPY".
        01  page-hdngs.
            05 filler            pic x(40) value
               'CAR100: CUSTOMER NAME & ADDRESS LIST    '.
 You can convert an entire directory of COBOL programs with the same uvcopy job
 - using the 'uvcopyx' script which runs the uvcopy job for each program in a
 directory while copying to a 2nd directory. You could test using the COBOL
 programs supplied in $UV/mf/cbls.

 #4. uvcopyx tolower2 $UV/mf/cbls tmp1 uop=q0i7b3o3
     ==============================================

We will not show the uvcopy job here, but you can inspect as follows:


 #5. vi $UV/pf/util/tolower2  <-- view uvcopy job to cleanup COBOL programs
     =======================

Goto:   Begin this document End this document UVSI Home-Page

U1. toascii1 - convert EBCDIC to ASCII demo

toascii1 - demo convert dat1/vendormas0 EBCDIC to ASCII

 Here is the 1st record of the EBCDIC version of dat1/vendormas0
 - using uvhd to show hexadecimal values of EBCDIC characters.

 #1. uvhd dat1/vendormas0 r64  <-- display EBCDIC demo file
     ========================    - option 'r' specifies recsize 64
 rec#=1 rsize=64 fptr=0 fsize=512 records=8
                  10        20        30        40        50        60
 r#    1 0123456789012345678901234567890123456789012345678901234567890123
       0 ......@.@@....@...K@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
         CCDDFF4D44C8994C984444444444444444444444444444444444444444444444
         453310040045330953B000000000000000000000000000000000000000000000

Nobody can easily read it, but if you know the EBCDIC code, you will know that the 1st byte x'C4' (in horizontal hex vs vertical hex) is an upper case 'D' and the 1st 6 characters are 'DELL00'.

We can use uvhd option 'a' to translate the character line to ASCII, while still showing the EBCDIC values of the hexadecimal zones & digits.


 #2. uvhd dat1/vendormas0 r64a  <-- display EBCDIC demo file
     =========================    - option 'a' to translate characters to ASCII
 rec#=1 rsize=64 fptr=0 fsize=512 records=8
                  10        20        30        40        50        60
 r#    1 0123456789012345678901234567890123456789012345678901234567890123
       0 DELL10 M  Dell Inc.
         CCDDFF4D44C8994C984444444444444444444444444444444444444444444444
         453310040045330953B000000000000000000000000000000000000000000000

Now, we will translate the file (8 records of 64 bytes each with no LineFeeds) to ASCII, changing output file-type from typ=RSF (Fixed 64) to typ=LST (text file, with LineFeeds after the last non-blank).


 #3. uvcopy toascii1,fili1=dat1/vendormas0,typ=RSF,filo1=tmp1/vendormas0,typ=LST,uop=a64b64
     ======================================================================================
      - see easier command #3a below

Goto:   Begin this document End this document UVSI Home-Page

U2. toascii1 - convert EBCDIC to ASCII demo

toascii1 - demo convert dat1/vendormas0 EBCDIC to ASCII


 #3a. uvcopy toascii1   <-- minimal entry for demo defaults, except prompt for outfile type
      ===============     - reply 'LST' to insert LineFeeds after last non-blank
      User OPtion (uop) defaults  = q1a64b64
      -->null to accept or enter/override -->
         InRecSize (64) OutrecSize (64) ---->     <-- null accept
      dat1/vendormas0 = default fili01 ----->     <-- null accept
      tmp1/vendormas0.asc default filo01 --->     <-- null accept
      RSF output typ default filo01 --------> LST <-- enter "LST" text file with LineFeeds
      190324:102101:toascii1: EOF fili01 rds=8 size=512: dat1/vendormas0
      190324:102101:toascii1: EOF filo01 wrts=8 size=224: tmp1/vendormas0.asc
      EOJ, Output File written to: tmp1/vendormas0.asc
      default command = enter: vi,cat,more,uvlp12,etc ---> cat <--- to display file

 #4. cat tmp1/vendormas0.asc     <-- display output file
     =======================
      DELL10 M  Dell Inc.
      HP0010 M  Hewlett Packard
      IBM010 M  International Business Machines
      MFC010 M  Micro Focus COBOL
      MS0010 M  Microsoft Corp.
      REDH10 M  Red Hat Linux
      SUN010 M  Sun Microsystems Ltd
      UVSI10 M  UV Software Inc.

Note that if we had not specified outfile typ=LST, the entire file would appear as 1 line of 512 characters (8 64 byte records).


 #4a. cat tmp1/vendormas0.asc
      =======================
 DELL10 M  Dell Inc. ...space filled 64 bytes...      HP0010 M  Hewlett Packard  ...etc...
                     ... entire file is 1 line of 512 bytes ...
 Now, you could try 'uvcopy toascii1' on some of your own EBCDIC files
 - if you have a  mainframe & can FTP files in binary mode.

 #5. uvcopy toascii1,fili1=dir/file,filo1=tmp1/file.asc,uop=a999b999
     ===============================================================
      - try toascii1 with some of your EBCDIC files

Goto:   Begin this document End this document UVSI Home-Page

U3. toascii1 - convert EBCDIC to ASCII demo

toascii1 - uvcopy job to convert any EBCDIC file to ASCII

 # toascii1 - uvcopy Parameter File from UVSI stored in: /home/uvadm/pf/util/
 # toascii1 - copy a text file translating from EBCDIC to ASCII
 #
 # uvcopy toascii1,fili1=dat1/vendormas0,filo1=tmp1/vendormas0.asc
 # ===============================================================
 # - copy the file translating from EBCDIC to ASCII
 #
 # uvcopy toascii1  <-- filenames default as above for test/demo
 # ===============
 #
 opr='$jobname - copy a file translating EBCDIC to ASCII'
 opr='         - input filename defaults to dat1/vendormas0 demo file'
 opr='         - record-size defaults to 64 (record-size for vendormas0)'
 opr='         - can enter your filenames & options'
 opr='note - output file "typ" will be solicted below'
 opr='       RSF  - is the default output file type (fixed rcsz, no LF)'
 opr='       RST  - inserts LF in last byte (for vi/lp/etc)'
 opr='       LSTt - inserts LF after last nonblank (variable rcsz vs fixed)'
 opr='uop=q1a64b64  - default options'
 opr='    q1        - prompt for option changes (q0 to inhibit)'
 opr='      a64     - input record size, default 64, max 4096'
 opr='          b64 - output record size, default 64, max 4096'
 uop=q1a64b64       # default options
 rop=r1             # EOF prompt for outfile view (vi,cat,more,etc)
 fili1=?dat1/vendormas0,rcs=64,typ=RSF   # default input for test/demo
 filo1=?tmp1/$fili1.asc,rcs=64,typ=?RSF   # default output
 @run
       opn     all                     open files
       mvn     $ra,$uopba              input  rcsz option 'a' to rgstr 'a'
       mvn     $rb,$uopbb              output rcsz option 'b' to rgstr 'b'
 loop  get     fili1,a0($ra4096)       get into area 'a' rcsz in rgstr 'a'
       skp>    eof                     (cc set > at EOF)
       mvc     b0(4096),a0             move record to output area 'b'
       tra     b0($ra4096)             translate output area (size in rgstr 'a')
       put     filo1,b0($rb4096)       write to outfile, recsize in rgstr 'b'
       skp     loop                    return to get next record
 eof   eoj

Goto:   Begin this document End this document UVSI Home-Page

U4. Alternate EBCDIC to ASCII Translate Tables

uvcopy options for EBCDIC to ASCII translate tables

t0
  • ebc2ascUS.c EBCDIC to ASCII - United States
t1
  • ebc2ascBE.c EBCDIC to ASCII - BElgium
t2
  • ebc2ascDE.c EBCDIC to ASCII - DEutschland
t3
  • ebc2ascES.c EBCDIC to ASCII - ESpana (Spain)
t4
  • ebc2ascFI.c EBCDIC to ASCII - FInland
t5
  • ebc2ascFR.c EBCDIC to ASCII - FRance
t6
  • ebc2ascGB.c EBCDIC to ASCII - Great Britain
t7
  • ebc2ascL1.c EBCDIC to ASCII - Latin-1
t8
  • ebc2ascL2.c EBCDIC to ASCII - Latin-2
t9
  • ebc2ascPT.c EBCDIC to ASCII - PorTugal
t10
  • ebc2ascUV.c EBCDIC to ASCII - UV Software legacy
t11
  • ebc2ascUVDE.c EBCDIC to ASCII - UV Software legacy Germany

These options may be specified on the 'tra' instruction, for rexample:


       tra    b0(64)     <-- TRAnslate instruction for vendormas0
       =============       - see listing on prior page
       trat0  b0(64)     <-- 't0' is the default for US EBCDIC to ASCII table
       =============
       trat2  b0(64)     <-- 't2' would be used for Germany
       =============

You could specify as a uvcopy Run OPtion, for example 'rop=t2' on prior example:


 uvcopy toascii1,fili1=dat1/vendormas0,filo1=tmp1/vendormas0,uop=a64b64,rop=t2
 =======================================================================******

You could specify on environmental variable 'UVCOPYROP' to affect all future 'tra' instructions on all uvcopy jobs executed until you logoff. Could add to the common_profile for ongoing conversion projects.


 export UVCOPYROP=t2     <-- add to $APPSADM/env/common_profile_uv
 ===================

Translate table differences ?

But, how can you determine the differences that these translate table options make ?

The following pages will illustrate how I tested the differences between translate table option from the default 't0' (US) to 't2' (Germany).

Goto:   Begin this document End this document UVSI Home-Page

U5. Alternate EBCDIC to ASCII Translate Tables

Illustrating Translate table differences

We will use demo file $UV/dat1/trt256, which is 1 256 byte record of all possible values in an 8 bit byte from x'00' to x'FF'. We will translate using option 't0' (US) & then 't2' (Germany) & compare the results. Here is a uvhd display of our test file $UV/dat1/trt256:


 #1. uvhd dat1/trt256   <-- display demo file to illustrate translate table diffs
     ================
 rec#=1 rsize=256 fptr=0 fsize=256 records=1
                  10        20        30        40        50        60
 r#    1 0123456789012345678901234567890123456789012345678901234567890123
       0 ................................ !"#$%&'()*+,-./0123456789:;<=>?
         0000000000000000111111111111111122222222222222223333333333333333
         0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
      64 @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~.
         4444444444444444555555555555555566666666666666667777777777777777
         0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
     128 ................................................................
         88888888888888889999999999999999AAAAAAAAAAAAAAAABBBBBBBBBBBBBBBB
         0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
     192 ................................................................
         CCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDEEEEEEEEEEEEEEEEFFFFFFFFFFFFFFFF
         0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF

First, we will translate using the US translate table. We will specify 'rop=t0', but we don't need to since that's the default. We will also specify 'uop=a256b256' for the I/O record-sizes (vs default a64b64). Actually would not matter since 256 is a multple of 64.


 #2. uvcopy toascii1,fili1=dat1/trt256,filo1=tmp1/trtUS,uop=a256b256,rop=t0
     ======================================================================

 #3. uvhd tmp1/trtUS r256    <-- display results using US table
     ====================
 rec#=1 rsize=256 fptr=0 fsize=256 records=1
                  10        20        30        40        50        60
 r#    1 0123456789012345678901234567890123456789012345678901234567890123
       0 ................................................................
         0000808788800000111180081188111188888811899990009919999099991191
         0123091F234BCDEF01235A868978CDEF9ABCDE7BF012356745667894ABCD45EA
      64  ...........<(+|&.........!$*);.-/.........,%_>?.........`:#@'="
         2AEEEEEEEFA232272EEEEEEEED22223A22CCCCCCCDA22533FCCCCCCCC6324232
         00240135712EC8BC69AB8DEFCF14A9BCDF240135716C5FEF89AB8DEFC0A307D2
     128 .abcdefghi.......jklmnopqr.......~stuvwxyz......^.........[]....
         D666666666ABFFFBB666666777ABEBCAB777777777ABDDDA5AABAABBBB55AABD
         8123456789BB0DE10ABCDEF012AA68645E3456789A1F0DEEE357976CDEBDF847
     192 {ABCDEFGHI......}JKLMNOPQR......\.STUVWXYZ......0123456789......
         7444444444AFFFFF7444444555BFFFFF5F55555555BDDDDD3333333333BDDDD9
         B123456789D46235DABCDEF0129BC9AFC73456789A24623501234567893BC9AF

Goto:   Begin this document End this document UVSI Home-Page

U6. Alternate EBCDIC to ASCII Translate Tables

Illustrating Translate table differences

Now, we will translate using the German translate table by specifying 'rop=t2'.


 #2. uvcopy toascii1,fili1=dat1/trt256,filo1=tmp1/trtDE,uop=a256b256,rop=t2
     ======================================================================

 #3. uvhd tmp1/trtDE r256    <-- display results using translate table for Germany
     ====================        (2 letter code DE)
 rec#=1 rsize=256 fptr=0 fsize=256 records=1
                  10        20        30        40        50        60
 r#    1 0123456789012345678901234567890123456789012345678901234567890123
       0 ................................................................
         0000808788800000111180081188111188888811899990009919999099991191
         0123091F234BCDEF01235A868978CDEF9ABCDE7BF012356745667894ABCD45EA
      64  ..{........<(+!&........~.$*);^-/.[.......,%_>?.........`:#.'="
         2AE7EEEEEFC232222EEEEEEEE7D2223522C5CCCCCDF22533FCCCCCCCC632A232
         002B0135714EC8B169AB8DEFCEC4A9BEDF2B0135716C5FEF89AB8DEFC0A377D2
     128 .abcdefghi.......jklmnopqr........stuvwxyz...........@.....|....
         D666666666ABFFFBB666666777ABEBCABD77777777ABDDDAAAABA4BBBBA7AABD
         8123456789BB0DE10ABCDEF012AA68645F3456789A1F0DEE2357906CDECCF847
     192 .ABCDEFGHI.......JKLMNOPQR..}.....STUVWXYZ..\...0123456789..]...
         E444444444AFAFFFF444444555BF7FFFDF55555555BD5DDD3333333333BD5DD9
         4123456789D46235CABCDEF0129BD9AF673456789A24C23501234567893BD9AF

But, it is very hard to see the differences. We cannot use 'diff' which expects text files, but we can use 'uvcmp1' (uvcopy job) to show differences in binary files. See documentation at https://uvsoftware.ca/uvcmp.htm.


 #4. uvcopy uvcmp1,fili1=tmp1/trtUS,fili2=tmp1/trtDE,filo3=rptcmp/trtUSDE.dif,uop=r256u0
     ===================================================================================

Or, easier to use 'uvcmpFA1' (UV script calling uvcopy job 'uvcmp1)


 #4a. uvcmpFA1 tmp1/trtUS tmp1/trtUS r256u0
      =====================================
      -  default output to rptcmp/...

Goto:   Begin this document End this document UVSI Home-Page

U7. Alternate EBCDIC to ASCII Translate Tables

Illustrating Translate table differences

 uvcmp1 - compare 2 files, print mismatched records, '*' flag diffs
 2019/03/24_12:02:02 uop=q1p30r256s6t1000000u3x2y0q1r256u3
 recsize  reccount   file-size  typ Report=rptcmp/trtUS
 1:  256         1         256  RSF  File1=tmp1/trtUS
 2:  256         1         256  RSF  File2=tmp1/trtDE
                       1         2         3         4         5         6
 f#record#byte# 0123456789012345678901234567890123456789012345678901234567890123
 ===============================================================================
 1       1    0 ................................................................
                0000808788800000111180081188111188888811899990009919999099991191
                0123091F234BCDEF01235A868978CDEF9ABCDE7BF012356745667894ABCD45EA
             64  ...........<(+|&.........!$*);.-/.........,%_>?.........`:#@'="
                2AEEEEEEEFA232272EEEEEEEED22223A22CCCCCCCDA22533FCCCCCCCC6324232
                00240135712EC8BC69AB8DEFCF14A9BCDF240135716C5FEF89AB8DEFC0A307D2
                   *      *    *         **    *   *      *                 *
            128 .abcdefghi.......jklmnopqr.......~stuvwxyz......^.........[]....
                D666666666ABFFFBB666666777ABEBCAB777777777ABDDDA5AABAABBBB55AABD
                8123456789BB0DE10ABCDEF012AA68645E3456789A1F0DEEE357976CDEBDF847
                                                 *              *    *    **
            192 {ABCDEFGHI......}JKLMNOPQR......\.STUVWXYZ......0123456789......
                7444444444AFFFFF7444444555BFFFFF5F55555555BDDDDD3333333333BDDDD9
                B123456789D46235DABCDEF0129BC9AFC73456789A24623501234567893BC9AF
                *           *   *           *   *           *               *
 2       1      ................................................................
                0000808788800000111180081188111188888811899990009919999099991191
                0123091F234BCDEF01235A868978CDEF9ABCDE7BF012356745667894ABCD45EA
             64  ..{........<(+!&........~.$*);^-/.[.......,%_>?.........`:#.'="
                2AE7EEEEEFC232222EEEEEEEE7D2223522C5CCCCCDF22533FCCCCCCCC632A232
                002B0135714EC8B169AB8DEFCEC4A9BEDF2B0135716C5FEF89AB8DEFC0A377D2
                   *      *    *         **    *   *      *                 *
            128 .abcdefghi.......jklmnopqr........stuvwxyz...........@.....|....
                D666666666ABFFFBB666666777ABEBCABD77777777ABDDDAAAABA4BBBBA7AABD
                8123456789BB0DE10ABCDEF012AA68645F3456789A1F0DEE2357906CDECCF847
                                                 *              *    *    **
            192 .ABCDEFGHI.......JKLMNOPQR..}.....STUVWXYZ..\...0123456789..]...
                E444444444AFAFFFF444444555BF7FFFDF55555555BD5DDD3333333333BD5DD9
                4123456789D46235CABCDEF0129BD9AF673456789A24C23501234567893BD9AF
                *           *   *           *   *           *               *
 ==================== EOF or StopPrint/StopRead count reached  ==============
 F1Count=1, F2Count=1, StopPrint=6, StopRead=1000000
 F1Reads=1, MisMatches=1, MisMatsPrinted=1, Recsize=256

Goto:   Begin this document End this document UVSI Home-Page

U8. toascii2 - convert EBCDIC to ASCII demo

toascii2 - demo convert dat1/custmas0 EBCDIC to ASCII

Here is the 1st record of the EBCDIC version of dat1/custmas1 shown earlier on page 'D3' - using uvhd to show hexadecimal values of characters.


 #1. uvhd dat1/custmas0 r256  <-- display EBCDIC demo file
     =======================
 rec#=1 rsize=256 fptr=0 fsize=8192 records=32
                      10        20        30        40        50        60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 ......@@@@.........@......@...K@@@@....@.....@....@@@@@@@@@@....
             FFFFFF4444CECDCDCCD4DDEDDE4DEC44444FFFF4CDECD4DDCC4444444444DCDC
             130140000055597955504636920334B000018150266550961400000000005151
          64 ...@@@@@@@@@@..@......@@@@...`...`....@.....@......@@@@@..4V|...
             CDD4444444444CC4EFEFCF4444FFF6FFF6FFFF4DCDDE4EDCDCC4444401357000
             946000000000023059218100002500754055310319980695538000000246C000
         128 .........W0....`........)X}..f3.....\.................4V}...f...
             0000000005300016000000002570063100095000000000000000013570016000
             0C0000C0270D0540C0000C0098D0263C0444C0000C0000C0000C0246D0056C00
         192 .E|...V}.......................f.....<........f..@........@@@@@%
             047000570000000088000000001800068000130000000069C4FFFFFFFF444442
             35C0046D0000C0023C0000C0083C0056D0012C0000C0016D3020190320000005

The character lines of the 3 line hex display groups are garbage, but uvhd has option 'a' to translate the character line to ASCII, but still show the EBCDIC values of the hexadecimal zones & digits.


 #2. uvhd dat1/custmas0 r256a  <-- display EBCDIC demo file
     ========================    - option 'a' shows ASCII chars for hex zones/digits
 rec#=1 rsize=256 fptr=0 fsize=8192 records=32
                      10        20        30        40        50        60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD          NANA
             FFFFFF4444CECDCDCCD4DDEDDE4DEC44444FFFF4CDECD4DDCC4444444444DCDC
             130140000055597955504636920334B000018150266550961400000000005151
          64 IMO          BC V9S1H1    250-754-5531 LARRY WRENCH     ...V@...
             CDD4444444444CC4EFEFCF4444FFF6FFF6FFFF4DCDDE4EDCDCC4444401357000
             946000000000023059218100002500754055310319980695538000000246C000
         128 .........W.....-.........X'..f.....m*..................V'...f...
             0000000005300016000000002570063100095000000000000000013570016000
             0C0000C0270D0540C0000C0098D0263C0444C0000C0000C0000C0246D0056C00
         192 .E@...V'........c..............f..............f.C 20190320     .
             047000570000000088000000001800068000130000000069C4FFFFFFFF444442
             35C0046D0000C0023C0000C0083C0056D0012C0000C0016D3020190320000005
 See page 'D3' for the record layout & note the packed fields in bytes 120-239
 - 24 5 byte packed fields for this year & last year monthly sales.
 The packed fields must be preserved when we convert mainframe EBCDIC files
 to ASCII for unix/linux - because COBOL expects packed/binary fields the same.
 So we must translate only bytes 0-119 & 240-255.

Goto:   Begin this document End this document UVSI Home-Page

U9. toascii2 - convert EBCDIC to ASCII demo

toascii2 - demo convert dat1/custmas0 EBCDIC to ASCII

uvcopy 'toascii2' is a demo job to convert dat1/custmas0 EBCDIC to ASCII. It has options to translate 2 fields & those default to the custmas0 layout, but you could modify the options & record-size to convert other files, or write your own uvcopy job, or generate the uvcopy job from the COBOL copybook as documented in https://uvsoftware.ca/datacnv1.htm#Part_3


 #3. uvcopy toascii2,fili1=dat1/custmas0,filo1=tmp/custmas0.asc
     ==========================================================
      - convert custmas0 EBCDIC file to ASCII
      - console log as follows:
      toascii2 - copy a file translating EBCDIC to ASCII
               - filenames & options default to custmas0 demo
               - can enter your filenames & options
      uop=q1a256b256c0d120e240f16 - option defaults
            a256b256              - I/O recsize defaults
                    c0            - field 1 dsplcmnt to start ASCII translate
                      d120        - field 1 length (default 120 omits packed fields)
                          e240    - field 2 dsplcmnt to start ASCII translate
                              f16 - field 2 length (0 disables)
      User OPtion (uop) defaults  = q1a256b256c0d120e240f16
      -->null to accept or enter/override -->
      190323:195205:toascii2: EOF fili01 rds=32 size=8192: dat1/custmas0
      190323:195205:toascii2: EOF filo01 wrts=32 size=8192: tmp/custmas0.asc

 #4. uvhd tmp/csutmas0.asc r256  - inspect output
     ==========================  - omitting option 'a' (now ASCII)
 rec#=1 rsize=256 fptr=0 fsize=8192 records=32
                      10        20        30        40        50        60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD          NANA
             3333332222454545444244545524542222233332445442544422222222224444
             130140000056527255E0DF4F230C44E0000181502F75E02F140000000000E1E1
          64 IMO          BC V9S1H1    250-754-5531 LARRY WRENCH     ..4V|...
             4442222222222442535343222233323332333324455525544442222201357000
             9DF00000000002306931810000250D754D55310C12290725E38000000246C000
         128 .........W0....`........)X}..f3.....\.................4V}...f...
             0000000005300016000000002570063100095000000000000000013570016000
             0C0000C0270D0540C0000C0098D0263C0444C0000C0000C0000C0246D0056C00
         192 .E|...V}.......................f.....<........f.C 20190320     .
             0470005700000000880000000018000680001300000000694233333333222228
             35C0046D0000C0023C0000C0083C0056D0012C0000C0016D302019032000000E

We now have the true ASCII values for the characters, compare to the previous page The 1st byte '1' is x'F1' in EBCDIC & x'31' in ASCII. Byte 10 'E' is x'C5' in EBCDIC & x'45' in ASCII. And not tha packed fields are unchanged.

We will not show the uvcopy code, but you can inspect as follows:


 #5. vi $UV/pf/util/toascii2
     =======================

Goto:   Begin this document End this document UVSI Home-Page

W1. multicol1,2,3 - rearrange files for multi-column printing (2up,3u p,etc)

Use this job when you want to print multi column tickets, labels, etc. This assumes the input records contain some sequential# or alpha sequence that we wish to appear in sequence horizontally or vertically. Three versions of the program are provided:

multicol1
  • prints the records in horizontal sequence
  • options for the no of columns & the spacing between the columns
multicol2
  • prints the records in vertical sequence
  • last record in column 1 followed by 1st record in column 2 etc
  • options for the no of columns & the spacing between the columns
multicol3
  • writes the records in vertical sequence
  • for use when you already have a program to print horizontally
  • options for the no of columns (user program determines spacing)

These jobs read the entire file into memory to allow the vertical sequencing. By default 10 megabytes are reserved for the input area 'a', but you could increase to 100 meg or more if required depending on your memory available. Since 200 bytes are allowed for each record, 10 meg allows 50,000 records,& 100 meg would allow 500,000 records. You may modify 'was=a10000000' which appears about line #45 in the job (see listing 2 pages ahead).

demo input file tf/test100

 0001 one
 0002 two
 0003 three
 0004 four
   ------- etc ------
 0097 ninety seven
 0098 ninety eight
 0099 ninety nine
 0100 one hundred

multicol1 output (horizontal)

 0001 one           0002 two           0003 three        0004 four
 0005 five          0006 six           0007 seven        0008 eight
 0009 nine          0010 ten           0011 eleven       0012 twelve
                ----------------- etc ------------------
 0097 ninety seven  0098 ninety eight  0099 ninety nine  0100 one hundred

multicol2 output (vertical)

 0001 one           0026 twenty-six    0051 fifty-one     0076 seventy-six
 0002 two           0027 twenty-seven  0052 fifty-two    0077 seventy-seven
 0003 three         0028 twenty-eight  0053 fifty-three  0078 seventy-eight
                ----------------- etc ------------------
 0025 twenty-five   0050 fifty         0075 seventy-five 0100 one hundred

Goto:   Begin this document End this document UVSI Home-Page

W2. multicol1/2/3 - rearrange files for multi-column printing (2up,3up,4up,etc)

These jobs were suggested by Mike Fey of Datex Services Vancouver. The most important job to him was multicol3, since he already had an application to print horizontally, and he needed a way to rearrange the file to achieve the vertical column effect.

multicol3 output (vertical)

 0001 one
 0026 twenty six
 0051 fifty one
 0076 seventy six
 0002 two
 0027 twenty seven
 0052 fifty two
 0077 seventy seven
  ----- etc -----
 0025 twenty five
 0050 fifty
 0075 seventy five
 0100 one hundred

'multicol3' output is fed into Mike's program, which prints 4 vertical columns as shown below. multicol3 makes it easy for Mike's program, which can simply spread each set of 4 records across the page.

 # 0001 one            0026 twenty six     0051 fifty one      0076 seventy six
 # 0002 two            0027 twenty seven   0052 fifty two      0077 seventy seven
 # 0003 three          0028 twenty eight   0053 fifty three    0078 seventy eight
 #           --------------------------- etc ----------------------------
 # 0025 twenty five    0050 fifty          0075 seventy five   0100 one hundred

Note that if we feed the output of multicol3 into multicol1, we will get the same output as we did from multicol2 (as shown above & on the previous page).

Goto:   Begin this document End this document UVSI Home-Page

W2. multicol1/2/3 - rearrange files for multi-column printing (2up,3up,4up,etc)

test/demo Op. Instrns.

Run the following & ensure that your outputs match those shown above. Option 'c' controls the number of columns per output line (default 4). Option 'd' controls width allowed for each record on output line (default 19). Option 's' controls the space between records on the output line (default 1). The number of columns is controlled by user option 'c' You may specify options on the command line (via uop=...) or at the prompt.


 #1. uvcopy multicol1,fili1=?tf/test100,filo1=tmp/testmc1,uop=c4d19s1
     ================================================================

 #2. uvcopy multicol2,fili1=?tf/test100,filo1=tmp/testmc2,uop=c4d19s1
     ================================================================

 #3. uvcopy multicol3,fili1=?tf/test100,filo1=tmp/testmc3,uop=c4
     ===========================================================

 #4. uvcopy multicol1  <-- you may omit filenames & options from command line
     ================    - you will be prompted to accept or override defaults

You can inspect the uvcopy code for these jobs, for example:


 #5a. vi /home/uvadm/pf/util/multicol1
      ================================
 #5b. vi /home/uvadm/pf/util/multicol1
      ================================
 #5c. vi /home/uvadm/pf/util/multicol1
      ================================

Goto:   Begin this document End this document UVSI Home-Page

Visitor Counters for ThisYear and LastYear