UV Installation Guide for Windows/Dos - CONTENTS

A1. Introduction & Overview
A2.  Vancouver Utilities, Alternative Versions & Install Methods
B1. Vancouver Utilities for native Windows supplied on CDROM
 or downloaded from UV Software website with supplied userid/password
C1. Installing from CDROM or download from UV Software website
C2.  Download from UV Software website with emailed userid/password
- Essential subdirs for Windows version of Vancouver Utilities
C3.  Setting up Environmental Variables for PATH & PFPATH
- assigning LPT1 to a network printer (for uvlist uvlpr scripts)
C4.  Customizing the Windows Command Prompt Window from the
 small, ugly black & white screen to a big beautiful blue screen.
C5. Install "vim" editor on Windows system. You could edit source programs
 on windows with notepad/wordpad, but unix/linux users will want this
'vi-like' editor that runs on Windows (as well as unix/linux).
D1. Install WSL (Windows Subsystem for Linux) to run the linux version of
 Vancouver Utilities on a Windows system, 1st doc Feb 2020 Windows 1903
D2.  Installing Vancouver Utilities for WSL - Overview/Notes
D3.  Windows & Linux Directories relevant to VU profiles,programs,& scripts
D4.  Setup users for Linux versions of Vancouver Utilities on Windows WSL
D5.  Setup profiles for Linux users of Vancouver Utilities on Windows WSL
 E0. Testing/Demonstrating the UV programs
 E0. Test files used to demonstrate the Vancouver Utilities
 E1. sales3 - sales details (64 byte records, ASCII text, easy to display/print)
 E2. custmas1 - customer masters (256 byte records with 24 packed decimal fields)
     custmast - Indexed file version of custmas1 (for testing listISF)
 E3. uvhd - binary file investigation & display in vertical hexadecimal
 E4. uvcp - file copy with record selection & reformatting
 E5. uvsort - file sort utility with record selection & much more
 E6. uvlist - list text files, inserting laser printer control codes
 E5a. assigning LPT1 to a network printer (for uvlist uvlpr scripts)
 E8. uvcopy - the most powerful Vancouver Utility (data manipulation, etc)
 E10. table2 - pre-programmed table analysis of any field by any argument
 E11. cobmap1 - pre-programmed job to create record layouts from COBOL copybooks
 E12. uvqrpg - Quick Report Generator
 E14. D-ISAM - Indexed file test/demos using uvcp, uvsort,& uvcopy.
 E17. listISF - Pre-Programmed uvcopy job to list any C-ISAM/D-ISAM Indexed file
 E18. scan1d - scan all files in a directory for matches to qualified patterns
 E19. rep2 - copy files replacing patterns, qualified by other patterns
 E20. prodfix1 - uvcopy equivalent of the rep2 pre-programmed job above
 E21. tabfix1  - converting tabs to blanks
 E23. More pre-programmed jobs for various useful file conversions
      - UPPER/lower case, EBCDIC/ASCII, etc

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

UV Install on Windows - Contents continued

Note
  • the following sections are not required if you only need to execute
    the Vancouver Utilities on Windows systems, since the Windows versions
    are delivered as 'precompiled executables only'.
  • If you have purchased the unix/linux versions (which include source code)
    you could transfer the source code to Windows and use these instructions
    to download the MinGW C compiler & compile on Windows.
  • Also note that the unix/linux versions contain the precompiled Windows
    '.exe's in subdir binDOS/... & you could transfer those to Windows
  • You only need the following sections if you want to change the VU source
    or you have your own C/C++ programs to compile with MinGW.
F1. Install "MinGW" to compile C (& C++) programs on Windows
G1. Porting the Vancouver Utilities from Unix to native Windows
H1. Scripts (batch files) used in compiling & linking native Windows versions
 of the Vancouver Utility programs.
I1. Porting Vancouver Utilities from Linux to Windows
J1. C program to test 64 bit integers on windows
K1. uvcopy job to test 64 bit integers on windows

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

A1. Installation Guide for native Windows - Overview

  1. This documentation file is WindowsDOS.htm (installation procedures for the Vancouver Utilities under Windows 95,98,NT,2000). The installation procedures for Unix/Linux are separately documented in install.htm.

  2. The 'Windows' version of Vancouver Utilities was 1st available in 2002. See uvprices.htm for prices all versions (Windows, Unix/Linux,& Mainframe conversion packages).

  3. The 'Windows' package is executables only. Source code for the C programs is provided only for the Unix/Linux versions. The Unix versions of Vancouver Utilities also include these 'Windows' versions.

  4. The Windows executables run in the DOS window under Windows 95,98,NT,2000.

  5. Be sure to run the Test/Demos starting on page 'E0'. Please confirm that you get the expected outputs & please inform UV Software of any discrepancies. These test/demos will give you an appreciation of the most useful components of the Vancouver Utilities - even if you are just reading this on the web site.

  6. Note that this documents the 'native' Windows version of Vancouver Utilities. Also see 3 unix/linux emulation versions that run on windows machines (SFU, CYGWIN,& UWIN), documented on the next page.

  7. Until Dec 2011, Windows versions were compiled using the lcc-win32 compiler, which may be downloaded from https://www.cs.virginia.edu/~lcc-win32/ (or https://www.Q-Software-Solutions.com). The author is Jacob Navia (France).

  8. In Dec 2011, I switched to the MinGW 'gcc' compiler (see www.mingw.org).

 ============================================================================
 Owen Townsend, UV Software, 4667 Hoskins Rd., North Vancouver BC, V7K2R3
         Tel:   604-980-5434          Fax: 604-980-5404
         Email: owen@uvsoftware.ca    Web: https://www.uvsoftware.ca
 Copyright(C) 1993-2008, UV Software Inc, All rights reserved
 ============================================================================

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

A2. Vancouver Utilities Versions Summary

3 market versions of Vancouver Utilities

Class A
  • complete package including mainframe conversion tools
  • includes source code for compile on unix/linux/windows
  • distribution package has precompiled binaries for Linux & Windows
Class B
  • Vancouver Utilities without mainframe conversion tools
  • includes source code for compile on unix/linux/windows
  • distribution package has precompiled binaries for Linux & Windows
Class C
  • Vancouver Utilities without mainframe conversion tools
    and without source code
  • executables only, intended for windows

Distribution Files CD or download

uvadm.tar
  • tar archive for Unix/Linux or Windows SFU (or Cygwin, Uwin)
uvadm.zip
  • zip archive for Windows (same contents as uvadm.tar)

These are alternative formats, but the contents are the same. You use whichever 1 is appropriate for your system. Both may hold 3 sets of binaries as follows:

subdirs of pre-compiled binaries

bin
  • binaries compiled on Red Hat Linux (always provided)
binDOS
  • '.exe's compiled by MinGW gcc on Windows (always provided)
binSFU
  • binaries compiled on Windows SFU by gcc (on request)
binCYGWIN
  • binaries compiled under Cygwin on Windows (on request)
binUWIN
  • binaries compiled under Uwin on Windows (on request)

4 Installation Guides

install.htm - Installation on Unix/Linux systems
- source code is provided for compiling on unix/linux
- But binaries are included for the Linux standard
WindowsSFU.htm - Installation on Windows under SFU
- SFU is available at https://www.microsoft.com/windows/sfu
- provides the Korn shell & most unix utilities on Windows
 'CygwinUwin'     - Installation on Windows under Cygwin or Uwin
                  - unix/linux emulators, similar to SFU
                  - download CYGWIN from https://www.cygwin.com, and
                    UWIN from https://www.wipro.com.
                  - UV Software has tested 3 emulators & recommends SFU
WindowsDOS.htm - Installation on native Windows without SFU
- intended to run in a command window
- 'executables only '.exe' binaries supplied in 'binDOS'
- compiled by MinGW gcc (see www.mingw.org).

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

B1. Installing Windows/DOS versions of Vancouver Utilities

Windows UV software on CD or dwonload

The Windows/DOS version of Vancouver Utilities is supplied in a zip file archive (uvadm.zip) containing the following directories:

binDOS
  • executable programs compiled with MinGW gcc
  • uvcopy, uvsort, uvlist, uvcp, uvhd, uvhdcob, uvqrpg
  • relevant to this WindowsDOS.doc.
batDOS
  • MSDOS batch files (or scripts)
  • uvlpr12, uvlpr14, etc
bin
  • binaries compiled under Red Hat Linux 9.0
  • not relevant to this WindowsDOS.doc, but may be in the zip archive
binCYGWIN
  • binaries compiled with 'gcc' under UWIN & Windows 2000
binUWIN
  • binaries compiled with 'gcc' under UWIN & Windows 2000
  • binCYGWIN/binUWIN supplied on request (compiled by gcc for windows).
  • not intended for this WindowsDOS.doc, but may be in the zip archive
  • probably work the same as the binDOS '.exe's
pf\
  • parameter files for the uvcopy & uvqrpg interpreters
  • pf is sub-directoried by intended use as follows:
pf\adm
  • admin & testing jobs used at UVSI
