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
Note |
|
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
============================================================================ 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
Class A |
|
Class B |
|
Class C |
|
uvadm.tar |
|
uvadm.zip |
|
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:
bin |
|
binDOS |
|
binSFU |
|
binCYGWIN |
|
binUWIN |
|
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
The Windows/DOS version of Vancouver Utilities is supplied in a zip file archive (uvadm.zip) containing the following directories:
binDOS |
|
batDOS |
|
bin |
|
binCYGWIN |
|
binUWIN |
|
pf\ |
|
pf\adm |
|
pf\demo |
|
pf\util |
|
pf\IBM |
|
sf\ |
|
tf |
|
dat1 |
|
doc |
|
dochtml |
|
tmp |
|
Goto: Begin this document , End this document , UVSI Home-Page
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
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 ===============
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
#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) ===============
#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 |
|
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
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.
#3a. Startin --> C:\uvadm #3b. Run --> Normal Window (choices: Normal, Minimized, Maximized)
#4a. Screen buffer size Width --> 120 #4b. Screen buffer size Height --> 300 #4c. Window size Width ---------> 120 #4d. Window size Height ---------> 55
#5a. Screen background --> dark blue #5b. Screen foreground --> bright yellow
Note |
|
Goto: Begin this document , End this document , UVSI Home-Page
"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:
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)
2a. browse to Windows "Downloads" directory
2b. double click on "gvim73_46.exe"
2c. Install at C:\vim (vs default C:\Program Files....)
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
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.
#1,2,3. Settings --> apps --> Programs & Features
#4. Turn Windows Features on/off
#5,6. select Windows Subsystem for Linux & OK
#7. Restart now
#1. open Microsoft store
#2,3. Search for Ubuntu & select
#4. Get/Install
#5. Launch
#6,7,8. Create Username & password
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
Goto: Begin this document , End this document , UVSI Home-Page
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) \...
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 |
|
Goto: Begin this document , End this document , UVSI Home-Page
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
#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
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 |
#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
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.
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
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
'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
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
'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
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
@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
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
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.
uvlp |
|
uvlp12 |
|
uvlp14 |
|
uvlp16 |
|
uvlp18 |
|
uvlp18v7 |
|
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 |
|
uVLp14v8 |
|
uvlpr12 |
|
uvlpL12 |
|
Note |
|
Goto: Begin this document , End this document , UVSI Home-Page
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'.
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 ===================
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
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:
Goto: Begin this document , End this document , UVSI Home-Page
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.
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 |
|
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)
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
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.
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
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) ==============
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
# 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.
Please see more examples in uvqrpg.htm.
Goto: Begin this document , End this document , UVSI Home-Page
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 ================
typ=RSF |
|
typ=RST |
|
typ=LST |
|
typ=ISF |
|
typ=IDX |
|
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
#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
#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) =================
#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
'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
'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
'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 |
|
cols 031-060 |
|
cols 061-080 |
|
cols 031-060 |
|
#1. type tf\rep2demo.tbl <-- inspect search/replace table ====================
Note |
|
#2. uvcopy rep2,fili1=dat1/sales3,filo1=tmp/s3,fili2=tf/rep2demo.tbl <--run demo ================================================================
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
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
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 |
|
tabfix2 |
|
tabfix3 |
|
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
# 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 #---------------------------------------------------------------
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 |
|
u1-u9 |
|
c1 |
|
d1 |
|
d2 |
|
f1 |
|
w1 |
|
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
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
"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:
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)
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
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
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.
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
C:\uvadm |
|
batDOS |
|
src |
|
srcf |
|
hdr |
|
pf\ |
|
pf\adm |
|
pf\demo |
|
pf\util |
|
pf\IBM |
|
sf\ |
|
dat1 |
|
tf |
|
lib |
|
binDOS |
|
Goto: Begin this document , End this document , UVSI Home-Page
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.
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
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:
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
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 |
|
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 |
|
Goto: Begin this document , End this document , UVSI Home-Page
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 |
|
H64 |
|
#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
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
@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
@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
This is mostly for Owen's benefit when he refreshes the Windows version of Vancouver Utilities from Linux (considered the master copy).
#1. login uvadm --> /home/uvadm
#2. zip -r uvadm.zip * - create zip archive
#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
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 |
|
Goto: Begin this document , End this document , UVSI Home-Page
'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 |
|
#0. mgcc3 uvcopy H32 - compile with 32 bit 'long's & 32 bit 'pointer's ================ - 64 bit integers provided by 'long long'
Note |
|
#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
# 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