pf\demo
  • demonstration/sample/training jobs for test files supplied
pf\util
  • general purpose jobs you can use with your own files
  • pre-programmed to solicit filenames, record sizes, options
pf\IBM
  • Mainframe to Unix conversion jobs
  • supplied only with the Unix mainframe conversion package
sf\
  • Korn shell scripts
  • sub-directoried by intended use (sf\adm, sf\demo, sf\util, sf\IBM)
  • see the Korn shell for windows at https://www.kornshell.com
tf
  • test files (mostly text files)
  • to demo uvhd,uvsort,uvcopy,uvlist,uvcp,uvqrpg
dat1
  • test files (mostly fixed record length files)
  • to demo uvhd,uvsort,uvcopy,uvlist,uvcp,uvqrpg
doc
  • UV documentation in text format
dochtml
  • UV documentation in HTML (same as web site www.uvsoftware.ca)
tmp
  • subdir to receive outputs from test/demos
  • also used by uvsort for intermediate sort strings

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

C1. Installing Windows/DOS versions of Vancouver Utilities

Installing from CDROM to your hard disk

Here are the DOS Window commands to setup a directory on your hard disk & unzip the 'uvadm.zip' archive from the CD. The following assumes installation from cdrom E: to harddisk C:


 #1. rename C:\uvadm C:\uvadm.old  - rename in case you need to save anything

 #2. mkdir C:\uvadm                - make a super directory for UV

 #3. cd C:\uvadm                   - change into the UV superdir

 #4. unzip E:\uvadm.zip            - unzip the uvadm.zip archive
     ==================

The 'unzip' command above works for Linux, but may not work in the DOS command window of windows95, windows2000, XP etc. You can use the equivalent WinZip Windows GUI procedures. In any case the relevant uvadm sub-directories should be as follows (we can ignore extra directories that may be present).

After restoring uvadm from CD using Windows procedures, you may have to unset read only attributes. Right click on the uvadm directory:

properties --> attributes --> unset read only --> all files & subdirs

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

C2. Install/Setup Windows/DOS versions of Vancouver Utilities

Downloading from UV Software

UV Software customers can download the Vancouver Utilities package from the website with an emailed userid & password as follows:


 #1. Logon to your windows PC
 #2. open a command window
 #3. mkdir C:\uvadm
 #4. cd C:\uvadm

 #5. ftp uvsoftware.ca
     =================
 #5a. userid----> uvsoft99  <-- actual userid supplied by email
 #5b. password--> xxxxx     <-- actual password supplied by email
 #5c. binary
 #5d. get uvadm.zip   (or uvadm.zip)
 #5e. bye

 #6. unzip uvadm.zip
     ===============

essential subdirs for Windows version of VU

 C:\uvadm
      :-----batDOS
      :-----binDOS
      :-----dat1
      :-----doc
      :-----dochtml
      :-----pf
      :     :-----adm
      :     :-----demo
      :     :-----ibm
      :     :-----util
      :-----sf
      :     :-----adm
      :     :-----demo
      :     :-----ibm
      :     :-----util
      :-----tf
      :-----tmp

If you have purchased the source code versions of Vancouver utilties, you will have several additional sub-directories required to compile the source code using the MinGW gcc windows/DOS compiler. Please see page 'G1' to see the details.

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

C3. Install/Setup Windows/DOS versions of Vancouver Utilities

Environmental Variables for UV on Windows


 #1. ControlPanel -> System -> Advanced -> Environmental Variables

 #2. New or Edit (depending on whether item already defined or not)

 #2a. PATH   C:\uvadm\binDOS;C:\uvadm\batDOS
      ======================================

 #2b. PFPATH C:\uvadm\pf\adm,C:\uvadm\pf\demo,C:\uvadm\pf\util,C:\uvadm\pf\IBM
      ========================================================================

 #3c. HOME   C:\uvadm       (optional)
      ===============

Or Update AUTOEXEC.BAT (obsolete)


 #2.  EDIT C:\AUTOEXEC.BAT

 #2a. SET PATH=%PATH%;C:\DOS;C:\uvadm\binDOS;C:\uvadm\batDOS
      ======================================================
 #2b. SET PFPATH=C:\uvadm\pf\adm,C:\uvadm\pf\demo,C:\uvadm\pf\util,C\uvadm\pf\IBM
      ===========================================================================
 #2c. SET HOME=C:\uvadm
      =================
Note
  • PFPATH is comma ',' delimited vs PATH which must be ';' delimited.

assign LPT1 to a network printer

The uvlist scripts for Windows/DOS (such as uvlpr12) redirect output to 'LPT1', which in the old days was a cable connected printer on a parallel or USB port. You can redirect LPT1 to a network printer with the following command (issued from a Windows/DOS command window).


 net use lpt1 \\computername\printername /persistent:yes
 =======================================================

For example, my computername was 'OWEN-PC' & I had configured a network printer named 'lexmarkT652' so my command was:


 net use lpt1 \\OWEN-PC\lexmarkT652 /persistent:yes
 ==================================================

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

C4. Install/Setup Windows/DOS versions of Vancouver Utilities

Customize Windows DOS Command Window

This is optional, but it is highly recommended, since it converts the default small & ugly black & white DOS window to a beautiful blue experience. The following was tested on a 17 inch monitor.

  1. Create a shortcut to the DOS command prompt on your desktop.

  2. Right click on the shortcut & click on properties. You will get a 'Command Prompt Properties' window with several menu choices (General, Shortcut, Options, Font, Colors).

  3. On the Shortcut menu, update Startin & Run as follows:


 #3a. Startin --> C:\uvadm
 #3b. Run --> Normal Window  (choices: Normal, Minimized, Maximized)
  1. On the Layout menu, update Screen buffer size & Window size:


 #4a. Screen buffer size Width  --> 120
 #4b. Screen buffer size Height --> 300
 #4c. Window size Width  ---------> 120
 #4d. Window size Height --------->  55
  1. On the Color menu:


 #5a. Screen background --> dark blue
 #5b. Screen foreground --> bright yellow
Note
  • Setting Window size width to 120 allows use of option 'l100' on 'uvhd'
  • uvhd is a file investigation utility (free download at www.uvsoftware.ca)
  • see the demo on page 'E3' ahead (default line width of 64 characters)
  • you might prefer line width of 100 characters

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

C5. Install/Setup Windows/DOS versions of Vancouver Utilities

Download/Install VIM for Windows

"vim" is an improved version of "vi" developed by Bram Moolenaar ("vi' is the basic text editor delivered with unix/linux systems). The package is a free download from "vim.org". Download & install (on Windows 7) as follows:

  1. use Internet browser to go to website "vim.org".

1a. click "Download" (on left side of home page)

1c. select "PC MS_DOS and MS-Windows" from list (Unix,Amiga,OS2,etc(

1d. click/download "gvim73_46.exe"

1e. click "Save File" (to Downloads directory by default)

  1. use Windows Explorer to execute downloaded & saved gvim archive

2a. browse to Windows "Downloads" directory

2b. double click on "gvim73_46.exe"

2c. Install at C:\vim (vs default C:\Program Files....)

  1. add vim to Windows environmental variable "PATH"

3a. ControlPanel -> System -> Advanced system settings

3b. Environmental Variables -> System variables.

3c. scroll down to "PATH" & click "edit" & append ";C:\vim\vim73" (at end of long line begining with C:\Program Files...).


     C:\Program Files.........;C:\vim\vim73
     ======================================

3d. click "OK" for edit & "OK" again for Environmental Variables

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

D1. Install WSL (Windows Subsystem for Linux)

Prior sections documented installing Vancouver Utilities on a windows system to use the native Windows .exe versions of Vancouver Utilities, distributed in binDOS/uvcopy.exe,uvsort.exe,etc vs Linux executables in bin/uvcopy,uvsort,etc.

Alternatively, you can run the linux executables on Windows by installing 'WSL' (Windows Subsystem for Linux). Running WSL gives you access to all features of Vancouver Utilities. WSL/Linux allows you to run bash or korn shell scripts which cannot run under native Windows.

Here are concise Instructions to Install WSL, condensed from https://www.windowscentral.com/install-windows-subsystem-linux-windows-10 I will refer to the same item numbers that relate to the web documentation.

Enabling WSL for Linux (using settings)


 #1,2,3. Settings --> apps --> Programs & Features

 #4. Turn Windows Features on/off

 #5,6. select Windows Subsystem for Linux & OK

 #7. Restart now

Install Linux Distro using Microsoft store


 #1. open Microsoft store

 #2,3. Search for Ubuntu & select

 #4. Get/Install

 #5. Launch

 #6,7,8. Create Username & password

Example - running uvsort on WSL/bash

A client was using the Windows .exe versions of uvsort.exe,uvcopy.exe,etc & wanted to use uvsort.exe to sort & load an Indexed file for Micro Focus COBOL. The Windows uvsort version does not support Indexed files, but Linux uvsort does.

He could use WSL/uvsort to sort & load a sequential file created by COBOL into an Indexed file, & switch back to Winodws to continue processing under Windows.


 #1. Run COBOL application to create the sequential file

 #2. wsl  <-- run WSL (or bash)

 #3. run uvsort to load Indexed file

 #4. exit back to Windows

 #5. continue COBOL application

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

D2. Setup WSL (Windows Subsystem for Linux)

Installing Vancouver Utilities on WSL - Overview/Notes

  1. We have already documented installing Vancouver Utilities to on Windows to execute the Windows binaries stored in C:\uvadm\batDOS\uvcopy.exe,uvsort.exe,etc.

  2. To execute the Windows .exe's the only setup required was to update the Windows Environment Variables as documented on page 'C3'.

  3. We will now document setups to execute the Linux binaries aalready stored at C:\uvadm\bin\uvcopy,uvsort,uvhd,etc, but we must copy C:\uvadm\* into the WSL Linux file system at ...\rootfs/home/uvadm/...

  4. We also need to install .bash_profile in all user homedirs to call the common_profile from /home/appsadm/env/common_profile_uv. This allows you to customize the common_profile for all users & not lose it if/when you install a new version of Vancovuer Utilities.

  5. You must be running Linux when you store or update any files in the Linux file system which is well hidden to Windows, but easy to access from Linux '/'.

  6. For Windows, my Ubuntu files are stored at C:\Users\Owen\Appdata\Local\Packages\ CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1frdgse\LocalState\rootfs\... - intentional long pathname to discourage you from updating Linux files using Winodws utiliites. You must never attempt to update Linux files from Windows, but you can update windows files from Linux.

  7. The Linux system files are easy to address under Linux simply from '/...' the same as on a native Linux system. Linux homedirs will be under /home/...

  8. Before we can execute the VU programs & scripts, we must store .bash_profile at /home/userlogins/.bash_profile which calls /home/appsadm/env/common_profile_uv.

  9. The profiles are distributed in /home/uvadm/env/... and we 1st copy them to /home/appsadm/env/... so we do not lose any updates to the common_profile when a new version of Vancouver Utiltiies is installed.

  10. To help you understand the following setup instructions, we will diagram the directories relevant to installing VU profiles & programs.

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

D3. Setup WSL (Windows Subsystem for Linux)

Windows Directories Relevant to VU profiles,programs,scripts

 C:\uvadm\batDOS    <-- .bat scripts for Windows VU
         \bin       <-- Linux binaries (uvcopy,uvsort,uvhd,etc)
         \binDOS    <-- Windows binaries (uvcopy.exe,uvsort.exe,uvhd.exe,etc)
         \...
         \env       <-- profiles (bash_profile_uv, common_profile_uv, etc)
         \...
         \sf        <-- VU scripts in subdirs adm/..., demo/..., util/..., IBM/...
         \src       <-- C source (uvcopy.c, uvsort.c, uvhd.c, etc)
         \...

Linux Directories Relevant to VU profiles,programs,scripts

C:\Users\Owen\Appdata\Local\Packages\Ubuntu18.04onWindows\LocalState\rootfs\... /... <-- the Windows pathname above is just '/' for Linux

 /bin         <-- Linux system binaries
 /boot        <-- Linux system boot kernels
 /...
 /home/appsadm
 ............./env/bash_profile_uv    <-- profiles copied from /home/uvadm/env/...
 ............./env/common_profile_uv
 /...
 /home/uvadm
 .........../env/bash_profile_uv      <-- profiles origunal original location
 .........../env/common_profile_uv
 /...
 /home/.bash_profile <-- bash_profile_uv must be copied/renamed to all homedirs
 /...
 /root        <-- Linux system root homedir
 /root/.bash_profile  <-- copied/renamed from /home/appsadm/env/bash_profile_uv
 /...
Note
  • when I 1st installed WSL, my 1st attempts to run WSL were user 'root'
    so I installed '.bash_profile' at /root/.bash_profile
  • I think the following install instrucitons will correct this problem

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

D4. Setup WSL (Windows Subsystem for Linux)

Setup users for Linux versions of VU on Windows WSL

 Here are the concise instructions to use Linux versions of VU on Windows WSL
 - assuming that VU has already been installed in Windows C:\uvadm/...
 as doumented at https://uvsoftware.ca/windowsdos.htm#C2, and that WSL has been
 installed as documented on page 'D1'.

 #1. Logon to your Windows account with admin privileges

 #2. wsl       <-- start WSL (or could start using 'bash')
     ===

 #3. whoami    <-- check userid, may be root right after WSL install ?
     ======
 #3a. sudo -i  <-- change userid to root if not already root
      =======

 #4. groupadd apps  <-- add a groupname for your users
     =============

 #5a. useradd -m -g apps -s /bin/bash uvadm      <-- setup user 'uvadm'
      ======================================
 #5b. useradd -m -g apps -s /bin/bash apspadm  <-- setup user 'appsadm'
      =======================================
 #5c. useradd -m -g apps -s /bin/bash userxx    <-- setup other users desired
      ======================================
      note '-s /bin/bash' to execute the 'bash' shell (vs unwanted /bin/sh)

 #6a. passwd uvadm       <-- set passwords desired
      ============
 #6b. passwd appsadm
      ==============
 #6c. passwd userxx
      =============

 #7. cp -r /mnt/c/uvadm/* /home/uvadm/
     =================================
      - copy all VU dirs & files from Windows to Linux file system

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

D5. Setup WSL (Windows Subsystem for Linux)

Setup profiles for Linux users of Vancouver Utilities


 #8a. cp /home/uvadm/env/bash_profile_uv /home/uvadm/.bash_profile
      ============================================================
 #8b. cp /home/uvadm/env/bash_profile_uv /home/appsadm/.bash_profile
      ================================================================
 #8c. cp /home/uvadm/env/bash_profile_uv /home/userxx/.bash_profile
      ==============================================================
       - copy bash stub profile, renaming as required for Linux logins
       - distributed as 'bash_profile_uv' for visibility & ID

 #9. cp -r /home/uvadm/env/  /home/appsadm
     =====================================
      - copy profiles from uvadm/env/* to appsadm/env/...
      - since .bash_profiles call common_profile from /home/appsadm/env/...
      - so you can custumize the common_profile & not lose it on new VU installs

 #10a. exit     <-- exit from previous 'sudo -i' for root
 #10b. exit     <-- exit from wsl

 #11. wsl -u uvadm   <-- start WSL for Linux user uvadm
      ============
       - should see following info displayed by .bash_profile & common_profile
      Executing--> $HOME=/home/uvadm/.bash_profile (copied/renamed from $APPSADM/env/bash_profile_uv)
       - Vancouver Utilities stub_profile in login homedir, will call common_profile
       - LOGNAME=uvadm HOME=/home/uvadm PWD=/home/uvadm APPSADM=/home/appsadm CALLER=login
      Calling--> . /home/appsadm/env/common_profile_uv
      Executing--> $APPSADM/env/common_profile_uv (APPSADM=/home/appsadm)
      LOGNAME=uvadm HOME=/home/uvadm APPSADM=/home/appsadm CALLER=login
      HOSTNAME=uvsoft5 LOGNAME=uvadm APPSADM=/home/appsadm
      RUNLIBS=/home/uvadm/testlibs RUNDATA=/home/uvadm/testdata

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

E0. Test/Demo Vancouver Utilities for Windows/DOS

Please run the test/demos documented on the following pages & confirm that your outputs match the expected outputs. Please email UV Software if you find discrepancies or have problems running these test/demos.

E0. Test files used to demonstrate the Vancouver Utilities
E1. sales3 - sales details (64 byte records, ASCII text, easy to display/print)
E2. custmas1 - customer masters (256 byte records with 24 packed decimal fields)
custmast - Indexed file version of custmas1 (for testing listISF)
E3. uvhd - binary file investigation & display in vertical hexadecimal
E4. uvcp - file copy with record selection & reformatting
E5. uvsort - file sort utility with record selection & much more
E6. uvlist - list text files, inserting laser printer control codes
E8. uvcopy - the most powerful Vancouver Utility (data manipulation, etc)
E10. table2 - pre-programmed table analysis of any field by any argument
E11. cobmap1 - pre-programmed job to create record layouts from COBOL copybooks
E12. uvqrpg - Quick Report Generator
E14. D-ISAM - Indexed file test/demos using uvcp, uvsort,& uvcopy.
E17. listISF - Pre-Programmed uvcopy job to list any C-ISAM/D-ISAM Indexed file
E18. scan1d - scan all files in a directory for matches to qualified patterns
E19. rep2 - copy files replacing patterns, qualified by other patterns
E20.   prodfix1 - uvcopy equivalent of the rep2 pre-programmed job above
E21.   tabfix1 - converting tabs to blanks
E23. More pre-programmed jobs for various useful file conversions
- UPPER/lower case, EBCDIC/ASCII, etc

test/demo Operating Procedures


 #1. You must have setup your PATH & PFPATH as shown on page 'C3'.

 #2. cd C:\uvadm       - change to & stay in the uvadm superdir.
     ===========

 #3. mkdir tmp         - setup a 'tmp' subdir if not already present
     =========           to receive the outputs of the various test/demos

 #4. del tmp\*      OR - remove any old outputs from previous tests
     =========

 #5. type tmp\outputs  - check your outputs from the uvadm level
     ================

You must stay at the uvadm level, since the test/demos copy files from 'dat1' or 'tf' subdirs to the 'tmp' subdir. Don't change in & out of subdirs, since you need to be back at the uvadm level for the next test. The 'tmp' subdir keeps your uvadm superdir clean (subdirs only). You can remove all temporary files easily anytime (del tmp\*).

Note that you can use either '/' forward slashes or '\' backward slashes, when coding pathnames for the uv utilties. You only need to use '\' backward slashes for DOS commands (edit, type, print, more, etc). It is hard to forgive Bill Gates for this since he based the original MSDOS on UNIX.

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

E1. Test/Demo Vancouver Utilities for Windows/DOS

Here is the test data file that we will use for most 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 the next page. '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

E2. Test/Demo Vancouver Utilities for Windows/DOS

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)
                   1         2         3         4         5         6
         0123456789012345678901234567890123456789012345678901234567890123
       0 130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD          NANA
         3333332222454545444244545524542222233332445442544422222222224444
         130140000056527255E0DF4F230C44E0000181502F75E02F140000000000E1E1
      64 IMO          BC V9S1H1    604-754-5531                  ........
         4442222222222442535343222233323332333322222222222222222200000000
         9DF00000000002306931810000604D754D55310000000000000000000000C000
     128 .........W0....`........)X|..f3.....\.......................f...
         0000000005300016000000002570063100095000000000000000000000016000
         0C0000C0270C0540C0000C0098C0263C0444C0000C0000C0000C0000C0056C00
     192 ...............................f.....<........f.C
         0000008900000000880000000018000680001300000000694222222222222222
         00C0026C0000C0023C0000C0083C0056D0012C0000C0016D3000000000000000

'uvhd' will be invaluable if you have files like this in your shop. If Indexed, 'listISF' will be handy to extract the front-end character portion (omitting the packed decimal fields) outputting to a text file which we can display/print with the usual Windows/DOS tools. Here are the 1st 80 bytes from the 1st 3 records extracted by listISF, and please see the full listISF demo on page 'E17'.

 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

E3. Test/Demo Vancouver Utilities for Windows/DOS

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-dsplay charcters......
         ...........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
 filename=C:/uvadm/dat1/custmas1 options=r256s2
 records=32 filesize=8192 recsize=256 fsize%rsize(remainder)=0
                      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                  ..4V|...
             4442222222222442535343222233323332333322222222222222222201357000
             9DF00000000002306931810000250D754D55310000000000000000000246C000
         128 .........W0....`........)X}..f3.....\.................4V}...f...
             0000000005300016000000002570063100095000000000000000013570016000
             0C0000C0270D0540C0000C0098D0263C0444C0000C0000C0000C0246D0056C00
         192 ...............................f.....<........f.C
             0000008900000000880000000018000680001300000000694222222222222222
             00C0026C0000C0023C0000C0083C0056D0012C0000C0016D3000000000000000

rec#=1 rcount=32 rsize=256 fsize=8192 dat1/custmas1 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 --> 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

E4. Test/Demo Vancouver Utilities for Windows/DOS

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. type tmp\s3     <-- display output file (should match following)
     ===========       - must use '\' on WinDos commands, but '/' OK above
 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. type tmp\s3     <-- display output file (should match following)
     ===========

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

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 edit, type, 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 'E14' in this document.

Note that 'uvcp' is similar to 'uvsort' but without the 'sort'. It has the same record selections, record reformatting, etc. Use uvcp whenever you need to copy a file with selections/modifications, but without sorting.

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

E5. Test/Demo Vancouver Utilities for Windows/DOS

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 'E1'.

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. type tmp\s3     <-- display output file (should match following)
     ===========       - must use backward slashes on Windows/DOS commands
 406082    35 020815 IN33001   BBQ001  00017- 0007001 00119017-
 223240    65 980816 IN441     BIT001  00029+ 0009001 00261029+
 139923    35 950802 IN111002  CHR001  00022+ 0002001 00044022+
 406082    65 020816 IN441     HAM001  00019- 0009001 00171019-
 400002    85 010812 CR245     HAX129  00016- 0006001 00096016-
 150825    44 960804 IN1122    PLN012  00026+ 0006001 00156026+
 308685    21 990812 IN6605    SAW001  00010- 0000001 00000010-
 315512    44 000805 IN2251    SAW051  00014- 0004001 00056014-
 130140    21 940802 IN111001  SCR012  00021+ 0001001 00021021+
 406082    35 020815 IN33001   TAB013  00018- 0008001 00144018-
 201120    44 970807 CR5234    WHIP75  00027+ 0007001 00189027+
 315512    44 000805 IN2255    WID115  00015- 0005001 00075015-

Compare this to the original on page 'E1' & 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. type 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

E6. Test/Demo Vancouver Utilities for Windows/DOS

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 'uvlpr12' (see below).


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

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

 uvlist filexx > LPT1               <-- redirect output to the printer
 ====================

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

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

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

uvlpr12 script (DOS batch file)

 @echo off
 rem uvlpr12 - print a text file at 12 cpi
 rem         - by OT march 2003
 rem         - batch file to run in DOS window under Windows95,98,NT,2000,XP
 rem         - ported from Unix/Linux Vancouver Utilities to Windos version
 rem
 uvlist %1 p60 c12 > LPT1

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

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

E6a. Test/Demo Vancouver Utilities for Windows/DOS

assign LPT1 to a network printer

The uvlist scripts for Windows/DOS (such as uvlpr12) redirect output to 'LPT1', which in the old days was a cable connected printer on a parallel or USB port. You can redirect LPT1 to a network printer with the following command (issued from a Windows/DOS command window).


 net use lpt1 \\computername\printername /persistent:yes
 =======================================================

For example, my computername was 'OWEN-PC' & I had configured a network printer named 'lexmarkT652' so my command was:


 net use lpt1 \\OWEN-PC\lexmarkT652 /persistent:yes
 ==================================================

I tested by using the uvlpr12 script to print itself:


 uvlpr12 batDOS/uvlpr12.bat
 ==========================
 @echo off
 rem uvlpr12.bat - print a text file at 12 cpi Portrait
 rem             - by OT March 2003
 rem - batch file to run in DOS window under Windows 7
 rem - ported from UNIX Vancouver utilties to Windows version
 rem May2013 - add sample 'net use LPT1 ...' for network printer
 rem         - enter following in Windows/DOS command window
 rem
 rem net use LPT1 \\OWEN-PC\lexmarkT652 /persistent:yes
 rem ==================================================
 rem
 rem uvlpr12 filename    <-- example
 rem ================
 rem
 uvlist %1 p60%2 c12%3 > LPT1
 rem

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

E7. Test/Demo Vancouver Utilities for Windows/DOS

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.

Please note that 'uvlp' identifies a Korn shell script & you can use these on Windows/DOS if you have the Korn shell for Windows/DOS (from https://www.mks.com or https://www.kornshell.com)

A few of these such as 'uvlpr12' have been recoded to run as DOS batch files.

uvlist Korn Shell scripts

uvlp
  • print Portrait at 10 cpi (76 chars on 8 1/2" wide)
uvlp12
  • print Portrait at 12 cpi (90 chars on 8 1/2" wide)
uvlp14
  • print Portrait at 14 cpi (108 chars on 8 1/2" wide)
uvlp16
  • print Portrait at 16 cpi (120 chars on 8 1/2" wide)
uvlp18
  • print Portrait at 18 cpi (134 chars on 8 1/2" wide)
uvlp18v7
  • print Portrait at 18 cpi across & 7 lpi down
    (134 chars across & 70 lines down on 8 1/2 portrait)
  • use to print COBOL reports on 8 1/2 x 11 Portrait Simplex
 uvLp     - print Landscape at 10 cpi (106 chars on 11" wide)
 uvlp12L   - print Landscape at 12 cpi (128 chars on 11" wide)
 uvlp14L   - print Landscape at 14 cpi (150 chars on 11" wide)
 uvlp16L   - print Landscape at 16 cpi (170 chars on 11" wide)
 uvlp14Lv8 - print Landscape at 14 cpi horizontal & 8 lpi vertical
            (for 150 chars across, 60 lines down, NO uvlist pg headings)
          - use to print COBOL reports Landscape on 8 1/2 x 11
uvlp12D
  • print Duplex at 12 cpi (Portrait on 8 1/2 x 11)
uVLp14v8
  • print Duplex & Landscape at 14 cpi across & 8 lpi down
  • use for COBOL reports portrait DUPLEX & LANDSCAPE

uvlist DOS batch files

uvlpr12
  • print Portrait at 12 cpi (90 chars on 8 1/2 wide)
uvlpL12
  • print Landscape at 12 cpi (128 chars on 11" wide)
Note
  • windows/dos is not case sensetive (as is unix), so we have changed
    our uvlist script naming conventions.
  • Prefix 'uvlpr' will indicate Portrait & 'uvlpL' will indicate Landscape.
  • Of course you can create your own variations as you see fit.

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

E8. Test/Demo Vancouver Utilities for Windows/DOS

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 'E1'.

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.  uvcopy sltbl1,fili1=dat1/sales2,filo1=tmp/sales2.rpt   <-- the hard way
      ====================================================
 #1a. uvcopy sltbl1   <-- the easy way (the I/O filenames default as above)
      =============     - will prompt for report disposition
      --> type        <-- reply with type, more, edit, etc, or null to end

 #3.  type tmp\sltbl1.rpt   <-- OR display file from DOS prompt
      ===================

sample output report

 sltbl1  2006/05/20_08:46:40  sales analysis by product# of quantity & amount
 tbl#001 pg#001     -argument-            -acum#1-    %        -acum#2-    %
 line#  count    %  product#             sales qty            sales amt
     1       2  10  BBQ001                      30   11        2,729.30   21
     2       1   5  CHR001                      22    8          440.22    3
     3       5  25  HAM001                      75   29        3,700.75   29
     4       2  10  HAX129                      27   10        1,656.27   13
     5       2  10  SAW051                       2                56.02
     6       1   5  SCR012                      21    8          210.21    1
     7       4  20  TAB013                      49   19        1,818.49   14
     8       3  15  WHIP75                      29   11        1,976.29   15
            20*100   *TOTAL*                  2.55 *100       12,587.55 *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

E9. Test/Demo Vancouver Utilities for Windows/DOS

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

 fili1=?dat1/sales2,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)
        tblt1f2 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    tbpt1s1 filo1,'sales analysis by product# of quantity & amount'
        cls     all
        msgwy   'display report y/n ? (stored in tmp/sltbl1.rpt)'
        skp!    1
        sysv1   'cat $filo1'          'cat' auto changed to 'type' for WIN/DOS
        eoj

Only 14 uvcopy instructions were required to create the report. All uvcopy instructions are documented in uvcopy3.htm. 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

E10. Test/Demo Vancouver Utilities for Windows/DOS

table2 - create summary reports from any file on any argument

This is a general purpose pre-programmed table analysis utility that will satisfy most of your need to quickly read thru files accumulating any 1 field by any 1 argument. 'table2' solicits a filename, a key field (table argument), & an amount/quantity field (table accumulator). It then reads thru the file & displays or prints the accumulated totals sorted & summarized to 1 line per unique key field value.

demo 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
Example #1
  • create a table summary of sales by product#
  • read demo sales file C:\uvadm\dat1\sales2
  • 64 byte records (see illustration above)
  • will read thru sales file, building a table in memory of
    sales amounts 53(9) by product# 30(6)
  1. cd C:\uvadm - change to Vancouver Utilities directory to run this demo


 2. uvcopy table2,fili1=dat1/sales2,uop=a30b6c53d9r64,filo1=tmp/sales2.tbl
    ======================================================================
           - the above would be the hard way, see easier way below

 2a. uvcopy table2   <-- You only need to enter/remember this much
     =============     - you will be prompted for filename & options
                       - filenames default as shown above (for this demo)

uop-> a30b6c53d9r64 <-- ENTER this at the options prompt (for dat1/sales2 demo)

sample output report

 table2  2006/07/10_12:45:00  Sales by Product#
 tbl#001 pg#001     -argument-            -acum#1-    %
 line#  count    %  argument            acum-field
     1       2  10  BBQ001                2,729.30   21
     2       1   5  CHR001                  440.22    3
     3       5  25  HAM001                3,700.75   29
     4       2  10  HAX129                1,656.27   13
     5       2  10  SAW051                   56.02
     6       1   5  SCR012                  210.21    1
     7       4  20  TAB013                1,818.49   14
     8       3  15  WHIP75                1,976.29   15
            20*100   *TOTAL*             12,587.55 *100

Please see more examples in TABLEjobs.htm.

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

E11. 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 'E2').


 uvcopy cobmap1,fili1=mf/cpys/sales3,filo1=mf/maps/sales3
 ========================================================

 uvcopy cobmap1           <-- just this will prompt you for filenames
 ==============

 type mf/maps/sales3   <-- display record layout created by cobmap1
 ===================
 cobmap1  start-end bytes for cobol record fields    200603291315  pg# 0001
 mf/cpys/sales3                                 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

E12. 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
 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
 44 401210    990816 CR955     HAM001  000080 0008000 000640000
 44 401210    990816 IN441     BIT001  000090 0009000 000810000

 uvqrpg qrpgEX1        <-- command to generate report (shown below)
 ==============

sample report created by qrpgEX1

 Sales Analysis by customer within salesman   1999/10/26_09:43:19 page0001
 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 CHR001        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

E13. 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

E14. 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 maintenance & 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.


 SET 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=IDX
  • Indexed Sequential Variable length records

These are the most common file types & relevant to the following exercises (please see uvcp.htm#H1 page H1 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=IDX here, see uvcp.htm#H3.

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

E15. 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 example on the next page --->


 #6. uvcopy listISF,fili1=tmp/s3   <-- utility to list any Indexed file
     ===========================     - creates text file in tmp subdir
     --> type          <-- may enter any command at prompt

 #7. type tmp/s3       <-- OR enter null at prompt & issue separate command
     ===========

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

E16. 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

D17. 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 'E3'. Note that we will use 'dat1\custmast', the indexed version of 'dat1\custmas1'.

                   1         2         3         4         5         6
         0123456789012345678901234567890123456789012345678901234567890123
       0 130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD          NANA
         3333332222454545444244545524542222233332445442544422222222224444
         130140000056527255E0DF4F230C44E0000181502F75E02F140000000000E1E1
      64 IMO          BC V9S1H1    604-754-5531                  ........
         4442222222222442535343222233323332333322222222222222222200000000
         9DF00000000002306931810000604D754D55310000000000000000000000C000
     128 .........W0....`........)X|..f3.....\.......................f...
         0000000005300016000000002570063100095000000000000000000000016000
         0C0000C0270C0540C0000C0098C0263C0444C0000C0000C0000C0000C0056C00
     192 ...............................f.....<........f.C
         0000008900000000880000000018000680001300000000694222222222222222
         00C0026C0000C0023C0000C0083C0056D0012C0000C0016D3000000000000000

 uvcopy listISF,fili1=dat1/custmast,rop=c10,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) ---> c10   <-- 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
 149304    POINT GREY GOLF & COUNTRY3350 S.W. MARINE DRIVE   VANCOUVER        BC
 150825    RIGGERS INDUSTRIAL       960 - 6TH AVENUE         HOPE             BC
 152355    SHAW, JOHN               477 CARIBOO CRES.        PORT COQUITLAM   BC
 154688    TAURUS RESOURCES         1110 - 625 HOWE STREET   VANCOUVER        BC

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

E18. 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).

For example, I wanted to update my 'doc' directory to add more references to 'LINUX' where ever I was discussing 'conversion' to 'UNIX'. Please try this procedure & see if your results include the sample results shown below.


 uvcopy scan1d,fild1=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 --> unix       <-- enter
 2nd qual, dflt absent, present(p2), null=disable --> linux      <-- enter
 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: doc  SEARCH: conversion  QUAL1: unix  QUAL2: linux
  SEARCHBGN:
 ====================================================== 2006/03/30_16:26:40
 00096 pf\IBM  - Mainframe to Unix conversion jobs
 00097         - supplied only with the Unix mainframe conversion package
 00744 The mainframe to unix conversions also use cobmap1 as the 1st step in
 01172                   3 hits @EOF: doc/WindowsDOS.doc
 00264 02.  Loading data from mainframe for conversion on Unix/Linux
 00358          ** #02 Loading data from mainframe for conversion on UNIX **
 02192                   2 hits @EOF: doc/SQLjobs.doc
 ====================================================== 2006/03/30_16:26:48
  EOD: 00209 hits in 0025 files of 0085 total (30353 lines)

I have only shown a few of the results, your results should be as shown above (209 hits in 25 files of 85 total). I could have used the 'rep2d' job to actually change 'Unix' to 'Unix and Linux' but in this case, it is obviously better to use the scan report to selectively modify depending on syntax. 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

E19. 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. type 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 - rep2.aud

 Job: rep2  InFile: dat1/sales3  OutFile: tmp/s3  Table: tf/rep2demo.tbl
 SearchBgn:    SearchEnd:    MatchOptns: dfg  UserOptns: q1a1b99999c0d256p1
 ====================================================== 2006/04/10_13:58:39
 HAM001~~~~~~~~~~~~~~~~~~~~~~~~HAM201~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 TAB013~~~~~~~~~~~~~~~~~~~~~~~~TAB213~~~~~~~~~~~~~~~~~~~~~~~~ 21 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 TAB013~~~~~~~~~~~~~~~~~~~~~~~~TAB313~~~~~~~~~~~~~~~~~~~~~~~~ 35 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ====================================================== 2006/04/10_13:58:39
 00001 130140    21 940802 IN111001  HAM201  00020+ 0000001 00000020+
 00004 139923    35 950802 IN111002  TAB313  00023+ 0003001 00069023+
 00005 139923    35 950807 CR5421    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 990812 CR8835    TAB213  00012- 0002001 00024012-
 00014 315512    44 000805 IN2251    HAM201  00013- 0003001 00039013-
 00019 406082    35 020815 IN33001   TAB313  00018- 0008001 00144018-
 00020 406082    65 020816 IN441     HAM201  00019- 0009001 00171019-
 ====================================================== 2006/04/10_13:58:39
 EOF: 00009 reps on 00000 lines of 00020 total line

Only the audit report (rep2.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

E20. Test/Demo Vancouver Utilities for Windows/DOS

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. type tmp\sales3a   <-- display outfile & confirm prod# changes
     ================       (via lookup table coded in job below)
 # prodfix1 - modify product#s via a lookup table
 #          - sample uvcopy demo
 #
 #usage: uvcopy prodfix1,fili1=dat1/sales3,filo1=tmp/sales3a
 #       ===================================================
 #
 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#
 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

E21. 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
tabfix2
  • convert tabs to blanks depending on tab value option & current column
  • tab value could be every 4 cols, 8 cols, or whatever
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. type tf\tabtest   - 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/tabtest t1h2  - use uvhd hexdump utility to see the tabs (x'09')
     ====================  - option t1 text file (records ended by LF x'0A')
                           - option 'h2' forces hexadecimal display
        --> enter null 9 times to advance to line #10 (with x'09' tabs)
                      10        20        30        40        50        60
     r#   10 0123456789012345678901234567890123456789012345678901234567890123
         530 a.bb.ccc.dddd.eeeee.ffffff.ggggggg.hhhhhh.
             60660666066660666660666666066666660666666660
             1922933394444955555966666697777777988888888A

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

 #4.  type tmp\tabfix1.tmp      - display output (note tabs converted to blanks)
      ====================      - but better to use uvhd (as shown in #5 below)

 #5.  uvhd tmp/tabfix1.tmp t1h2 - verify tabs x'09' to blanks x'20'
      ========================= - same options as #2 above & advance to line #10
                      10        20        30        40        50        60
      r#  10 0123456789012345678901234567890123456789012345678901234567890123
         526 a    bb    ccc    dddd    eeeee    ffffff    ggggggg    hhhhhh.
             622226622226662222666622226666622226666662222666666622226666660
             10000220000333000044440000555550000666666000077777770000888888A

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

E22. tabfix1 - convert tabs to blanks

tabfix1 - uvcopy job to convert tabs to 4 blanks

 # tabfix1 - convert tabs to 4 blanks (simplified version of pre-programmed job)
 #         - actual pf/util/tabfix1 allows option for 1 to 8 blanks
 #
 fili1=?tf/tabtest,typ=LST,rcs=a256
 filo1=?$jobname.tmp,typ=LSTt,rcs=b256
 @run
       opn   all
 # begin loop to copy records until EOF
 loop  get   fili1,a0(256)          get current record
       skp>  eof
       mvc   b0(256),a0             move input record to output area
 #---------------------------------
       rep   b0(256),x'09',c'    '  replace tabs with 4 blanks
 #---------------------------------
       put   filo1,b0(256)          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
 #---------------------------------------------------------------

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/tabtest t4i1h0p0 >tmp/tabtest
 =======================================

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

E23. More Pre-Programmed Jobs

Here are a few more of the many Pre-programmed jobs provided. These examples will use our 'sales3' test file, but please try substituting some of your own filenames.


 #1a. uvcopy tolower        - execute uvcopy with the 'tolower' prmfile
      ==============        - filenames will be solicited from operator
                             or you can enter on command line as shown below:

 #1b. uvcopy tolower,fili1=dat1/sales3,filo1=tmp/sales3L
      ==================================================
                            - demo test file provided (sales3 in UPPER case)

 #1c. type tmp\sales3L      - inspect output
      ================      - output can go in tmp subdir (cleaned periodically)

 #2a. uvcopy toupper,fili1=tmp/sales3L,filo1=tmp/sales3U
      ==================================================
                            - convert lower case to UPPER case

 #2b. type tmp\sales3U      - inspect output
      ================

 #3a. uvcopy toebcdic,fili1=dat1/sales3,filo1=tmp/sales3E
      ===================================================
                            - convert ASCII file to EBCDIC

 #3a. uvhd tmp/sales3E a    - display with uvhd editor in vertical hexadecimal
      ==================      (option 'a' shows character line in ASCII)

 #4a. uvcopy toascii,fili1=tmp/sales3E,filo1=tmp/sales3A
      ==================================================
                            - convert EBCDIC file to ASCII

 #4b. type tmp\sales3A      - inspect output
      ================

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

F1. Porting Vancouver Utilities to Windows/DOS

Download/Install MinGW compiler for Windows

"MinGW" is an abbreviation of "Minimal GNU for Windows". If you want to know what "GNU" is, see wikipedia.org/wiki/GNU. The package is a free download and includes C, C++, etc. Download & install (on Windows 7) as follows:

  1. use Internet browser download MinGW install archive

1a. goto website "MinGW.org"

1b. click "downloads" (on left side of home page)

1c. click "mingw-get-inst-20120426.exe"

1d. cleck "save" (to Downloads directory by default)

  1. use Windows Explorer to execute downloaded & saved MinGW install archive

2a. browse to Windows "Downloads" directory

2b. double click on "mingw-get-inst-20120426.exe"

By default MinGW is installed at C:\MinGW, containing subdirs: bin, doc, include, lib, libexec, mingw32, msys, share, var

  1. add C:\MinGW\bin to Windows environmental variable "PATH"

3a. ControlPanel -> System -> Advanced system settings

3b. Environmental Variables -> System variables.

3c. scroll down to "PATH" & click "edit" & append ";C:\MinGW\bin" (at end of long line begining with C:\Program Files...).


     C:\Program Files.........;C:\MinGW\bin
     ======================================

3d. click "OK" for edit & "OK" again for Environmental Variables

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

G1. Porting Vancouver Utilities from Unix/Linux to Windows/DOS

This section is probably more for my benefit than the customer's. It is not applicable to the Windows executables only customer. Customers who already have the Vancouver Utilities source code might be interested in these procedures if they wished to make some custom changes to Windows versions.

Directory setup on Windows system


 dtree uvadm   - display uvadm subdirs using 'dtree' (Korn shell script)
 ===========
 C:\uvadm
 :-----batDOS
 :-----binDOS
 :-----dat1
 :-----doc
 :-----dochtml
 :-----hdr
 :-----lib
 :-----pf
 :     :-----adm
 :     :-----demo
 :     :-----ibm
 :     :-----util
 :-----sf
 :     :-----adm
 :     :-----demo
 :     :-----ibm
 :     :-----util
 :-----src
 :-----srcf
 :-----tf
 :-----tmp
 :-----tmp1         <-- reqquired for compiles
 C:\MinGW           <-- MinGW Windows C compiler
 :-----bin,doc,include,lib,libexec,mingw32,msys,share,var
 C:\vim\vim73       <-- vim editor
 :-----vim

This is the directory structure as displayed by the 'dtree' Korn shell script. Please see descriptions on the next page --->

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

G2. Porting Vancouver Utilities from Unix/Linux to Windows/DOS

Windows/DOS Directory Descriptions

C:\uvadm
  • super directory containing following sub-directories
batDOS
  • batch files (scripts) for Windows/DOS
  • mgcc3.bat (compile script), uvlpr12.bat (print script), etc
src
  • Vancouver Utility C program source code
  • uvcopy.c,uvsort.c,uvlist.c,uvcp.c,uvhd.c,uvhdcob.c,uvqrpg.c
srcf
  • library function C source code
  • UVatol.c, UVgetput.c, UVstring.c, etc (29 subfunctions)
hdr
  • header files for Vancouver Utilities
pf\
  • parameter files for the uvcopy & uvqrpg interpreters
  • pf is sub-directoried by intended use as follows:
pf\adm
  • admin & testing jobs used at UVSI
pf\demo
  • demonstration/sample/training jobs for test files supplied
pf\util
  • general purpose jobs you can use with your own files
  • pre-programmed to solicit filenames, record sizes, options
pf\IBM
  • Mainframe to Unix conversion jobs
  • supplied only with the Unix mainframe conversion package
sf\
  • Korn shell scripts
  • sub-directoried by intended use (sf\adm, sf\demo, sf\util, sf\IBM)
  • see the Korn shell for windows at https://www.kornshell.com.
dat1
  • test files to demo Vancouver Utilities (mostly fixed length)
tf
  • test files to demo Vancouver Utilities (mostly text files)

output subdirs for MinGW gcc compiler,archiver,& linker

lib
  • library functions archived into 1 file by MinGW archiver 'ar'
  • uvlibDOS.a contains 32 commonly used UV functions
  • disamDOS.lib contains 50 D-ISAM functions
binDOS
  • executable programs stored here by mgcc1/2/3
  • uvcopy.exe,uvsort.exe,uvlist.exe,uvcp.exe,uvhd.exe,uvqrpg.exe

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

G3. Porting Vancouver Utilities from Unix/Linux to Windows/DOS

Until Dec 2011, Windows versions were compiled using the lcc-win32 compiler, which may be downloaded from https://www.cs.virginia.edu/~lcc-win32/ (or https://www.Q-Software-Solutions.com). The author is Jacob Navia (France). In Dec 2011, I switched to the MinGW 'gcc' compiler (see www.mingw.org).

We will run the MinGW compiles in a DOS window under Windows.

  1. gcc - the C compiler, compiles C source code to an object or executable
  2. ar - builds a library from multiple compiled object files
  3. ld - the linker, links multiple object&library files into an executable

    batDOS scripts provided by UVSI

The following Windows/DOS scripts (batch files) are provided by UV Software for compiling & linking the Windows/DOS versions of the Vancouver Utilities. Please see most of these scripts listed starting on page 'H1'.


 #1.  mgccsrcf.bat  - compile VU functions from srcf to lib/uvlibDOS.a
 #2.  mgccdisam.bat - compile DISAM functions from disam/wrap to lib/disamDOS.a
 #3.  mgcc1.bat     - compile & link any 1 UV program
 #4.  mgcc3.bat     - compile & link with uvlibDOS.a + disamDOS.a

Compiling & Building Libraries

Before we can compile the Vancouver Utility programs, we must compile some commonly used C functions & build libraries that are then linked with the Vancouver Utility compiled objects.

There are 2 libraries that must be built before we can compile our programs:

  1. uvlibDOS.a - library of 33 Vancouver Utility common functions
  2. disamDOS.a - library of 50 D-ISAM functions

    Compiling the UV library functions

  3. Compile VU common functions to object modules & archive (for later linking with UV programs)


    mgccsrcf H32    <-- compile 33 srcf files to lib\uvlibDOS.a
    ============      - see batDOS\mgccsrcf.bat listed on page 'H1'.

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

G4. Porting Vancouver Utilities from Unix/Linux to Windows/DOS

Compiling D-ISAM on Windows/DOS

D-ISAM is the indexed file handler used by the Vancouver Utilities for fixed length indexed files. It is compatible with C-ISAM and Micro Focus COBOL IDXFORMAT1. D-ISAM is supplied by Byte Designs https://www.bytedesigns.com. UV Software pays a royalty to Byte Designs on a per copy sold basis.

Note
  • This page is only for UV Software's documentation, since DISAM
    source is not included on the UV distributions.
  • DISAM is a proprietary package from https://www.bytedesigns.com
  • the disamDWIN.lib linkable archive is available to Unix/Linux customers
  • Windows/DOS UV programs have disamDWIN.lib linked into the executables.

The D-ISAM software was installed at C:\disam96 & included the following sub-directories: base, bin, decs, exam, head, lib, make, misc, read, sf, test, tmp, util,& wrap. The functions in subdir 'wrap' were compiled into subdir 'tmp1' & then the object files were combined into a linkable library using the MinGW archiver 'ar'


 1. mgccdisam   <-- script to compile 50 DISAM functions to subdir tmp1/...
    =========       & archive to lib/disamDOS.a (for linking with uvcopy,etc)

 2. copy C:\disam96\lib\disamDOS.a C:\uvadm\lib  <-- copy DISAM lib to uvadm
    ===========================================      to link with UV programs
Note
  • updated to disam7.2 in 2015

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

G5. Porting Vancouver Utilities from Unix/Linux to Windows/DOS

Compiling & Linking Vancouver Utility programs on WinDOS


 mgcc1/mgcc2/mgcc3 program H32/H64     <-- compile command format
 =================================

Use 'mgcc1' for self-contained programs (such as uvhd.c), use 'mgcc2' to link with VU subfunctions (uvlist.c), use 'mgcc3' to link VU subfunctions & the D-ISAM file handler.

H32
  • for C compilers which define 'long' as 32 bits & use 32 bit pointers
  • programs use 'long long' for 64 bit fields
H64
  • for C compilers which define 'long' as 64 bits & use 64 bit pointers
  • do NOT use H64, as of Dec 2012, MinGW gcc is a 32 bit compiler
  • but 64 bit integers are handled via 'long long'
    and Large files (> 2 gig) are handled via open64

 #1. mgcc1 uvhd H32
     ==============

 #2. mgcc1 uvhdcob H32
     =================

 #3. mgcc2 uvlist H32
     ================

 #4. mgcc3 uvcp H32
     ==============

 #5. mgcc3 uvsort H32
     ================

 #6. mgcc3 uvcopy H32
     ================

 #7. mgcc3 uvqrpg H32
     ================

Windows/DOS scripts (batch files) are provided to compile & link the Vancouver Utility programs with the UV library & the DISAM library which have been built as documented on the preceding pages.

Please see the 'mgcc3.bat' script listed on page 'H2' --->

Pages H1 & H2 list the Windows/DOS scripts (batch files) provided to compile & link the Vancouver Utility programs with the UV library & the DISAM library. The operating procedures have been documented on the preceding pages.

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

H1. Porting Vancouver Utilities from Unix/Linux to Windows/DOS

 rem mgccsrcf.bat - compile all subfunctions from srcf to tmp1
 rem                & archive to lib/uvlibDOS.a
 rem
 rem 1. cd C:\uvadm         - you must be in uvadm superdir
 rem 2. dir                 - relevant subdirs: srcf, hdr, lib
 rem 3. mgccsrcf H32/H64   <-- specify 32/64 bit longs & pointers
 rem    ================     - MinGW gcc not yet 64 bits as of Dec2011
 echo "mgccsrcf - compile all subfunctions from srcf to lib/uvlibDOS.a"
 if "%1" == "H32" goto process
 if "%1" == "H64" goto process
 :error
    echo "usage: mgccsrcf H32/H64"
    echo "       ==============="
    echo " - arg1 must be H32/H64 32/64 bit longs & pointers"
    goto end
 :process
 echo " - will delete old lib\uvlibDOS.a & clear tmp1/* for gcc & ar"
 del tmp1\*.*
 gcc -c -DDWIN -Ihdr srcf/asc2ebc2.c   -otmp1/asc2ebc2.o
 gcc -c -DDWIN -Ihdr srcf/asc2ebc.c    -otmp1/asc2ebc.o
 gcc -c -DDWIN -Ihdr srcf/ebc1141asc.c -otmp1/ebc1141asc.o
 gcc -c -DDWIN -Ihdr srcf/ebc2asc.c    -otmp1/ebc2asc.o
 gcc -c -DDWIN -Ihdr srcf/EBs2MBs.c    -otmp1/EBs2MBs.o
 gcc -c -DDWIN -Ihdr srcf/EBs2MFs.c    -otmp1/EBs2MFs.o
 gcc -c -DDWIN -Ihdr srcf/errmsg.c     -otmp1/errmsg.o
 gcc -c -DDWIN -Ihdr srcf/getdt.c      -otmp1/getdt.o
 gcc -c -DDWIN -Ihdr srcf/getid.c      -otmp1/getid.o
 gcc -c -DDWIN -Ihdr srcf/initfat.c    -otmp1/initfat.o
 gcc -c -DDWIN -Ihdr srcf/showhelp.c   -otmp1/showhelp.o
 gcc -c -DDWIN -Ihdr srcf/sortops4.c   -otmp1/sortops4.o
 gcc -c -DDWIN -Ihdr srcf/sortops.c    -otmp1/sortops.o
 gcc -c -DDWIN -Ihdr srcf/stoprun.c    -otmp1/stoprun.o
 gcc -c -DDWIN -Ihdr srcf/trtdb2g.c    -otmp1/trtdb2g.o
 gcc -c -DDWIN -Ihdr srcf/trtneut.c    -otmp1/trtneut.o
 gcc -c -DDWIN -Ihdr srcf/trtprint.c   -otmp1/trtprint.o
 gcc -c -DDWIN -Ihdr srcf/trtprintE.c  -otmp1/trtprintE.o
 gcc -c -DDWIN -Ihdr srcf/trtsscom.c   -otmp1/trtsscom.o
 gcc -c -DDWIN -Ihdr srcf/uio.c        -otmp1/uio.o
 gcc -c -DDWIN -Ihdr srcf/usocall.c    -otmp1/usocall.o
 gcc -c -DDWIN -Ihdr srcf/usomakey.c   -otmp1/usomakey.o
 gcc -c -DDWIN -Ihdr srcf/usomerge.c   -otmp1/usomerge.o
 gcc -c -DDWIN -Ihdr srcf/usoqsort.c   -otmp1/usoqsort.o
 gcc -c -DDWIN -Ihdr srcf/UVatol.c     -otmp1/UVatol.o
 gcc -c -DDWIN -Ihdr srcf/UVgetput.c   -otmp1/UVgetput.o
 gcc -c -DDWIN -Ihdr srcf/UVhexcnv.c   -otmp1/UVhexcnv.o
 gcc -c -DDWIN -Ihdr srcf/UVstring.c   -otmp1/UVstring.o
 gcc -c -DDWIN -Ihdr srcf/uvsubxxa.c   -otmp1/uvsubxxa.o
 gcc -c -DDWIN -Ihdr srcf/uvsubxxb.c   -otmp1/uvsubxxb.o
 gcc -c -DDWIN -Ihdr srcf/uvsubxxc.c   -otmp1/uvsubxxc.o
 gcc -c -DDWIN -Ihdr srcf/UVtime.c     -otmp1/UVtime.o
 gcc -c -DDWIN -Ihdr srcf/UVtran.c     -otmp1/UVtran.o
 echo "- delete old lib/uvlibDOS.a & build new"
 del lib\uvlibDOS.a
 ar r lib/uvlibDOS.a tmp1/*.o
 :end

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

H2. Porting Vancouver Utilities from Unix/Linux to Windows/DOS

mgcc1.bat - compile UV program w/o subfunctions

 @echo off
 rem mgcc1.bat - compile & link UV program NOT requiring subfunctions
 rem           - use this for uvhd, uvhdcob (not uvcopy,uvsort,etc)
 rem           - compiles & links from src to bin
 rem
 rem 1. cd C:\uvadm             - you must be in uvadm superdir
 rem 2. dir                     - relevant subdirs: src,hdr,lib,binDOS,batDOS
 rem    mgcc1 uvcopy H32/H64    - format (.c extension added by script)
 rem    ====================
 rem 3. mgcc1 uvcopy H32        - 64 bit ints via "long long"
 rem    ================        - MinGW gcc not yet 64 bits as of Dec2011
 rem
 if not exist  src\"%1.c" goto error
 if "%2" == "H32" goto process
 if "%2" == "H64" goto process
 :error
    echo "usage: mgcc1 program H32/H64"
    echo "       ====================="
    echo " - arg1 must be a file within subdir 'src' (omit .c extension)"
    echo " - arg2 must be H32/H64 (longs/ptrs 32 or 64 bits)"
    goto end
 :process
 gcc -DDWIN -D%2 -Ihdr src/%1.c -obinDOS/%1.exe
 :end

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

H3. Porting Vancouver Utilities from Unix/Linux to Windows/DOS

mgcc3.bat - compile any 1 UV programs

 @echo off
 rem mgcc3.bat - compile & link any 1 UV program with D-ISAM handler
 rem           - using MinGW vs lcc (Dec02/11)
 rem           - compiles & links from src to bin
 rem
 rem 1. cd C:\uvadm             - you must be in uvadm superdir
 rem 2. dir                     - relevant subdirs: src,hdr,lib,binDOS,batDOS
 rem    mgcc3 uvcopy H32/H64    - format (.c extension added by script)
 rem    ====================
 rem 3. mgcc3 uvcopy H32        - 64 bit ints via "long long"
 rem    ================        - MinGW gcc not yet 64 bits as of Dec2011
 rem
 if not exist  src\"%1.c" goto error
 if "%2" == "H32" goto process
 if "%2" == "H64" goto process
 :error
    echo "usage: mgcc3 program H32/H64"
    echo "       ============================="
    echo " - arg1 must be a file within subdir 'src' (omit .c extension)"
    echo " - arg2 must be H32/H64 (longs/ptrs 32 or 64 bits)"
    goto end
 :process
 gcc -DDWIN -D%2 -Ihdr src/%1.c lib/uvlibDOS.a lib/disamDOS.a -obinDOS/%1.exe
 :end

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

I1. Porting Vancouver Utilities from Unix/Linux to Windows/DOS

Summarized Porting Instructions

This is mostly for Owen's benefit when he refreshes the Windows version of Vancouver Utilities from Linux (considered the master copy).

on the Linux system


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

 #2. zip -r uvadm.zip *     - create zip archive

on the Windows system


 #1. deltree C:\uvadm.old   - remove any grandfather version

 #2. move C:\uvadm C:\uvadm.old - save current as old

 #3. mkdir C:\uvadm         - make new directory

 #4. cd C:\uvadm            - change into new dir

 #5.  ftp 192.168.0.4       - FTP to Linux system
 #5a. uvadm & *******       - login as uvadm & enter password
 #5b. binary                - ensure binary transfer
 #5c. get uvadm.zip         - get file from Linux

 #6. winzip                 - can unzip using Windows WinZip
                             (use Windows GUI procedures)

 #7. del binDOS\*           - remove old windows .exe programs

 #9. mgccsrcf H32           - compile subfunctions from srcf to lib/uvlibDOS.a

 #11a. mgcc1 uvhd    H32   - compile utility programs
 #11b. mgcc1 uvhdcob H32
 #11c. mgcc2 uvlist  H32
 #11d. mgcc3 uvcopy  H32
 #11e. mgcc3 uvqrpg  H32
 #11f. mgcc3 uvsort  H32
 #11g. mgcc3 uvcp    H32

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

J1. TESTING the Vancouver Utility programs

C program to test 64 bit integers

A C program & a uvcopy job are supplied to test 64 bit integers. Please see program listings, operating instructions, & expected outputs on pages Q1 to Q4 of TestDemo.htm#Q1. Here are the operating instructions & expected output for the C program.


 mgcc1 test64c H32      <-- compile test64c.c program
 =================        - if you have the MinGW 'gcc' windows C compiler
                          - else use the 'uvcopy' version below (precompiled)

 binDOS/test64c.exe       <-- execute
 ==================         - expected results 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
      - - - - following entries would be garbage if 64 bit not working - - - -
       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 would be garbage if 64 bit software not working

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

K1. TESTING the Vancouver Utility programs

uvcopy jobs to test 64 bit integers

'testint1' & 'testin2' are uvcopy jobs to test uvcopy processing of 32 & 64 bit integers. This processing depends on how you compiled uvcopy. '#0' below compiles on a Windows system in 64 bit mode (using the 'gcc' compiler).

Note
  • you dont need to compile the programs (such as uvcopy)
  • precompiled programs are supplied in 'binDOS'
  • you could compile only if you have a Windows compiler
  • UV Software uses the MinGW gcc compiler

 #0. mgcc3 uvcopy H32      - compile with 32 bit 'long's & 32 bit 'pointer's
     ================      - 64 bit integers provided by 'long long'
Note
  • compiling with H32 provides 64 bit accumulators
  • because 'long long's are used for large integers
  • ie: 64 bit integers provided by software vs hardware

 #1. uvcopy testint1   <-- execute uvcopy job 'testint1'
     ===============     - display output via 'more'

<-- See testint1 output on prior page (same as for C program 'test64c')


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

See testint2 output listed on the next page --->

You can see more expected outputs for both 32 & 64 bits listed on pages Q1 & Q2 of TestDemo.htm#Q1.

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

K2. TESTING the Vancouver Utility programs

Expected output from 'uvcopy testint2'

 # Date=20060131, Machine=LNX, Bits=64
 cycle      decimal-value  hex native        hex swapped
 01  00000000000000000001  0100000000000000  0000000000000001
 02  00000000000000000002  0200000000000000  0000000000000002
 03  00000000000000000004  0400000000000000  0000000000000004
 04  00000000000000000008  0800000000000000  0000000000000008
 05  00000000000000000016  1000000000000000  0000000000000010
 06  00000000000000000032  2000000000000000  0000000000000020
 07  00000000000000000064  4000000000000000  0000000000000040
 08  00000000000000000128  8000000000000000  0000000000000080
 09  00000000000000000256  0001000000000000  0000000000000100
 10  00000000000000000512  0002000000000000  0000000000000200
 11  00000000000000001024  0004000000000000  0000000000000400
 12  00000000000000002048  0008000000000000  0000000000000800
 13  00000000000000004096  0010000000000000  0000000000001000
 14  00000000000000008192  0020000000000000  0000000000002000
 15  00000000000000016384  0040000000000000  0000000000004000
 16  00000000000000032768  0080000000000000  0000000000008000
 17  00000000000000065536  0000010000000000  0000000000010000
 18  00000000000000131072  0000020000000000  0000000000020000
 19  00000000000000262144  0000040000000000  0000000000040000
 20  00000000000000524288  0000080000000000  0000000000080000
 21  00000000000001048576  0000100000000000  0000000000100000
 22  00000000000002097152  0000200000000000  0000000000200000
 23  00000000000004194304  0000400000000000  0000000000400000
 24  00000000000008388608  0000800000000000  0000000000800000
 25  00000000000016777216  0000000100000000  0000000001000000
 26  00000000000033554432  0000000200000000  0000000002000000
 27  00000000000067108864  0000000400000000  0000000004000000
 28  00000000000134217728  0000000800000000  0000000008000000
 29  00000000000268435456  0000001000000000  0000000010000000
 30  00000000000536870912  0000002000000000  0000000020000000
 31  00000000001073741824  0000004000000000  0000000040000000
 32  00000000002147483648  0000008000000000  0000000080000000
 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
 65  00000000000000000000  0000000000000000  0000000000000000

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

Visitor Counters for ThisYear and LastYear