UVtools.doc - Contents by Part#


Part_0 Introduction, Overview, Intended Audience
- intended for any Unix/Linux user (vs mainframe conversion users)
- demo Vancouver Utility capabilities far beyond unix/linux system utilities
- Pre-Requisites to run the UVtools tutorials

Part_1 Installing Vancouver utilities, setup uvadm & appsadm admin accounts
- setup user profiles to execute Vancouver Utilities

Part_2 Basic Vancouver Utilities are uvhd,uvsort,uvcp,& uvlist (vs uvcopy)
Brief descriptions of uvhd,uvsort,uvcp,& uvlist, followed by tutorials
illustrating how they might help you solve your data problems.
uvhd demo - investigating problem files, CR's in scripts, removing
uvhd demo - converting French accented characters (UTF-8) to unaccented
uvcp demo - converting EBCDIC files to ASCII

Part_4 'table3d' create table summary counts of desired items in text files
- pre-programmed job using uvcopy (powerful data manipulation utility)
- scan all files in directory building table statistics to dump at EOF
- examples - counts of IP#s, Userids, Passwords in FTP scripts

Part_5 Search/replace pre-programmed jobs
scan1d - scan all files in a directory for 1 pattern
- may qualify with 2 other patterns that may or may not be present
rep1d - search all files in directory, replacing 1 pattern with an alternate
  while copying to a 2nd directory
- may qualify with 2 other patterns that may or may not be present
rep2d - search all files in directory, replacing using a search/replace table
  with unlimited number of search & replacement strings
- may qualify search/replaces with 1 present & 1 absent

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

Part_0 UVtools.doc - Vancouver Utilities for any Unix/Linux user

Introduction & Overview

This document is intended to make you aware of the most useful utilities supplied in the Vancouver Utilities package. You can run various tutorials using pre-programmed jobs with supplied test data files.

We will illustrate Vancouver Utility capabilities that are not possible with the standard unix/linux system utilities & we hope you can see how these capabilities could apply to your particular data processing projects.

These utilities are 'GENERAL PURPOSE' - they can be used with any data-file & can process all files in a directory. For our demos, we will use files such as FTP scripts, SQL scripts,& JCL, but we hope you can realize how these utilities could apply to your files (data, scripts,& programming languages).

We will minimize using JCL as testdata (often used in mainframe conversion demos). We will maximize the use testdata such as FTP & SQL scripts, which are familiar to most data processing professionals.

The intention here is to give you a short (1 or 2 page) introduction to the various utilities available, and then give you a link to the complete documentation which could be in various other books.

If you have a problem with your files & are wondering how it could be solved with Vancouver Utilities, we invite you to email us, explain the problem, and we will help you solve it (as our time allows).

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

Part_1 UVtools.doc - Vancouver Utilities for any Unix/Linux user

Part 1 - Contents


1A1. Install Vancouver Utilities (if not already installed)

1A2. Vancouver Utility Administrator home directory /home/uvadm
- directories & contents nriefly described

1A3. Install Vancouver Utilities (if not already installed)

1B1. Setup user logins and/or modifying profiles to execute Vancouver Utilities
- user profiles call the common_profile stored in /home/appsadm/env/...

1B2. .bash_profile for userxx

1B3. common_profile_abc for VU users

1B4. Advantages of stub_profile,& common_profile

1C1. setup userxx account to run demos

1C2. copy demo files to your $HOME/demo/...

1D1. demo/dat1/... - DATA files
1D2. demo/parms/... - FTP scripts (4 short samples)
1D3. demo/sqls/... - SQL scripts (8 short samples)
1D4. demo/sf/... - bash scripts (llsx & llsy)
demo/pf/... - uvcopy jobs (removeCR_uvcopy)
1D5. demo/jcl2/... - JCL (just 1 of 6 samples listed)

1A1. Install Vancouver Utilities

Before you can begin these Vancouver Utility UVtools tutorials, you must install the package as documented at www.uvsoftware.ca/install.htm. Here are the more imprtant pages:

Page B2
  • setup Vancouver Utilities administrator account
  • commonly /home/uvadm but could be elsewhere & export UV=location
Page B3
  • Download Vancouver Utilities with login & password supplied & unzip
Page B4
  • setup appsadm account to hold the common_profile called by user profiles
  • so not lost when new versions of Vancouver Utilities installed
Page C1
  • compile the Vancouver Utility C programs

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

1A2. UVtools.doc - Vancouver Utilities for any Unix/Linux user

Vancouver Utilities homedir contents

 /home/uvadm
 :-----bin             <-- binaries (uvcopy,uvsort,uvcp,uvhd,uvlist,etc)
 :-----ctl               - control files for various purposes
 :-----dat1              - test data files to demo various Vancouver Utilities`
 :-----doc               - Vancouver Utilities documentation (text)
 :-----dochtml           - documentation in HTML (same as on www.uvsoftware.ca)
 :-----env             <-- profiles for users, PATHs to utilities & other software
 :-----hdr               - hdr files for C compiles
 :-----htmlcode          - merged into dochtml when text converted to HTML
 :-----lib               - libraries for C compiles (subfunctions,DISAM,etc)
 :-----mvstest           - test/demos for MVS JCL/COBOL MainFrame conversions
 :-----mf              <-- small versions of MainFrame testdata files
 :-----pf              <-- Parameter Files for uvcopy & uvqrpg
 :     :-----adm         - administrative jobs
 :     :-----demo        - demo jobs
 :     :-----IBM         - IBM mainframe conversion jobs
 :     :-----util        - utility jobs
 :-----sf              <-- Script Files
 :     :-----adm         - administrative scripts
 :     :-----demo        - demo scripts
 :     :-----IBM         - IBM mainframe conversion scripts
 :     :-----util        - utility scripts
 :-----sfun              - ksh functions used in converted JCL/scripts
 :-----src             <-- Vancouver Utilities C source code
 :-----srcf              - C source for various sub-functions
 :-----tf                - test files for various examples in doc
 :-----tmp               - tmp subdir (test/demo outputs)
 :-----vsetest           - test/demos for VSE JCL/COBOL MainFrame conversions

Note that the uvadm subdirs for 'sf' (Script Files) & 'pf' (uvcopy Parameter Files or uvcopy jobs) are further sub-directoried as shown above.


Note - see http://uvsoftwre.ca/intall.htm to Install Vancouver Utilities
- see a brief summary on the next page

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

1A3. UVtools.doc - Installing Vancouver Utilities

Before you can run the UVtools tutorials, you must install the Vancouver Utilities (if not already installed). See instructions at http://uvsoftwre.ca/intall.htm, but here is a brief summary.

Installing Vancouver Utilities - Summary

  1. Setup user account 'uvadm' to serve as Vancouver Utilities administrator. Usual home directory is /home/uvadm, but could be elsewhere if you change the environmental variable 'export UV=/home/uvadm' in the common_profile.

  2. We have suggested setting up group 'apps' for uvadm & other users who will be working with Vancouver Utilities.

  3. Download the Vancouver Utilities from the UV Software website into the uvadm home directory,& unzip or untar (from archives uvadm.zip or uvadm.tar.gz). To download the complete package, you will need a userid & passwword from UV Software, but some programs are free (such as 'uvhd').

  4. You may need to modify the profiles as required for your site. We recommend setting up user 'appsadm' to store your modified versions of the profiles, so you do not lose them if you install a new version of Vancouver Utiltities.

  5. Setup user 'appsadm' & copy /home/uvadm/env/* to /home/appsadm/env Then modify .profiles or .bash_profiles to call the common_profile from /home/appsadm/env/common_profile. See short versions of the stub_profile & common_profile listed on pages '1B2' & '1B3'. The stub_profiles (in user homedirs) calls the common_profile via '.'

  6. Setting up appsadm to store the common_profile is vital if you have multiple users, but could be eliminated if you are installing VU only for yourself. You could then call the common_profile from $UV/env/common_profile, rather than from $APPSADM/env/common_profile, & have backup for your $UV/env/common_profile when you install new versions of Vancouver Utilities.

  7. The C source utility programs are stored in $UV/src & are compiled into $UV/bin. The binaries delivered may or may not work on your Linux version (compile if required).

See complete install & compile instructions at http://uvsoftware.ca/install.htm.

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

1B1. 'profiles' provided in /home/uvadm/env

'profiles' provided in /home/uvadm/env

 /home/uvadm/env         <-- profiles provided here
 :-----stub_profile_uv     - copy/rename to .profile (ksh) or .bash_profile (bash)
 :                         - defines RUNLIBS/RUNDATA for programmers & operators
 :-----common_profile_uv <-- common profile (called by stub_profile)
 :                         - defines PATH's etc using $RUNLIBS/$RUNDATA
 /home/appsadm/env       <-- setup user 'appsadm' & copy from /home/uvadm/env/*
 :-----stub_profile_ABC    - customize & copy to homedirs .profile or .bash_profile
 :-----common_profile_ABC  - common profile (called by stub_profile)

We recommend setting up an application administrator 'appsadm', copying /home/uvadm/env/* to /home/appsadm/env, and customizing the profiles there depending on the site locations of libraries & data.

Do NOT customize profiles in /home/uvadm/env/... because they would be overwritten when a new version of Vancouver Utilities is installed.

We recommend the concept of 'stub' & 'common' profiles. The shell profile in each user's homedir is a 'stub' that calls 'common_profile' which are stored in /home/appsadm/env/...

  1. The supplied 'stub_profile' is copied to homedirs, renamed as '.bash_profile' for bash shell (Linux) & '.profile' for Korn shell (Unix), and then modified depending on whether the user is a programmer or operator. - defines RUNLIBS as testlibs for programmers OR prodlibs for operators - defines RUNDATA as testdata for programmers OR proddata for operators

  2. 'common_profile' then defines the 'PATH's using $RUNLIBS,$COBDIR,$UV,etc For example: export PATH=$PATH:$RUNLIBS/jcls (converted JCL/scripts). Defines software superdirs (uvadm, COBDIR, ORACLE_BASE, ORACLE_HOME, etc)

  3. '$RUNDATA' determines data-file locations indirectly as follows: $RUNDATA defines the superdir housing all data-files.

Note that stub profiles must call 'common_profile' using '.' (dot execution), which means the 'export's made in the common_profile will still be effective on return to the users profile.

This system is a big advantage for any site with multiple users, it means the sysadmin can update common_profile once in 1 place & those changes are effective for all users.

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

1B2. 'profiles' provided in /home/uvadm/env

.bash_profile for userxx

Here is a stripped down version of /home/uvadm/env/stub_profile_uv

 # stub_profile_uv - stub_profile for Vancouver Utilities
 #                 - stub_profile calls 'common_profile'
 #
 # common_profile & stub_profile - distributed in $UV/env/...
 # - copy to $APPSADM/env/... (/home/appsadm/env/...) & modify for your site
 # - do not modify profiles in $UV because new versions of uvadm would overwrite
 # - see more at www.uvsoftware.ca/install.htm
 #
 # stub_profile defines $RUNLIBS & $RUNDATA for common_profile,
 # - which uses them to define PATHs to libraries & data
 #
 export RUNLIBS=$HOME/testlibs  # superdir for libraries
 export RUNDATA=$HOME/testdata  # superdir for datafiles
 #
 echo "Vancouver Utility profile"
 echo "HOSTNAME=$HOSTNAME LoginUser=$LOGNAME"
 echo "RUNLIBS=$RUNLIBS RUNDATA=$RUNDATA"
 #
 . /home/appsadm/env/common_profile_uv  # CHANGED to "appsadm" when profiles copied
 #====================================  # from uvadm/env/ to appsadm/env/
 #
 # - after uvadm install, you should setup appsadm & store env/profiles there
 # - then all user profiles should call common_profile from /home/appsadm/env/...
 # - prevents loss of customized common_profile when new version uvadm installed
 #
 #       ** misc items that user may need to override common_profile defs **
 # export TERM=linux       # TERM - modify depending on your terminal
 # stty erase '^?'         # erase char - modify depending on your terminal
 # stty intr '^C'          # interrupt ^C, (probably already default ?)
 # export UVLPDEST="-dlp0" # default destination for uvlp(uvlist) scripts
 #                         # change to a printer near you & un-comment
 #
 #                       ** user aliases, etc **
 # alias l='ls -l'         # save keystrokes on very often used commands
 # - see common_profile for several more aliases
 # - add more here depending on user preferences

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

1B3. 'profiles' provided in /home/uvadm/env

common_profile_abc for VU users

Here is a stripped down version of /home/uvadm/env/common_profile_uv

 # common_profile_abc - for users of Vancouver Utilities,COBOL,etc
 #                    - by Owen Townsend, UV Software, Dec 2017
 # - distributed in $UV/env/common_profile_uv
 # - copied/renamed to $APPSADM/env/common_profile_abc for execution by user profiles
 # - see more at www.uvsoftware.ca/install.htm & www.uvsoftware.ca/admjobs.htm
 #
 # common_profile_?? - defines search PATHs based on $RUNLIBS & $RUNDATA
 #                     which must be defined in user's .bash_profile
 #                     before calling this commmon_profile
 #
 # stub_profile_?? - copied to user homedirs & renamed as .profile or .bash_profile
 #                 - defines RUNLIBS & RUNDATA before calling common_profile
 #                 - stub_profile distributed in $UV/env contains following:
 #  export RUNLIBS=$HOME/testlibs
 #  export RUNDATA=$HOME/testdata
 #
 #  . /home/appsadm/env/common_profile_?? #<-- must '.' execute common_profile
 #  =====================================    - store common_profile in appsadm/env
 #
 #Note - profiles distributed in $UV/env/... (usually /home/uvadm/env/...)
 #     - should setup user 'appsadm' & copy $UV/env/... to $APPSADM/env/...
 #     - then change stub_profiles to call common_profile from $APPSADM/env/...
 #       (so you will not lose your changes to profiles when new uvadm installed)
 #
 #                  ** begin code for common_profile **
 #
 export UV=/home/uvadm           # UV homedir symbol used below
 export APPSADM=/home/appsadm    # site applications administrator
 export LOGDIR=$APPSADM          # console logging subdirs log1,log2,log3
 #
 # setup PATH for Vancouver Utilities programs & scripts (uvadm & appsadm)
 # - append onto system PATH, using symbols defined above ($UV, $APPSADM, etc)
 export PATH=$PATH:$HOME/bin:$HOME/sf:$APPSADM/bin:$APPSADM/sf:$RUNLIBS/sf
 export PATH=$PATH:$UV/bin:$UV/sf/adm:$UV/sf/demo:$UV/sf/util:$UV/sf/IBM
 export PATH=$PATH:$UV/help
 export PATH=$PATH:/usr/sbin   # add system dir for sendmail, etc
 #
 # setup 'PFPATH' for uvcopy & uvqrpg interpreter to find Parameter Files (jobs)
 export PFPATH=$RUNLIBS/pf,$CNVDATA/pfx3,$RUNLIBS/ezts,$HOME/pf,$APPSADM/pf
 export PFPATH=$PFPATH,$UV/pf/adm,$UV/pf/demo,$UV/pf/util,$UV/pf/IBM
 # - uvcopy accepts ',' delimiters as well as ':' in case of SFU on Windows
 #

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

 #                 ** UV Recommended items **
 umask 002                     # permissions 775 dirs, 664 files
 trm=$(tty)                    # capture terminal device for PS1
 export trmv=${trm#/dev/}      # remove prefix /dev/
 export HOSTNAME               # should already be set
 export HOST1=${HOSTNAME%%.*}  # extract 1st segment of $HOSTNAME
 export PS1='<@$HOST1:$LOGNAME:$PWD> '
 export EDITOR=vi              # for Korn shell history
 export VISUAL=vi              # for Korn shell history
 export HISTSIZE=5000;         # Korn shell history file size
 #
 #                      ** aliases **
 # alias commands to prompt for overwrite (highly recommended)
 # - use option '-f' when you have many files  (rm -f tmp/*, etc)
 alias rm='rm -i'              # confirm removes
 alias mv='mv -i'              # confirm renames
 alias cp='cp -i'              # confirm copy overwrites
 alias l='ls -l'               # save keystrokes
 alias cdl='cd $RUNLIBS'       # quick access to LIBS superdir
 alias cdd='cd $RUNDATA'       # DATA superdir
 #
 #                   ** printer stuff **
 # printer destinations for  laser printing scripts
 # - modify UVLPDEST to the network printer closest to you
 export UVLPDEST="-dMS610"      # default dest for uvlp(uvlist) scripts
 export UVLPOPTN="-onobanner"   # for unix/linux (SFU does not allow)
 export UVHDPRINT=uvlp12        # script for uvhd 'i' immediate print command
 #
 #                  ** Microsoft SQL Server **
 # see www.uvsoftware.ca/sqldemo.htm Part6
 export PATH=$PATH:/opt/mssql-tools/bin
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/microsoft/msodbcsql/lib64
 export ODBCSQL="ODBC Driver 13 for SQL Server"
 export DATABASE=testdb   # $(DATABASE) used in table create & load scripts
 export ODBCINI=/etc/odbc.ini
 export ODBCSYSINI=/etc/  #<-- Directory with ODBC config (not File odbcinst.ini)
 #
 #------------------------- end of common_profile ---------------------------

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

1B4. profiles for Vancouver Utilities on Unix/Linux

Advantages of stub_profile,& common_profile

  1. You never need to change scripts between TESTING & PRODUCTION.

  2. Programmers execute scripts from $TESTLIBS/scripts that access data from $TESTDATA/... because their profiles set RUNLIBS/RUNDATA as TESTLIBS/TESTDATA

  3. Operators execute scripts from $PRODLIBS/jcls that access data from $PRODDATA/... because their profiles set RUNLIBS/RUNDATA as PRODLIBS/PRODDATA

  4. This system could allow testing & production on the same machine. They are usually on separate machines, and this system provides great flexibility for both these situations.

  5. Different programmers can have their own set of TESTDATA simply by changing the definition of RUNDATA in their profile.

  6. On production machines, different operators could operate on different sets of data for different companies on the same machine, using the same scripts & programs with no changes required.

  7. The system administrator (appsadm) can make changes in 1 place to affect all users vs having to update profiles in all user homedirs.

  8. The sysadmin would control any updates to common_profile. On test systems the programmers would control updates to their stub_profile.

  9. Programmers have the flexibility required. They can select different sets of testdata by redefining RUNDATA in their profile

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

1C1. UVtools.doc - Vancouver Utilities for any Unix/Linux user

setup user account to run demos

Here are instructions to setup a user account to run the demos. You could run the demos in the Vancouver Utilities admin account /home/uvadm/... But it is better to setup a user account & copy the demo files into your directories.


 #1. login as 'root'

 #2.  useradd -m -g apps userxx   <-- setup user 'userxx'
      =========================
      - shell defaults depending on system (unix or linux)

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

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

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

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

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

Alternative - setup subdir in your home dir

Alternativley, you could use your exisitng login account. Make a sub-directory $HOME/demo, and copy -r /home/uvadm/demo/* to your $HOME/demo/...

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

1C2. UVtools.doc - Vancouver Utilities for any Unix/Linux user

copy demo files to your $HOME/demo


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

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

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

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

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

llr lists directories 1st

      drwxrwxr-x 2 uvadm apps 4096 Feb 15 11:40 ctl
      drwxrwxr-x 2 uvadm apps 4096 Feb 22 09:58 dat1
      drwxrwxr-x 2 uvadm apps 4096 Feb 16 15:06 jcl2
      drwxrwxr-x 2 uvadm apps 4096 Feb 16 14:34 jcl3
      drwxrwxr-x 2 uvadm apps 4096 Feb 12 18:08 parms
      drwxrwxr-x 2 uvadm apps 4096 Feb 21 19:49 pf
      drwxrwxr-x 2 uvadm apps 4096 Feb 12 17:33 rpts
      drwxrwxr-x 2 uvadm apps 4096 Feb 22 10:54 sf
      drwxrwxr-x 2 uvadm apps 4096 Feb 16 11:26 sqls
      drwxrwxr-x 2 uvadm apps 4096 Feb 16 07:06 stats
      drwxrwxr-x 2 uvadm apps 4096 Feb 22 09:19 tmp
      drwxrwxr-x 2 uvadm apps 4096 Feb 22 09:19 tmp1
      drwxrwxr-x 2 uvadm apps 4096 Feb 16 07:03 tmp2

llr lists files within directories

      demo/ctl:
      -rw-rw-r-- 1 uvadm apps 667 Feb 15 11:39 ipupdate_demo  <--search/replace table
      demo/dat1:
      -rw-rw-r-- 1 uvadm apps 730 Feb 21 07:23 accents1
      -rw-rw-r-- 1 uvadm apps 229 Feb 21 07:23 accents2
      -rw-rw-r-- 1 uvadm apps 450 Feb 22 09:58 nameadrs0e
      -rw-rw-r-- 1 uvadm apps 450 Feb 22 09:58 nameadrs1f
      -rw-rw-r-- 1 uvadm apps 427 Feb 22 09:58 nameadrs2t
      -rw-rw-r-- 1 uvadm apps 249 Feb 18 12:29 vendormas3
      demo/jcl2:
      -rw-rw-r-- 1 uvadm apps  480 Feb 13 14:56 jar100.jcl
      -rw-rw-r-- 1 uvadm apps  984 Feb 13 14:56 jar200.jcl
      -rw-rw-r-- 1 uvadm apps  777 Feb 13 14:56 jgl100.jcl <-- JCL (before conversion)
      -rw-rw-r-- 1 uvadm apps 1238 Feb 13 14:56 jgl200.jcl
      -rw-rw-r-- 1 uvadm apps 1477 Feb 13 14:56 jgl230.jcl
      -rw-rw-r-- 1 uvadm apps  932 Feb 13 14:56 jgl320.jcl

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

      demo/jcl3:
      -rwxrwxr-x 1 uvadm apps 1903 Feb 13 14:57 jar100.ksh
      -rwxrwxr-x 1 uvadm apps 3052 Feb 13 14:57 jar200.ksh
      -rwxrwxr-x 1 uvadm apps 2323 Feb 13 14:57 jgl100.ksh <-- JCL/scripts after conversion
      -rwxrwxr-x 1 uvadm apps 3497 Feb 13 14:57 jgl200.ksh
      -rwxrwxr-x 1 uvadm apps 4015 Feb 13 14:57 jgl230.ksh
      -rwxrwxr-x 1 uvadm apps 3280 Feb 13 14:57 jgl320.ksh
      demo/parms:
      -rw-rw-r-- 1 uvadm apps 138 Feb 12 18:08 ftpdemo1a
      -rw-rw-r-- 1 uvadm apps 135 Feb 12 18:08 ftpdemo1b   <-- parms (FTP scripts)
      -rw-rw-r-- 1 uvadm apps 134 Feb 12 18:08 ftpget1
      -rw-rw-r-- 1 uvadm apps 137 Feb 12 18:08 ftpput1
      demo/pf:     <-- uvcopy Parameter Files (jobs)
      -rw-rw-r-- 1 uvadm apps 1049 Feb 21 19:49 removeCR_uvcopy
      demo/rpts:
      demo/sf:     <-- Script Files
      -rwxrwxr-x 1 uvadm apps 244 Feb 21 17:28 llsx
      -rwxrwxr-x 1 uvadm apps 244 Feb 22 10:54 llsx.bak
      -rwxrwxr-x 1 uvadm apps 296 Feb 21 09:22 llsy
      demo/sqls:
      -rw-rw-r-- 1 uvadm apps  56 Feb 16 07:01 select_customers_all
      -rw-rw-r-- 1 uvadm apps  97 Feb 16 06:57 select_customers_basic
      -rw-rw-r-- 1 uvadm apps 152 Feb 16 07:12 select_customers_WA
      -rw-rw-r-- 1 uvadm apps 136 Feb 16 07:20 select_employee_dept123  <-- sql scripts
      -rw-rw-r-- 1 uvadm apps 115 Feb 16 07:17 select_employee_seattle
      -rw-rw-r-- 1 uvadm apps  79 Feb 16 06:57 select_orders_big
      -rw-rw-r-- 1 uvadm apps 306 Feb 16 11:26 select_patients_old
      -rw-rw-r-- 1 uvadm apps 129 Feb 16 07:13 select_students_failing
      demo/stats:
                  --- table summaries created by tutorials ---
      -rw-rw-r-- 1 uvadm apps  305 Feb 14 16:06 parms_ftps_tableIP
      -rw-rw-r-- 1 uvadm apps 1032 Feb 12 18:11 parms_open
      -rw-rw-r-- 1 uvadm apps 1057 Feb 12 18:12 parms_user
      -rw-rw-r-- 1 uvadm apps 1151 Feb 16 07:21 sqls_FROM
      -rw-rw-r-- 1 uvadm apps  305 Feb 14 11:20 tableIP_ftps
      demo/tmp:  <-- tmp dir for mass change output inspections before copyback
      demo/tmp1:   --- temp files created by tutorials ---
      -rw-rw-r-- 1 uvadm apps 1120 Feb 22 09:19 uvfix1.log

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

1D1. Demo files for Tutorials

demo input files - DATA files


 cat dat1/accents1
 =================
 Dear Owen: Re: French Accents (dat1/accents1)
 11. cedilla      c ---> Ç ---> x'C387' ---> x'63' c
 21. accent acute e ---> é ---> x'C3A9' ---> x'65' e
 31. accent grave a ---> à ---> x'C3A0' ---> x'61' a
 32.              e ---> è ---> x'C3A8' ---> x'65' e
 33.              u ---> ù ---> x'C3B9' ---> x'75' u
 41. dieresis     e ---> ë ---> x'C3AB' ---> x'65' e
 42.              i ---> ï ---> x'C3AF' ---> x'69' i
 43.              u ---> ü ---> x'C3BC' ---> x'75' u
 51. circumflex   a ---> â ---> x'C3A2' ---> x'61' a
 52.              e ---> ê ---> x'C3AA' ---> x'65' e
 53.              i ---> î ---> x'C3AE' ---> x'69' i
 54.              o ---> ô ---> x'C3B4' ---> x'6F' o
 55.              u ---> û ---> x'C3BB' ---> x'75' u
 UTF-8 2 byte codes (1st byte x'C3')
 How can we convert to unaccented characters ?
 Thanks Thérèse

 cat dat1/accents2
 =================

Dear Owen: Re: French Accents (dat1/accents2) 1. accent grave a ---> à ---> x'C3A0' ---> x'61' a 2. accent acute e ---> é ---> x'C3A9' ---> x'65' e 3. accent grave e ---> è ---> x'C3A8' ---> x'65' e How can we convert to unaccented characters ? Thanks Thérèse


 cat dat1/nameadrs0e    <-- EBCDIC file
 ===================

ðððñðð@@@@Ö¦…•@㖠... <-- cannot show here, see later conversion to ASCII


 cat dat1/nameadrs2t    <-- ASCII file
 ===================
 000100    Owen Townsend       4667 Hoskins Rd     North Vancouver     BC V5P3V8 Canada
 000200    John Horgan         1234 Government St. Victoria            BC V1P2G3 Canada
 000300    Justin Trudeau      24 Sussex Drive     Ottawa              ON K1Y2L6 Canada
 000400    Donald Trump        1600 Pennsylvannia  Washington          DC 00001 USA
 000500    Bill Gates          1 Microsoft Way     Redmond             WA 98052 USA

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

1D2. Demo files for Tutorials

demo input files - FTP scripts


 cat parms/*      <-- show FTP demo input files
 ===========
      # parms/ftpdemo1a
      open 192.168.0.4
      user user01 user01pw
      lcd data1
      get /home/userxx/ar/sales.items
      get /home/userxx/gl/account.tran1
      quit
      # parms/ftpdemo1b
      open 192.168.0.5
      user user02 user02pw
      lcd data1
      cd /home/userxx/data1
      put ar.sales.items
      put gl.account.tran1
      quit
      # parms/ftpget1
      open 192.168.0.6
      user user03 user03pw
      lcd data1
      binary
      cd  /home/usrxx/gl
      get gl.acnt.master
      get gl.acnt.trans
      quit
      # parms/ftpput1
      open 192.168.0.6
      user user03 user03pw
      binary
      lcd data1
      cd /home/userxx/data1
      put gl.acnt.master
      put gl.acnt.trans
      quit

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

1D3. Demo files for Tutorials

demo input files - SQL scripts


 #6. cat sqls/*      <-- show SQL demo input files
     ==========
     /* select_customers_all */
      SELECT * FROM Customers;
     /* select_customers_basic */
      SELECT Name, Birthday, Phone,
      Address, Zip FROM Customers;
     /* select_customers_WA */
      SELECT custno, Name, Birthday, Phone,
      Address, City, Zip, LYsales,Discount, FROM
      Customers WHERE LYsales >5000;
     /* select_employee_dept123 */
      SELECT EMP_ID, NAME, ADDRESS, CITY, ZIP, DEPT FROM
      EMPLOYEE WHERE DEPT = '123' AND STATUS = 'FULL';
     /* select_employee_seattle */
      SELECT EMP_ID, LAST_NAME FROM EMPLOYEE
      WHERE CITY = 'Seattle' ORDER BY EMP_ID;
     /* select_orders_big */
      SELECT item FROM Orders
      WHERE quantity > 500;
     /* select_patients_old - original */
     /* original Age selection comment out BEGIN
      SELECT Name, Age FROM Patients WHERE Age > 70
      GROUP BY Age ORDER BY Name;
      original Age selection comment out END */
     /* SELECT patients_old; - new */
      SELECT Name, Age FROM Patients WHERE Age > 75
      GROUP BY Age ORDER BY Name;
     /* select_students_failing */
      CREATE VIEW Failing_Students AS
      SELECT S_NAME, Student_ID FROM
      STUDENT WHERE GPA < 30;

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

1D4. Demo files for Tutorials

demo input files - sf


 #6a. cat sf/llsx     <-- show BAD script for uvhd demo
      ===========
      #!/bin/bash
      # llsx - List files in directory, in Size order, Biggest 1st
      echo "llsx - list directory sorted by file-size (biggest files 1st)"
      if  [[ -z "$1" ]] ; then dir="."; else dir=$1; fi
      ls -lS $dir | more
      #=================
      exit 0

 #6b. cat sf/llsy     <-- show GOOD script for uvhd demo
      ===========
      #!/bin/bash
      # llsy - List files in directory, in Size order, Biggest 1st
      echo "llsy - list directory sorted by file-size (biggest files 1st)"
      if  [[ -z "$1" ]] ; then dir="."; else dir=$1; fi
      ls -lS $dir | more
      #=================
      exit 0
      #Note - 'llsy' is the GOOD script vs 'llsx' the BAD script
Note
  • You can not see any significant difference between BAD & GOOD scripts
    using the usual unix/linux tools (cat, more, vi, lp, etc)
  • You can see the problem using 'uvhd' (displays in vertical hexadecimal)
  • see the demo on page '2B1'

demo input files - pf

 # removeCR_uvcopy - copy a file removing any CR's
 #                 - by Owen Townsend, UV Software, Feb 21/2019
 # - documented at http://uvsoftware.ca/topaids.htm
 # - demo Vancouver Utilities usefulness to any unix/linux user
 #
 # uvcopy removeCR_uvcopy    <-- execution command
 # ======================
 opr='$jobname - copy a file removing any Carriage Returns'
 fili1=?sf/llsx,rcs=256,typ=LST        #<-- declare input file
 filo1=?tmp/llsx,rcs=256,typ=LSTtp775  #<-- declare output file
 @run
         opn     all                    open files
 # begin loop to read/process/write records until EOF
 man20   get     fili1,a0               get next record into area 'a'
         skp>    man90                  (cc set > at EOF)
         mvc     b0(256),a0             copy input area 'a' to output area 'b'
         rep     b0(256),x'0D',''       remove CRs
         put     filo1,b0               write record to output file
         skp     man20                  return to get next record
 # EOF - close files & end job
 man90   cls     all
         eoj

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

1D5. Demo files for Tutorials

demo input files - JCL


 #6. cat jcl2/jar200.jcl   <-- show just 1 sample of JCL
     ===================
 //JAR200   JOB  (1234),'TEST/DEMO MVS JCL CONVERT'
 //* SORT AR.SALES.ITEMS BY PRODUCT CODE FOR LISTING
 //STEP010  EXEC PGM=SORT,REGION=2048K
 //SORTIN   DD DSN=AR.SALES.ITEMS,DISP=SHR
 //SORTOUT  DD DSN=&&jar200_TEMPSLS,DISP=(NEW,PASS),
 //            DCB=(LRECL=64,BLKSIZE=6400,RECFM=FB),
 //            SPACE=(TRK,(50,50),RLSE),UNIT=DISK
 //SYSIN    DD *
 SORT FIELDS=(31,6,CH,A,1,6,CH,A)
 OMIT COND=((11,2,CH,EQ,C'65'),OR,(COND=(11,2,CH,EQ,C'85'))
 /*
 //*============================ step# 0020 ============================
 //* LIST AR.SALES.ITEMS IN PRODUCT CODE SEQUENCE
 //STEP020  EXEC PGM=CAR200,COND=(4,LT,STEP010),PARM=2006
 //SALEDTL  DD DSN=&&jar200_TEMPSLS,DISP=(OLD,PASS)
 //CUSTMAS  DD DSN=AR.CUSTOMER.MASTER.INDEXED,DISP=SHR
 //SALELST  DD DSN=AR.SALES.LIST,DISP=(,CATLG,DELETE),
 //            UNIT=DISK,SPACE=(TRK,(25,25),RLSE),
 //            DCB=(MODEL.DSCB,LRECL=133,BLKSIZE=6118,RECFM=FBA)

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

Part_2. UVtools.doc Vancouver Utility Conversion Aids

Part 2 - Basic Vancouver Utilities


2A1. Basic Vancouver Utilities are uvhd,uvsort,uvcp,& uvlist
(vs Advanced Utilities uvcopy & pre-programmed jobs based on uvcopy).
We will give brief descriptions of uvhd,uvsort,uvcp,& uvlist, followed
by tutorials illustrating how they might help you solve data problems.

2B1. uvhd demo - investigating problem files
Shell scripts with CRs will not execute
Detect with uvhd & remove with uvhd or uvcp or script using tr -d

2B5. Alternate solutions (other than uvhd) to remove CR's from text files
- using script 'removeCR' (see /home/uvadm/sf/util/removeCR)
2B6. - using 'uvcp' (Vancouver command line Utility)
2B7. - using 'uvcopy' (Vancouver data manipulation Utility)
2B9. - using 'uvfix1' pre-programmed job prompts for instructions
- saves writing a uvcopy job, uvfix1 fixes 1 file at a time
2B10. - using 'uvfixA' pre-programmed job prompts for instructions
- to fix all files in directory while copying to 2nd directory

2C1. uvhd demo - investigating problem files
 Files with high-bit characters may cause problems for older applications
Example - converting French accents (UTF-8) to unaccented equivalents

2D1. uvhd demo - investigating unknown files
example - your Linux site recieves an EBCDIC file from a mainframe site
- how to identify with uvhd & determine record-size
- mainframe files do not have LineFeeds to mark end of records

2E1. uvcp demo - translate EBCDIC records to ASCII

2E2. uvcp demo - translate EBCDIC records to ASCII & insert lineFeeds at same time.

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

2A1. Basic Vancouver Utilities - Brief Descriptions

These brief descriptions of uvhd,uvcp,uvsort,& uvlist, will be followed by examples/tutorials illustrating how they might help you solve data problems.

uvhd

uvhd is a file investigation utility that displays any file in vertical hexadecimal, and prompts for commands to browse,search,replace,update,select,print,count,etc. uvhd allows you to see characters not shown by text editors (control characters & high-bit characters that can couse problems in text files). uvhd is interactive with 25 help screens, and is the favorite utility of all my customers. See uvhd documentation at http://www.uvsoftware.ca/uvhd.htm.

uvcp

'uvcp' is a command line data utility that can copy files, converting record formats between: fixed, variable, sequential, indexed, text, RDW, etc). uvcp provides record select, reformat, translate, etc. uvcp (& uvsort,uvcopy,etc) are compatible with Micro Focus COBOL & AIX COBOL fixed & variable length sequential, Indexed,& Relative file formats. See uvcp documentation at http://www.uvsoftware.ca/uvcp.htm.

uvsort

'uvsort' is a sort utility for Unix/Linux with mainframe capabilities. The Unix system sort will NOT sort mainframe type files that do not have Linefeeds, may be indexed, and may have packed decimal sort fields. uvsort has the functionality of mainframe SORT - record select, reformat, etc. See uvsort documentation at http://www.uvsoftware.ca/uvsort.htm.

uvlist

'uvlist' is a utility for listing text files on laser printers. uvlist scripts are provided to print files at various cpi,lpi,margins,etc. For example, 'uvlp13LD' will print mainframe reports (132 cols x 66 lines) on 8 1/2 by 11 at 13 cpi, 8 lpi, Landscape, Duplex with margins for 3 hole paper. uvlist is great for listing scripts, programs, etc, because the page headings tell you vital info such as: filename, date, userid, filesize, page#, etc. See uvlist documentation at http://www.uvsoftware.ca/uvlist.htm.

6. uvcopy

'uvcopy' is the most powerful of the Vancouver Utilities and will be discussed in later parts following these basic utilities.

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

2B1. Basic Vancouver Utilities

uvhd demo - investigating problem files

Somebody emails you a handy script to list files in directory in size order. But, when you try to execute it you get "bash: sf/llsx: /bin/bash^M: bad interpreter" We are supplying the bad script in demo/sf/llsx & good version in demo/sf/llsy Try the following tutorial to illustrate the problem with sf/llsx & correct it:


 #0a. login userxx --> /home/userxx
 #0b. cd demo      --> /home/usrxx/demo

 #1. l sf       <-- list the sf (Script Files) directory
     ====
     -rwxrwxr-x 1 uvadm apps 244 Feb 23 17:43 llsx
     -rwxrwxr-x 1 uvadm apps 244 Feb 23 17:47 llsx.bak
     -rwxrwxr-x 1 uvadm apps 296 Feb 24 13:25 llsy

 #2a. sf/llsx sf   <-- execute the BAD script (to list files in sf/...)
      ==========     - get following error:
     "bash: sf/llsx: /bin/bash^M: bad interpreter: No such file"

 #2b. sf/llsy sf   <-- execute the GOOD script to compare results:
      ==========
      llsy - list directory sorted by file-size (biggest files 1st)
      -rwxrwxr-x 1 uvadm apps 296 Feb 24 13:25 llsy
      -rwxrwxr-x 1 uvadm apps 244 Feb 23 17:43 llsx
      -rwxrwxr-x 1 uvadm apps 244 Feb 23 17:47 llsx.bak

 #3a. cat sf/llsx   <-- display the script, to see what's wrong
      ===========       (or could use 'more', 'vi', etc)
      #!/bin/bash
      # llsx - List files in directory, in Size order, Biggest 1st
      echo "llsx - list directory sorted by file-size (biggest files 1st)"
      if  [[ -z "$1" ]] ; then dir="."; else dir=$1; fi
      ls -lS $dir | more
      #=================
      exit 0

We do not see anything wrong with BAD script (sf/llsx), so let's compare to the GOOD script (sf/llsy).


 #3b. cat sf/llsx   <-- display the script, to see what's wrong
      ===========       (or could use 'more', 'vi', etc)
      #!/bin/bash
      # llsy - List files in directory, in Size order, Biggest 1st
      echo "llsy - list directory sorted by file-size (biggest files 1st)"
      if  [[ -z "$1" ]] ; then dir="."; else dir=$1; fi
      ls -lS $dir | more
      #=================
      exit 0

We see NO DIFFERENCE between the BAD & GOOD scripts, using unix system utilities (cat, more, vi, lp, etc). We will try 'uvhd' below:

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

2B2. using 'uvhd' to find problems in files

'uvhd' will display any file in "Vertical Hexadecimal". uvhd expects the filename as arg1 & filetype options as arg2. If you do not know the filetype options, you can first try uvhd without options & hopefully see what the options should be.


 #4. uvhd sf/llsx       <-- NOTE - arg2 filetype options omitted
     ============
     rec#=1 rsize=244 fptr=0 fsize=244 records=0
                  10        20        30        40        50        60
 r#    1 0123456789012345678901234567890123456789012345678901234567890123
       0 #!/bin/bash..# llsx - List files in directory, in Size order, Bi
         2226662667600226677222467726666726626676676772266256762676672246
         31F29EF2138DA30CC380D0C934069C5309E0492534F29C09E039A50F2452C029
      64 ggest 1st..echo "llsx - list directory sorted by file-size (bigg
         6667723770066662266772226677266766767727677662672666627676226666
         775340134DA538F02CC380D0C9340492534F2903F2454029069C5D39A5082977
     128 est files 1st)"..if  [[ -z "$1" ]] ; then dir="."; else dir=$1;
         6772666672377220066225522722232255232766626673222326676266732332
         534069C53013492DA9600BB0DA024120DD0B0485E0492D2E2B05C350492D41B0
     192 fi..ls -lS $dir | more..#=================..exit 0..
         6600672265226672726676002333333333333333330067672300
         69DAC30DC3044920C0DF25DA3DDDDDDDDDDDDDDDDDDA589400DA

When arg2 options are omitted, they default to: 'r256l64'. 'r256' is the default Record-size & 'l64' is default Line display size.

In this case (since the entire script file is less than 256, it displays as 1 block of 4 64 byte segments of 3 vertical hexadecimal line groups.

In the 3 line groups of Vertical Hexadecimal the ASCII characters are displayed on the 1st line, the zones on the 2nd line,& the digits on the 3rd line.

For example, the 1st byte of the file is a '#' & directly below you see the (horizontal) hexadecimal value is x'23' (zone 2 & digit 3). You can easily find an ASCII code chart (on the internet) to confirm this.

For a 2nd example, the 4th byte is 'b', which is x'62' in horizontal hex.

In the display above, the 7 records in the file are all run together in a block of 244 bytes, because we did not give uvhd any filetype options that would separate the records.

But we know that script files are TEXT files, so we need to specify the "text file option" to uvhd, which is simply 't'.

See our next attempt with option 't' on the page below:

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

2B3. using 'uvhd' to find problems in files

Notes re uvhd (display above) with default options

Since we know script files are 'text' files, we will use the 't' option.


 #5. uvhd sf/llsx t  <-- rerun with option 't' separate lines on LineFeeds x'0A'
     ==============
     rec#=1 rsize=13 fptr=0 fsize=244 records=7
                      10
 r#        1 0123456789012
           0 #!/bin/bash..
             2226662667600
             31F29EF2138DA
     rec#=2 rsize=62 fptr=13 fsize=244 records=7
                      10        20        30        40        50        60
 r#        2 01234567890123456789012345678901234567890123456789012345678901
          13 # llsx - List files in directory, in Size order, Biggest 1st..
             22667722246772666672662667667677226625676267667224666677237700
             30CC380D0C934069C5309E0492534F29C09E039A50F2452C029775340134DA
                 --- showing 1st 2 lines, omitting last 5 lines ---

Can you see the problem using uvhd, that we could not see using cat,vi,etc ? We could display the good script demo/sf/llsy & compare:


 #6. uvhd sf/llsy t    <-- display good script & compare to bad
     ==============
     rec#=1 rsize=12 fptr=0 fsize=237 records=7
                      10
 r#        1 012345678901
           0 #!/bin/bash.
             222666266760
             31F29EF2138A
     rec#=2 rsize=61 fptr=12 fsize=237 records=7
                      10        20        30        40        50        60
 r#        2 0123456789012345678901234567890123456789012345678901234567890
          12 # llsy - List files in directory, in Size order, Biggest 1st.
             2266772224677266667266266766767722662567626766722466667723770
             30CC390D0C934069C5309E0492534F29C09E039A50F2452C029775340134A
                 --- showing 1st 2 lines, omitting last 5 lines ---
 You can see the difference:
 - the bad script (sf/llsx) lines end with x'0D' & x'0A'.
 - the good script (sf/llsy) lines end with just x'0A'.
 - it is the x'0D' Carriage returns (CRs) that cause the problem
 - the shell was searching for the script interpreter /bin/bash+x'CR'
 - and gives the errmsg "bash: sf/llsx: /bin/bash^M: bad interpreter"

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

2B4. using 'uvhd' to find problems in scripts

Fixing the problem - Removing Carriage Returns (CRs)


 #7. uvhd sf/llsx tu  <-- run with option 't' & 'u' to allow Update
     ===============
 r#    1 0123456789012
       0 #!/bin/bash..
         2226662667600
         31F29EF2138DA
 rec#=1 rsize=13 fptr=0 fsize=244 records=7
 Enter command, or ?=Help, q=quit, null=NextRecord -->

 #7a. --> v99 x'0D',x'20'  <-- search/replace x'0D' with x'20' (space)
          ===============
          v99 x'0D',' '    <-- could code space as ' ' vs x'20'

 #7b. --> 1  <-- enter 1 to return to 1st record in file (to compare)
          ===
 r#    1 012345678901
       0 #!/bin/bash.
         222666266760      <-- Note CR x'0D' now removed
         31F29EF2138A

 #7c. --> q       <-- reply 'q' to quit
          ===

Notes re Updating with uvhd

  1. Must enter option 'u' on the command line if intent to update

  2. 'v' is command to search/replace, 99 of 'v99' is the number of records to process, but '99' has special meaning to process the entire file, resets file pointer to 1st record & processes all records until EOF.

  3. You could remove the CR by replacing with null as follows:

 #7a. --> v99 x'0D',''   <-- search/replace x'0D' with null ''
          ============
  1. Replacing with null will work in this case, but should normally be avoided. Normally, you should replace with an equal length string, because uvhd updates "in place", so the record rewritten will be shifted left at the replace point, inserting a blank at the end of the record, following the LineFeed x'0A', so we will get a blank ' ' at the begining of all recccords after 1st update, which will not be a problem for script execution, because scripts bypass blanks. But this would likely be a problem for most data files.

  2. See next page for an alternate solution using 'uvcp' which can remove the CR x'0D' & shift the LF x'0A' left 1 byte, shortening the records. (vs uvhd which always rewrites same size records). uvcp can do this because it copies the file (vs uvhd update in place).

  3. See all uvhd documentation at http://uvsoftware.ca/uvhd.htm, OR enter '?' at the uvhd prompt for 25 HELP screens.

  4. You can change the default options by adding export UVHDROP=... to your profile (or the common_profile), for example, I often use 'export UVHDROP=l100' for Line length 100 bytes.

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

2B5. using 'uvhd' to find problems in scripts

Alternate solutions (vs uvhd) to Remove CRs from files

There are several alternate ways (vs uvhd shown above) to remove CR's from files: You may need solution #5 to fix all files in a directory.

  1. 'removeCR' script to copy file using --> tr -d '\r' <filein >fileout <-- - you can see this script at /home/uvadm/sf/util/removeCR

  2. 'uvcp' to copy the file using instruction --> rep=0(256):0x0D:: <--

  3. 'uvcopy', copies file same as uvcp, instruction --> rep 0(256),x'0D','' <--

  4. 'uvfix1 - pre-programmed uvcopy job prompts for instructions (rep above) - saves you from having to write the uvcopy file I/O framework - you can see this script at /home/uvadm/sf/util/uvfix1

  5. 'uvfixA - same as uvfix1, but copies All files from 1 directory to a 2nd directory applying the instructions entered at the prompt. - you can see this script at /home/uvadm/sf/util/uvfix1

    1. Remove CRs using script 'removeCR'

We will use 'removeCR' to copy the bad script from demo/sf/llsx to tmp/llsx while removing the CR's & then prompt to copy back overwriting original. You could inspect in tmp/llsx before copying back (but you can be confident).


 #0a. login userxx --> /home/userxx
 #0b. cd demo      --> /home/usrxx/demo

 #1. removeCR sf/llsx    <-- call removCR to remove CR's
     ================      - log listed below:
      removeCR  - copy a file to tmp/... removing CRs & nulls, prompt to copy back
      input  lines & bytes:           7 sf/llsx 244	sf/llsx
      output lines & bytes:           7 tmp/llsx 244	tmp/llsx
      copy back overwriting original y/n ? --> y <-- reply 'y'
      copied back to sf/llsx
      -rwxrwxr-x 1 uvadm apps 244 Feb 21 17:28 sf/llsx
Note

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

2B6. Alternate solutions (vs uvhd) to Remove CRs from files

2. Remove CRs using 'uvcp'

We will use 'uvcp' to copy the bad script from demo/sf/llsx to tmp/llsx, while removing the CR's. You could inspect with 'uvhd tmp/llsx t' before copying back with 'cp'.


 #2a. uvcp "fili1=sf/llsx,rcs=256,typ=LSTt,filo1=tmp/llsx,rep=0(256),x'0D'::"
      =======================================================================

 #2b. uvhd tmp/llsx t      <-- inspect with uvhd, confirm CR's removed
      ===============
      r#    1 012345678901
            0 #!/bin/bash.
              222666266760      <-- Note CR x'0D' now removed
              31F29EF2138A

 #2c. cp tmp/llsx sf/      <-- copy back to sf/...
      ===============

 #2d. chmod 775 sf/llsx    <-- restore execute bits on script file
      =================

We need to restore the execute bits on all 5 solutions, except #3, since uvcopy allows file typ p775 to set output permissions.

See 'uvcp' documentation at http://www.uvsoftware.ca/uvcp.htm

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

2B7. Alternate solutions (vs uvhd) to Remove CRs from files

3. Remove CRs using 'uvcopy'

'uvcopy' is similar to 'uvcp', much more powerful, but does require a separate "Parameter File" (or "uvcopy job") vs uvcp which accepts all instructions on the comamnd line. We will 1st edit a "uvcopy job" & then execute with uvcopy.


 #3a. vi pf/removeCR_uvcopy   <-- create uvcopy job to remove CR's
      =====================     - listed below:
      # removeCR_uvcopy - copy a file removing any CR's
      #                 - by Owen Townsend, UV Software, Feb 21/2019
      # - documented at http://uvsoftware.ca/topaids.htm
      # - demo Vancouver Utilities usefulness to any unix/linux user
      #
      # uvcopy pf/removeCR_uvcopy    <-- execution command
      # =========================
      opr='$jobname - copy a file removing any Carriage Returns'
      fili1=?sf/llsx,rcs=256,typ=LST        #<-- declare input file
      filo1=?tmp/llsx,rcs=256,typ=LSTtp775  #<-- declare output file
      @run
              opn     all                    open files
      # begin loop to read/process/write records until EOF
      man20   get     fili1,a0               get next record into area 'a'
              skp>    man90                  (cc set > at EOF)
              mvc     b0(256),a0             copy input area 'a' to output area 'b'
              rep     b0(256),x'0D',''       remove CRs
              put     filo1,b0               write record to output file
              skp     man20                  return to get next record
      # EOF - close files & end job
      man90   cls     all
              eoj

 #3b. uvcopy pf/removeCR_uvcopy     <-- execute uvcopy job
      =========================
      - no need to define files on command line, since coded in job as the defaults

      uvcopy pf/removeCR_uvcopy,fili1=sf/llsx,filo1=tmp/llsx
      ======================================================
      - but could define on command line when different than the defaults
Note
  • the '?'s on the file declarations (fili1=?sf/llsx,... & filo1=?tmp1/llsx).
    caause prompts for alternate filename keyin, null entry for default coded.

 #3c. uvhd tmp/llsx t    <-- inspect with uvhd, confirm CR's removed
      ===============

 #3d. cp tmp/llsx sf/    <-- copy back to sf/...
      ===============

 #3e. chmod 775 sf/llsx  <-- restore execute bits <-- do NOT need
      =================

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

2B8. Alternate solutions (vs uvhd) to Remove CRs from files

Notes re uvcopy jobs

  1. Here is the one vital instruction in the uvcopy job listed above.

         rep     b0(256),x'0D',''       remove CRs
    ==============================================
  1. The other instructions are the framework to define the files, and to read & write the records.

  2. Solution #4 will use script 'uvfix1' to supply the frameword & the only instruciton you have to enter is the 'rep' (as shown above).

  3. Note that we stored our uvcopy job in subdir 'pf' (Parameter Files) & the execution command was:

      uvcopy pf/removeCR_uvcopy     <-- execute uvcopy job
      =========================
  1. We had to code the subdir because /home/userxx/demo/pf/ is not defined in the common_profile as part of export PFPATH=...

  2. You do not need to code the directories on the many pre-programmed uvcopy jobs mentioned in this documentation, because they are in PFPATH. Here is the definition of PFPATH in $APPSADM/env/common_profile_uv:

    export PFPATH=$UV/pf/adm:$UV/pf/demo:$UV/pf/util:$UV/pf/IBM:$HOME/pf
    ====================================================================
  1. You can see that this is similar to export PATH=... used in profiles to define the directories for system & user programs.

  2. PFPATH includes $HOME/pf/, but not $HOME/demo/pf/, so that is why we needed to code pf/... on our execution --> uvcopy pf/removeCR_uvcopy

  3. Alternatively, we could add $HOME/demo/pf to PFPATH in the common_profile.

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

2B9. Alternate solutions (vs uvhd) to Remove CRs from files

4. Remove CRs with 'uvfix1' pre-programmed uvcopy job

'uvfix1' is a pre-programmed uvcopy job that prompts for instructions & saves you from having to write the uvcopy file I/O framework.

'uvfix1' works the same way as above solutions, it will copy the bad script from sf/llsx to tmp/llsx (while applying the 'rep' instruction). You can then inspect the result in tmp/llsx & if satisfied, copy back from tmp/llsx to sf/llsx.


 #4a. uvfix1 sf/llsx    <-- call uvfix1, arg1 specifies the file to be modified
      ==============      - console log with prompts shown below:
      uvfix1 - copy a text file & modify via uvcopy instruction keyins
             - input rec in area a has already been copied to output rec in b
      uop=q1c0n99r8192 - user option defaults
            c1         - pass thru any "#" col1 #comment records
              n99      - output record count limit (high# copies to EOF)
                 r8192 - recsize ONLY for Fixed-Length OUTPUT records if desired
                       - for Text files: accept default recsize & default typ=LSTt
      User OPtion (uop) defaults  = q1c0n999999999r8192
 #4b. -->null to accept or enter/override -->  <-- enter null to accept default options
      typ=LSTt default, null accept or enter new typ -->   <-- null accept default typ
       mvc  b27(25),a0  <-- sample instrns, dup cols 1-25 to 27-51
                          - moves from op2 area a to op1 area b
      enter a uvcopy instruction (period "." terminates entries)
 #4c. ---> rep b0(256),x'0D',''   <--- ENTER rep instrn
 #4d. ---> .                      <--- ENTER '.' to continue
      190222:092255:uvfix1: EOF fili01 rds=7 size=244: sf/llsx
      190222:092255:uvfix1: EOF filo01 wrts=7 size=237: tmp/llsx
      check output in tmp/llsx, then move back to sf/llsx ?

 #4e. uvhd tmp/llsx t        <-- check output in tmp/llsx, see if OK ?
      ===============
      r#    1 012345678901
            0 #!/bin/bash.
              222666266760   <-- Yes, OK CR x'0D' removed
              31F29EF2138A

 #4f. cp tmp/llsx sf/        <-- copy back overwriting bad script
      ================
Note

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

2B10. Alternate solutions (vs uvhd) to Remove CRs from files

5. Remove CRs with 'uvfixA' pre-programmed uvcopy job

'uvfixA' is similar to 'uvfix1', But it processes ALL files in a directory. You must specify arg1=InDir, arg2=OutDir,& arg3=filetype (LSTt in this case).

You could run the same fix as above (removing CRs from scripts) & it would not change anything in scripts that did not have CRs. We will use tmp1 as output directory.


 #5a. mkdir tmp1        <-- make output directory if not already present
      ==========
      rm -f tmp1/*      <-- OR, remove all files if tmp1 already present
      ============

 #5b. uvfixA sf tmp1 LSTt   <-- call uvfixA arg1/arg2 I/O directories & arg3 file type
      ===================     - console log with prompts shown below:
      uvfixA - copy/modify all text files from 1 directory to a 2nd directory
             - modifying the files via uvcopy instruction keyins
             - input rec in area a has already been copied to output rec in b
      uop=q1c0n99r8192 - user option defaults
            c1         - pass thru any "#" col1 #comment records
              n99      - output record count limit (high# copies to EOF)
                 r8192 - recsize ONLY for Fixed-Length OUTPUT records if desired
                       - for Text files: accept default recsize & default typ=LSTt
      User OPtion (uop) defaults  = q1c0n999999999r8192
 #5c. -->null accept or enter/override -->    <-- enter null (accept default options)
 #5d. did you create outdir or remove files ? --> y  <--ENTER "y"
          clr  b0(6)," "     <-- sample, clear 1-6 (use single quotesnot doubles)
          add  $ca1,1        <-- sample, increment counter #1
          mvn  b0(4),$ca1    <-- sample, insert sequence# in 1-4
      enter a uvcopy instruction (period "." terminates entries)
 #5e. ---> rep b0(256),x'0D',''   <--- ENTER rep instrn
 #5f. ---> .                      <--- ENTER '.' to continue
      190222:101902:uvfixA: EOF fili01 rds=7 size=244: sf/llsx
      190222:101902:uvfixA: EOF filo02 wrts=7 size=237: tmp1/llsx
      190222:101902:uvfixA: EOF fili01 rds=7 size=244: sf/llsy
      190222:101902:uvfixA: EOF filo02 wrts=7 size=237: tmp1/llsy
      190222:101902:uvfixA: EOF fild02 size=4096: tmp1

 #5g. uvhd tmp1/llsx t   <-- check 1 or more in tmp1/llsx, see if OK ?
      ================

 #5h. cp tmp1/* sf/      <-- copy All scripts back overwriting originals
      =============

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

2C1. uvhd demo - investigating problem files

high-bit characters may cause problems for old applications

Files with high-bit characters may cause problems for older applications. For Example - files with UTF-8 characters input to legacy applciations, not designed to handle them. This demo will show you how to identify them with uvhd & convert them to unaccented characters with uvhd or uvcp.

Let's suppose I get an email from Therese asking me how to convert accented French characters to unaccented equivalents. She knows the problem is that the new files are using UTF-8 character encoding & has identified the French accented characters & their UTF-8 codes in hexadecimal.

dat1/accents1 - French UTF-8 accented characters


 #0a. login userxx --> /home/userxx
 #0b. cd demo      --> /home/usrxx/demo

 #1. cat dat1/accents1   <-- display sample file with UTF-8 chars
     =================
      Dear Owen: Re: French Accents (dat1/accents1)
      11. cedilla      c ---> Ç ---> x'C387' ---> x'63' c
      21. accent acute e ---> é ---> x'C3A9' ---> x'65' e
      31. accent grave a ---> à ---> x'C3A0' ---> x'61' a
      32.              e ---> è ---> x'C3A8' ---> x'65' e
      33.              u ---> ù ---> x'C3B9' ---> x'75' u
      41. dieresis     e ---> ë ---> x'C3AB' ---> x'65' e
      42.              i ---> ï ---> x'C3AF' ---> x'69' i
      43.              u ---> ü ---> x'C3BC' ---> x'75' u
      51. circumflex   a ---> â ---> x'C3A2' ---> x'61' a
      52.              e ---> ê ---> x'C3AA' ---> x'65' e
      53.              i ---> î ---> x'C3AE' ---> x'69' i
      54.              o ---> ô ---> x'C3B4' ---> x'6F' o
      55.              u ---> û ---> x'C3BB' ---> x'75' u
      UTF-8 2 byte codes (1st byte x'C3')
      How can we convert to unaccented characters ?
      Thanks Thérèse
Note
  • If you have a printed copy of this documentation, you will probably see
    that the UTF-8 accented chars print differently than the screen display,
    probably because the printer is not setup for UTF-8 characters.

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

2C2. High-Bit characters may cause problems for Legacy Applications

Investigating Accented Characters with 'uvhd'

Note
  • The file shown above would take too many lines in this documentation
  • so we will use a shorter version (dat1/accents2 vs dat1/accents1).

 #2. cat dat1/accents2   <-- display short version of UTF-8 sample file
     =================
      Dear Owen: Re: French Accents (dat1/accents2)
      1. accent grave a ---> à ---> x'C3A0' ---> x'61' a
      2. accent acute e ---> é ---> x'C3A9' ---> x'65' e
      3. accent grave e ---> è ---> x'C3A8' ---> x'65' e
      How can we convert to unaccented characters ?
      Thanks Thérèse

 #3. uvhd dat1/accents2 t  <-- investigate with 'uvhd'
     ====================    - using option 't' for Text files
 rec#=1 rsize=46 fptr=0 fsize=265 records=6
                   10        20        30        40
 r#     1 0123456789012345678901234567890123456789012345
        0 Dear Owen: Re: French Accents (dat1/accents2).
          4667247663256324766662466667722667326666677320
          45120F75EA025A0625E3801335E43084141F1335E4329A
 rec#=2 rsize=52 fptr=46 fsize=265 records=6
                   10        20        30        40        50
 r#     2 0123456789012345678901234567890123456789012345678901
       46 1. accent grave a ---> .. ---> x'C3A0' ---> x'61' a.
          32266666726767626222232CA222232724343222223272332260
          1E01335E4072165010DDDE0300DDDE087331070DDDE08761701A
 rec#=3 rsize=52 fptr=98 fsize=265 records=6
                   10        20        30        40        50
 r#     3 0123456789012345678901234567890123456789012345678901
       98 2. accent acute e ---> .. ---> x'C3A9' ---> x'65' e.
          32266666726677626222232CA222232724343222223272332260
          2E01335E4013545050DDDE0390DDDE087331970DDDE08765705A
 rec#=4 rsize=52 fptr=150 fsize=265 records=6
                   10        20        30        40        50
 r#     4 0123456789012345678901234567890123456789012345678901
      150 3. accent grave e ---> .. ---> x'C3A8' ---> x'65' e.
          32266666726767626222232CA222232724343222223272332260
          3E01335E4072165050DDDE0380DDDE087331870DDDE08765705A
 rec#=5 rsize=46 fptr=202 fsize=265 records=6
                   10        20        30        40
 r#     5 0123456789012345678901234567890123456789012345
      202 How can we convert to unaccented characters ?.
          4672666276266676772762766666676626667667677230
          8F7031E07503FE652404F05E1335E454038121345230FA
 rec#=6 rsize=17 fptr=248 fsize=265 records=6
                   10
 r#     6 01234567890123456
      248 Thanks Th..r..se.
          566667256CA7CA760
          481EB30483923835A

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

2C3. Investigating Accented Characters with 'uvhd'

Notes re UTF-8 French Accented Characters

We will use record #2 (isolated from 6 uvhd records above), as the basis for the notes following.

                   10        20        30        40        50
 r#     2 0123456789012345678901234567890123456789012345678901
       46 1. accent grave a ---> .. ---> x'C3A0' ---> x'61' a.
          32266666726767626222232CA222232724343222223272332260
          1E01335E4072165010DDDE0300DDDE087331070DDDE08761701A
  1. The vertical hex for grave 'a' under scale bytes 23 & 24 are shown again in horizontal hex under bytes 33-36 as x'C3A0', followed by the unaccented equivalent 'a' under scale 46-47 as x'61'.

  2. x'C3A0' is UTF-8 coding for grave'a'. UTF-8 uses just 1 byte for the 1st 128 bytes of the ASCII code table. The next 128 (hi-bit) ASCII codes use 2 bytes & the 1st byte is x'C2' for 128-191 & x'C3' for 192-255. The French accents all have 1st byte x'C3'.

  3. So, to convert the French accented characters to unaccented equivalents, we could remove the 1st byte x'C3' & convert the 2nd byte to the unaccented equivalent. For this example grave a 2nd byte x'A0' to x'61' unaccented 'a'.

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

2C4. Updating files with uvhd

converting accented characters to unaccented equivalents

For this demo, we will convert only the subset of 3 French characters. We will use uvhd to convert the x'C3' to space x'20' & the 3 French accents as shown below:

      1. accent grave a ---> à ---> x'C3A0' ---> x'61' a
      2. accent acute e ---> é ---> x'C3A9' ---> x'65' e
      3. accent grave e ---> è ---> x'C3A8' ---> x'65' e

 #0a. login userxx --> /home/userxx
 #0b. cd demo      --> /home/usrxx/demo

 #1. uvhd dat1/accents2 tu
     =====================
                  10        20        30        40
      r#    1 0123456789012345678901234567890123456789012345
            0 Dear Owen: Re: French Accents (dat1/accents2).
              4667247663256324766662466667722667326666677320
              45120F75EA025A0625E3801335E43084141F1335E4329A
              --- uvhd shows 1st record & prompts for your command:

 #1a. v99 x'C3',x'20'    <-- search/replace 1st byte UTF-8 to space
      ===============
      v99 x'C3',' '      <-- can code the space as character vs hex
      r#    6 01234567890123456
          248 Thanks Th .r .se.
              5666672562A72A760
              481EB30480920835A
      EOF, 6 read, 5 reps in 4 records, v99 x'C3',x'20'
      --- v99 searches/replaces entire file, shows last record updated,
          reports results as shown above, & prompts for next command

 #1b. v99 x'A0','a'  <-- search/replace grave 'a' with unaccented 'a'
      =============
      r#    2 0123456789012345678901234567890123456789012345678901
           46 1. accent grave a --->  a ---> x'C3A0' ---> x'61' a.
              3226666672676762622223226222232724343222223272332260
              1E01335E4072165010DDDE0010DDDE087331070DDDE08761701A
      EOF, 6 read, 1 reps in 1 records, v99 x'A0','a'

 #1c. v99 x'A9','e'  <-- search/replace acute 'e' with unaccented 'e'
      =============

 #1d. v99 x'A8','e'  <-- search/replace grave 'e' with unaccented 'e'
      =============

 #1e. q              <-- quit uvhd
      ===
Note
  • we have omitted showing results of #1c & #1d updates to save space
  • see the updated file on the page below:

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

2C5. converting accented characters to unaccented equivalents

Results Before & After conversion


 #2. cat dat1/accents2.bak   <-- show demo file Before updates
     =====================
      Dear Owen: Re: French Accents (dat1/accents2)
      1. accent grave a ---> à ---> x'C3A0' ---> x'61' a
      2. accent acute e ---> é ---> x'C3A9' ---> x'65' e
      3. accent grave e ---> è ---> x'C3A8' ---> x'65' e
      How can we convert to unaccented characters ?
      Thanks Thérèse

 #3. cat dat1/accents2        <-- show demo file After updates
     =================
      Dear Owen: Re: French Accents (dat1/accents2)
      1. accent grave a --->  a ---> x'C3A0' ---> x'61' a
      2. accent acute e --->  e ---> x'C3A9' ---> x'65' e
      3. accent grave e --->  e ---> x'C3A8' ---> x'65' e
      How can we convert to unaccented characters ?
      Thanks Th er ese

Results of updates with uvhd are not perfect, because we converted the 1st byte of UTF-8 codes to space (as we see in 'Th er ese').

We could have removed 1st byte by converting to null (v99 x'C3','') but should not do with uvhd, because it updates in place & rewriting would shift the record terminating LineFeed x'0A' left 1, thus creating a space prior to the next record.

But, we can remove the 1st byte x'C3's by using uvcp because we will copy the file while remvoing x'C3's & converting the accents to equivalents.

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

2C6. converting accented characters to unaccented equivalents

converting accented characters with 'uvcp'


 #0a. login userxx --> /home/userxx
 #0b. cd demo      --> /home/usrxx/demo

 #1. rm -f tmp/*     <-- remove any old files from tmp/...
     ===========         (uvcp will write output file to tmp/...)

 #2. uvcp "fili1=dat1/accents2,rcs=256,typ=LSTt,filo1=tmp/accents2,rep=0(256):0xC3:\
                        ,rep=0(256):0xA0:0x61,rep=0(256):0xA9:0x65,rep=0(256):0xA8:0x65"
     ===================================================================================
      alternative --->  ,rep=0(256):0xA0:a,rep=0(256):0xA9:e,rep=0(256):0xA8:e"

 #3. cat tmp/accents2   <-- confirm output results as desired
     ================
      Dear Owen: Re: French Accents (dat1/accents2)
      1. accent grave a ---> a ---> x'C3A0' ---> x'61' a
      2. accent acute e ---> e ---> x'C3A9' ---> x'65' e
      3. accent grave e ---> e ---> x'C3A8' ---> x'65' e
      How can we convert to unaccented characters ?
      Thanks Therese
Note
  • We have provided the uvcp command as a script in demo/sf/fixaccents2
  • you can inspect the script & execute as follows:

 #4. cat sf/fixaccents2     <-- inspect uvcp script to remove accents
     ==================
      #!/bin/ksh
      # fixaccents2 - uvcp script to convert French accents to unaccented equivalents
      #             - see demo in www.uvsoftware.ca/topaids.htm#2C1
      uvcp "fili1=?dat1/accents2,rcs=256,typ=LSTt,filo1=?tmp/accents2,rep=0(256):0xC3:\
                           ,rep=0(256):0xA0:0x61,rep=0(256):0xA9:0x65,rep=0(256):0xA8:0x65"
      #====================================================================================
      #   alternative ---> ,rep=0(256):0xA0:a,rep=0(256):0xA9:e,rep=0(256):0xA8:e"
      #
      # - could have coded the replacements as characters vs hex codes as shown above

 #5. sf/fixaccents2     <-- execute uvcp script to remove accents
     ==============

The easiest way to convert accented characters to unaccented equivalents would be to use 'uvfix1' the pre-programmed uvcopy job, that prompts for instructions (& saves writing the uvcopy job framework). We will run uvfix1 for dat1/accents1 which has all 13 French accents (vs accents2 demo with only 3).

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

2C7. converting accented characters to unaccented equivalents

converting accented characters with 'uvfix1'


 #0a. login userxx --> /home/userxx
 #0b. cd demo      --> /home/usrxx/demo

 #1. uvfix1 dat1/accents1    <-- call uvfix1, arg1 specifies the file to be modified
     ====================      - console log with prompts shown below:
      uvfix1 - copy a text file & modify via uvcopy instruction keyins
             - input rec in area a has already been copied to output rec in b
      uop=q1c0n99r8192 - user option defaults
            c1         - pass thru any "#" col1 #comment records
              n99      - output record count limit (high# copies to EOF)
                 r8192 - recsize ONLY for Fixed-Length OUTPUT records if desired
                       - for Text files: accept default recsize & default typ=LSTt
      User OPtion (uop) defaults  = q1c0n999999999r8192
 #1a. -->null to accept or enter/override -->  <-- enter null to accept default options
      typ=LSTt default, null accept or enter new typ -->   <-- null accept default typ
      mvc  b27(25),a0  <-- sample instrns, dup cols 1-25 to 27-51
                         - moves from op2 area a to op1 area b
      enter a uvcopy instruction (period "." terminates entries)

 #1b. ---> rep b0(256),x'C3',''   <--- ENTER rep to remove 1st byte of UTF-8 pairs
           ====================
 #1c. ---> repm b0(256),x'87A9A0A8B9ABAFBCA2AAAEB4BB','ceaeueiuaeiou'
           =========================================================
            - ENTER repm to REPlace Multiple bytes with alternates
            - specifying searches in hexadecimal & replacements as characters
 #1d. ---> .                      <--- ENTER '.' to continue
           190225:140942:uvfix1: EOF fili01 rds=17 size=834: dat1/accents1
           190225:140942:uvfix1: EOF filo01 wrts=17 size=819: tmp/accents1
           check output in tmp/llsx, then move back to sf/llsx ?

 #2. cat tmp/accents1      <-- inspect output results
     ================
      Dear Owen: Re: French Accents (dat1/accents1)
      11. cedilla      c ---> c ---> x'C387' ---> x'63' c
      21. accent acute e ---> e ---> x'C3A9' ---> x'65' e
      31. accent grave a ---> a ---> x'C3A0' ---> x'61' a
      32.              e ---> e ---> x'C3A8' ---> x'65' e
      33.              u ---> u ---> x'C3B9' ---> x'75' u
      41. dieresis     e ---> e ---> x'C3AB' ---> x'65' e
      42.              i ---> i ---> x'C3AF' ---> x'69' i
      43.              u ---> u ---> x'C3BC' ---> x'75' u
      51. circumflex   a ---> a ---> x'C3A2' ---> x'61' a
      52.              e ---> e ---> x'C3AA' ---> x'65' e
      53.              i ---> i ---> x'C3AE' ---> x'69' i
      54.              o ---> o ---> x'C3B4' ---> x'6F' o
      55.              u ---> u ---> x'C3BB' ---> x'75' u
      UTF-8 2 byte codes (1st byte x'C3')
      How can we convert to unaccented characters ?
      Thanks Therese

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

2D1. Basic Vancouver Utilities

uvhd demo - investigating unknown files

'uvhd' should be the 1st tool you think of when you receive a file of unknown format. Our 1st example assumes that your organization has both mainframes & unix/linux. Someone sends you a mainframe file in EBCDIC & you attempt to investigate with vi. We have provided such a file in demo/dat1/nameadrs0e. Try the following:


 #0a. login userxx --> /home/userxx
 #0b. cd demo      --> /home/usrxx/demo

 #1. vi dat1/nameadrs0e
     ==================
 ðððñðð@@@@Ö¦…•@㖦•¢…------ etc, 'vi' display all garbage ----->

Now let's try uvhd (still not knowing the file is in EBCDIC): 'uvhd' expects you to specify file-type options following the filename. But we do not yet know the file-type & the default is to assume ASCII with record-size 256.


 #2. uvhd dat1/nameadrs0e
     ====================
                  10        20        30        40        50        60
 r#    1 0123456789012345678901234567890123456789012345678901234567890123
       0 ......@@@@....@........@@@@@@@....@.......@..@@@@@.....@........
         FFFFFF4444DA894E9A9A8984444444FFFF4C9A989A4D844444D99A84E8989AA8
         0001000000665503665255400000004667086229520940000056938051536455

uvhd displays in 'vertical hexadecimal' 3 line groups with characters on 1st line, hex zones on the 2nd line, & hex digits on the 3rd line. Here we are showing only the 1st 64 bytes (vs actual 256 bytes in 4 groups of 3 lines of 64 bytes each).

The display is still garbage, but we can see that it is an EBCDIC file. The 1st byte is x'F0' (here in horizontal-hex vs vertical-hex above) & x'F0' should be recognized by most professionals as an EBCDIC zero. And bytes 6-9 are x'40's which are EBCDIC blanks.

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

2D2. uvhd demo - investigating unknown files

The next step should be use option 'a' which tells uvhd to translate the character line to ASCII (but uvhd will still display EBCDIC codes for zone & digit lines).


 #3. uvhd dat1/nameadrs0e a    <-- option 'a' translates EBCDIC to ASCII
     ======================
                  10        20        30        40        50        60
 r#    1 0123456789012345678901234567890123456789012345678901234567890123
       0 000100    Owen Townsend       4667 Hoskins Rd     North Vancouve
         FFFFFF4444DA894E9A9A8984444444FFFF4C9A989A4D844444D99A84E8989AA8
         0001000000665503665255400000004667086229520940000056938051536455
      64 r     BC V5P3V8 Canada    000200    John Horgan         1234 Gov
         944444CC4EFDFEF4C898884444FFFFFF444499894C99889444444444FFFF4C9A
         9000002305573580315141000000020000001685086971500000000012340765
     128 ernment St. Victoria            BC V1P2G3 Canada    000300    Ju
         899989A4EA44E88A9988444444444444CC4EFDFCF4C898884444FFFFFF4444DA
         5954553023B05933699100000000000023051727303151410000000300000014
     192 stin Trudeau      24 Sussex Drive     Ottawa              ON K1Y
         AA894E9A888A444444FF4EAAA8A4C98A844444DAA8A844444444444444DD4DFE
         2395039445140000002402422570499550000063316100000000000000650218

Now you should be able to see that the record-size is 90 bytes because data repeats at 90 bytes - 1st record id# 000100 & 2nd record id# 00020 is 90 bytes higher (64 on 1st line + 26 on 2nd line) (scales are zero-relative).

Notes Re: option 'a' translate EBCDIC to ASCII

  1. uvhd option 'a' translates the character line of the 3 line vertical hexadecimal groups from EBCDIC to ASCII, so you can read it before actual data translated.

  2. The actual data is unchanged, the zones & digits lines are still EBCDIC. Example#1 1st byte is '0' & below you see the zone/digit as x'F0' (in horizontal hex vs vertical hex in display above). Example#2 'O' of Owen Townsend is x'D6' in EBCDIC (would be x'4F' in ASCII).

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

2D3. uvhd demo - investigating unknown files

So now we can give uvhd the correct record-size as option 'r90' and can also specify line display size as option 'l90'.


 #4. uvhd dat1/nameadrs0e ar90l90
     ============================
 rec#=1 rsize=90 fptr=0 fsize=450 records=5
                 10        20        30        40        50        60        70        80        9
 r#   1 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
      0 000100    Owen Townsend       4667 Hoskins Rd     North Vancouver     BC V5P3V8 Canada
        FFFFFF4444DA894E9A9A8984444444FFFF4C9A989A4D844444D99A84E8989AA8944444CC4EFDFEF4C898884444
        000100000066550366525540000000466708622952094000005693805153645590000023055735803151410000
 rec#=2 rsize=90 fptr=90 fsize=450 records=5
                 10        20        30        40        50        60        70        80        9
 r#   2 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
     90 000200    John Horgan         1234 Government St. Victoria            BC V1P2G3 Canada
        FFFFFF4444D9894C99889444444444FFFF4C9A899989A4EA44E88A9988444444444444CC4EFDFCF4C898884444
        000200000016850869715000000000123407655954553023B05933699100000000000023051727303151410000
 rec#=3 rsize=90 fptr=180 fsize=450 records=5
                 10        20        30        40        50        60        70        80        9
 r#   3 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
    180 000300    Justin Trudeau      24 Sussex Drive     Ottawa              ON K1Y2L6 Canada
        FFFFFF4444DAAA894E9A888A444444FF4EAAA8A4C98A844444DAA8A844444444444444DD4DFEFDF4C898884444
        000300000014239503944514000000240242257049955000006331610000000000000065021823603151410000
 rec#=4 rsize=90 fptr=270 fsize=450 records=5
                 10        20        30        40        50        60        70        80        9
 r#   4 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
    270 000400    Donald Trump        1600 Pennsylvannia  Washington          DC 00001 USA
        FFFFFF4444C998984E9A9944444444FFFF4D899AA9A8998844E8A8898A994444444444CC4FFFFF4EEC44444444
        000400000046513403944700000000160007555283515591006128957365000000000043000001042100000000
 rec#=5 rsize=90 fptr=360 fsize=450 records=5
                 10        20        30        40        50        60        70        80        9
 r#   5 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
    360 000500    Bill Gates          1 Microsoft Way     Redmond             WA 98052 USA
        FFFFFF4444C8994C8A8A4444444444F4D8899A98A4E8A44444D8899984444444444444EC4FFFFF4EEC44444444
        000500000029330713520000000000104939626630618000009544654000000000000061098052042100000000

Now that we know the record size of our file, we can process with 'uvcp' (below).

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

2E1. Basic Vancouver Utilities

uvcp demo - translate to ASCII (& insert LineFeeds)


 #5. uvcp "fili1=dat1/nameadrs0e,typ=RSF,rcs=90,filo1=tmp1/nameadrs1f,tra=0(90)"
     ===========================================================================
      - copies dat1/nameadrs0e to tmp1/nameadrs1f, translating EBCDIC to ASCII
Note1
Note2
  • We will not show the output from only translating to ASCII because
  • It makes more sense to combine translation with inserting LineFeeds

uvcp - translate to ASCII & insert LineFeeds at same time

Most linux users would like to work with text files (records ended with LineFeeds) because just about all unix utilities & editors expect text records with LineFeeds.


 #6. uvcp "fili1=dat1/nameadrs0e,typ=RSF,rcs=90,filo1=tmp1/nameadrs2t,typ=LSTt"
     ==========================================================================

 uvhd /home/uvadm/dat1/nameadrs2t t
 ==================================
 rec#=1 rsize=87 fptr=0 fsize=427 records=5
                  10        20        30        40        50        60        70        80
 r#    1 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456
       0 000100    Owen Townsend       4667 Hoskins Rd     North Vancouver     BC V5P3V8 Canada.
         333333222247662567676662222222333324676667256222224677625666677672222244253535324666660
         0001000000F75E04F7E35E40000000466708F3B9E302400000EF248061E3F565200000230650368031E141A
 rec#=2 rsize=87 fptr=87 fsize=427 records=5
                  10        20        30        40        50        60        70        80
 r#    2 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456
      87 000200    John Horgan         1234 Government St. Victoria            BC V1P2G3 Canada.
         333333222266662467666222222222333324676766667257225667676622222222222244253534324666660
         0002000000AF8E08F271E000000000123407F652ED5E4034E06934F291000000000000230610273031E141A
 rec#=3 rsize=87 fptr=174 fsize=427 records=5
                  10        20        30        40        50        60        70        80
 r#    3 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456
     174 000300    Justin Trudeau      24 Sussex Drive     Ottawa              ON K1Y2L6 Canada.
         333333222247776625776667222222332577767247676222224776762222222222222244243534324666660
         0003000000A5349E0425451500000024035335804296500000F4417100000000000000FE0B192C6031E141A
 rec#=4 rsize=83 fptr=261 fsize=427 records=5
                  10        20        30        40        50        60        70        80
 r#    4 01234567890123456789012345678901234567890123456789012345678901234567890123456789012
     261 000400    Donald Trump        1600 Pennsylvannia  Washington          DC 00001 USA.
         33333322224666662577672222222233332566677676666622567666676622222222224423333325540
         00040000004FE1C40425D0000000001600005EE39C61EE910071389E74FE0000000000430000010531A
 rec#=5 rsize=83 fptr=344 fsize=427 records=5
                  10        20        30        40        50        60        70        80
 r#    5 01234567890123456789012345678901234567890123456789012345678901234567890123456789012
     344 000500    Bill Gates          1 Microsoft Way     Redmond             WA 98052 USA.
         33333322224666246767222222222232466767667256722222566666622222222222225423333325540
         000500000029CC071453000000000010D932F3F64071900000254DFE40000000000000710980520531A

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

Part_4. UVtools.doc Vancouver Utility Conversion Aids

Part 4 - Contents


4A1. table3d - create table summary counts of desired items in text files
- pre-programmed job using uvcopy (powerful data manipulation utility)
- scan all files in directory building table statistics to dump at EOF
- table3d example#1 - counts of IP#s in FTP scripts

4B1. table3d - create table summary counts of desired items in text files
- table3d example#2 - counts of userids & passwords in FTP scripts

4C1. table3d - create summary table of programs in JCL

4D1. more about table3d, pre-programmed jobs vs specific uvcopy jobs

4D2. tableIP - custom witten table summary demo (only 14 instructions)
- creates same table summary as table3d
- but only does that 1 specific summary (vs general purpose)

4E1. table3d - create summaries of TABLEs in SQL scripts

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

4A1. UVtools.doc Vancouver Utility Conversion Aids

table3d - create summary table of IP#s in FTP scripts

Here are the step by step instructions to demo table3d, using supplied test/data files of FTP scripts. We will create summary counts of IP#s, userids,& passwords.


 #0a. login userxx --> /home/userxx
 #0b. cd demo      --> /home/usrxx/demo

 #1. l    <-- list files in current directory /home/userxx/demo
     ===    - alias l='ls -l'  (in common_profile_uv)
            - saves keystrokes for most common command)
      drwxrwxr-x 2 userxx apps 4096 Feb 13 15:01 jcl2
      drwxrwxr-x 2 userxx apps 4096 Feb 13 15:01 jcl3
      drwxrwxr-x 2 userxx apps 4096 Feb 13 06:47 parms
      drwxrwxr-x 2 userxx apps 4096 Feb 13 06:47 rpts
      drwxrwxr-x 2 userxx apps 4096 Feb 13 06:47 sqls
      drwxrwxr-x 2 userxx apps 4096 Feb 13 15:04 stats
      drwxrwxr-x 2 userxx apps 4096 Feb 13 15:00 tmp

 #2. l parms   <-- list parms/* input files for 1st demo of table3d
     =======
      -rw-rw-r-- 1 userxx apps 138 Feb 13 06:47 ftpdemo1a
      -rw-rw-r-- 1 userxx apps 135 Feb 13 06:47 ftpdemo1b
      -rw-rw-r-- 1 userxx apps 134 Feb 13 06:47 ftpget1
      -rw-rw-r-- 1 userxx apps 137 Feb 13 06:47 ftpput1

 #3. cat parms/*    <-- show demo input files
     ===========      - showing only 1st of 4 FTP scripts
                      - see all 4 FTP script input files on page '1C3'
      # parms/ftpdemo1a
      open 192.168.0.4
      user user01 user01pw
      lcd data1
      get /home/userxx/ar/sales.items
      get /home/userxx/gl/account.tran1

table3d Logic

table3d accepts your 'keyword' to table summarize following 'targetwords'.

The default targetword is the 1st word following the keyword. Our 1st demo will use keyword 'open' to table summarize following word (IP# 192.168.0.4 in 1st file above).

Our 2nd demo at '4A2' will use keyword 'user' & option 'y2' to table sumamrize following 2 target words (user01 & user01pw in 1st file above).

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

create table summary of FTP IP#s


 #4. uvcopy table3d,fild1=parms,arg1=open
     ====================================
Note
  • table3d will display the options available & prompt for your arguments & options
  • for these demos, we have coded the args & options required on the comamnd line
  • so you can make null replys to the prompts below
  • you can rerun & experiment with different arguments & options
  • you can run with just 'uvcopy table3d' & enter directory, args,& options at prompts
  • you can use ':' delimiter for multiple keywords (keyword1:keyword2:keyword3:etc)
 table3d ----- scan for Keyword(s) & table counts of following Targetword
              - table3d scans scans all files in directory (vs table3 for 1 file)
 uvcopy table3d,fild1=dir,arg1=keyword,arg2=qual1,arg3=qual2,arg4=chars2blank,uop=...
 ====================================================================================
 uop=a0b3c0d0f0j0l0m0p1x0w1 - option defaults
     a1                   - "&" variable end "#", insert space after "#" force endword
     a2                   - discard variables not ending with"#"
       b3                 - assume 1 blank before & after keyword (default)
       b1                 - assume 1 blank before & no blank after
       b2                 - assume no blank before & 1 blank after
       b0                 - assume no blank before or after
         c1               - bypass comments in COBOL programs(* column 7)
         c2               - bypass comments in shell scripts (# column 1)
         c4               - bypass comments in JCL //* cols 1-3
           d1             - insert blank before "$", allow arg1=$
             f0           - do not prepend/append table entrywith filename
             f1           - prepend table argument with filename
             f2           - append table argument with filename
               j1         - insert blank before search word in data
               j2         - insert blank after search word indata
               j3         - insert blank & after search word in data
                 l0       - translate lower case before matching patterns
                   m2     - look for multiple keywords on 1 line
                     p1   - qualifier#1 present & qualifier#2absent
                     p2   - qualifier#1 present & qualifier#2present
                     p4   - qualifier#1 absent  & qualifier#2absent
                       t1 - translate to lower-case
                       t2 - translate to UPPER-case
                     w1   - target word is 1st word following keyword
                     w2   - target word is 2nd word following keyword
                     w0   - target word is same as keyword (partial def)
                   x1     - table w# word (search will ignore keyword)
                          - specified keyword will be inserted in outfilename
                 y#       - table multiple target words (4 max)
                 y3       - would table target word + following 2 words
               z1         - convert x"A3" to "@" in data for keyword "@"
 -------- examples - options, keywords,& spcl chars to be blanked ------
 uvcopy table3,fild1=jcl2/jobxx,arg1=EXEC,arg4=c
        - table program-names following EXEC ..., arg=c blanks comma
 uvcopy table3,fild1=jcl2/jobxx,arg1=EXEC,arg4=c,uop=f2
        - same as above, appending current jobname (uop=f2)
 uvcopy table3,fild1=jcl2/jobxx,arg1=exportfile,uop=w2
        - table filenames in 2nd word (uop=w2) following exportfile
 special chars to separate words, use with option w# offset from search word
 ------> &\,$=/-:(.`);_*|" <--- on arg4/prompt, enter specialchars to blank
 ------> abcdefhklpqrsuAPQ <--- OR enter equivalents (some chars N/A on command line)

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

uvcopy table3d,fild1=parms,arg1=open - output display continued

Note
  • Above we showed table3d initial displays documenting options available
  • Below we will show the prompts for arguments not coded on the command line
  • We coded the essential arg1=keyword on the cmd line, so we can now
    make null replies to the other arguments (not reqquired in this case)
  • We do find it convenient to reply 'cat' at the prompt for output file viewing
 User OPtion (uop) defaults  = q1a0b3c0d0f0j0l0m0p1x0w1
 -->null to accept or enter/override -->
 enter arg2 qualifier#1 (null=disable) ----->
 enter arg3 qualifier#2 (null=disable) ----->
 enter arg4 chars to blank before word sep (comma,equal,etc) -->
 enter strings to be removed (use ":" sep if multiple) --->
 190213:091653:table3d: EOF fili01 rds=7 size=138: parms/ftpdemo1a hits=1
 190213:091653:table3d: EOF fili01 rds=9 size=137: parms/ftpput1 hits=1
 190213:091653:table3d: EOF fili01 rds=8 size=135: parms/ftpdemo1b hits=1
 190213:091653:table3d: EOF fili01 rds=9 size=134: parms/ftpget1 hits=1
 190213:091653:table3d: EOF fild01 rds=6 size=4096: parms hits=4
 190213:091653:table3d: EOF filo01 wrts=16 size=1125: stats/parms_open
 EOJ, Output File written to: stats/parms_open

default command = null, OR enter: more,print,uvlpr12,edit,null --> cat


 #4a. --> cat <-- suggest 'cat' to view outputs (when known to be small)
          ===   - alternative, null reply & use #5. below (vi stats/parms_open)
 # /home/userxx/demo/stats/parms_open  <-- This report created by uvcopy:
 # uvcopy table3d,fild1=parms,arg1=open
 # =====================================================================
 # - scan all files in directory for a keyword & table countsof following word
 # InDir=parms  Keyword=open  Qual1=   Qual2=
 # WordSepsBlank=  Options=q1a0b3c0d0f0j0l0m0p1x0w1
 # - default selects following word, use option w2 to table 2nd word, etc
 # - specify arg1=Keyword,arg2=Qualifier-present,arg2=Qualifier-absent
 # &\,$=/-:(.`);_*|" <--- arg4=special chars to blank
 # abcdefhklpqrsuAPQ <--- equivalents, easier to enter
 # Date=2019/02/13_09:16:50, Site=UV_Software, Host=uvsoft5, User=userxx
 #===============================================================================
 #---> uvcopy table3d,fild1=parms,arg1=open
 table3d  2019/02/13_09:16:53  Counts by Targetword followingspecified Keyword
 tbl#0001  tblt1f7 e0(48)
 line#     count  %    1strec#  target-word
     1         1  25         2   192.168.0.4
     2         1  25         2   192.168.0.5
     3         2  50         2   192.168.0.6
               4*100             *TOTAL*

 #5. vi stats/parms_open  <-- view report separately after running table3d
     ===================
Note
  • table3d reports are written into the stats/... directory
  • named from the directory + keyword arguments & options

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

4B1. UVtools.doc Vancouver Utility Conversion Aids

create table summary of FTP userids & passwords

Note
  • for this 2nd demo of table3d, we will not show all the output displays & prompts
  • since similar to the 1st demo displays shown above
  • and you will see them when you re-execute table3d

 #20a. login userxx --> /home/userxx
 #20b. cd demo      --> /home/usrxx/demo

 #21. l    <-- list files in current directory /home/userxx/demo
      ===    - optional, output not shown, same as at '4A1'

 #22. l parms    <-- list test/demo input files
      =======      - optional, output not shown, same as at '4A1'

 #23. cat parms/*    <-- show demo input files
      ===========      - showing only 1st of 4 FTP scripts
      # parms/ftpdemo1a
      open 192.168.0.4
      user user01 user01pw
      lcd data1
      get /home/userxx/ar/sales.items
      get /home/userxx/gl/account.tran1

 #24. uvcopy table3d,fild1=parms,arg1=user,uop=q0i7y2
      ===============================================
Note
  • using keyword 'arg1=user' (vs 'arg1=open' on 1st demo)
  • option 'y2' of 'uop=q0i7y2' summarizes the 2 words following 'user'
    (vs 1 word by default)
  • option 'q0' inhibits prompt for options (use when coded on command line)
  • option 'i7' inhibits the displays describing the options available
Note
  • for this 2nd table3d demo, we will omit the displays of options available
  • We will show the prompts for directory, arguments,& options
  • You can make null entries to these prompts, if you coded on the command line
  • But it is convenient to reply 'cat' at the prompt for output file viewing
 -->null to accept or enter/override -->
 enter arg2 qualifier#1 (null=disable) ----->
 enter arg3 qualifier#2 (null=disable) ----->
 enter arg4 chars to blank before word sep (comma,equal,etc) -->
 enter strings to be removed (use ":" sep if multiple) --->
 190213:091747:table3d: EOF fili01 rds=7 size=138: parms/ftpdemo1a hits=1
 190213:091747:table3d: EOF fili01 rds=9 size=137: parms/ftpput1 hits=1
 190213:091747:table3d: EOF fili01 rds=8 size=135: parms/ftpdemo1b hits=1
 190213:091747:table3d: EOF fili01 rds=9 size=134: parms/ftpget1 hits=1
 190213:091747:table3d: EOF fild01 rds=6 size=4096: parms hits=4
 190213:091747:table3d: EOF filo01 wrts=16 size=1150: stats/parms_user
 EOJ, Output File written to: stats/parms_user
 default command = null, OR enter: more,print,uvlpr12,edit,null --> cat

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


 #24a. --> cat <-- suggest 'cat' to view outputs (when known to be small)
           ===   - alternative, null reply & use #4. 'vi stats/parms_open' below
 # /home/userxx/demo/stats/parms_user  <-- This report created by uvcopy:
 # uvcopy table3d,fild1=parms,arg1=user,uop=y2
 # =====================================================================
 # - scan all files in directory for a keyword & table countsof following word
 # InDir=parms  Keyword=user  Qual1=   Qual2=
 # WordSepsBlank=  Options=q1a0b3c0d0f0j0l0m0p1x0w1y2
 # - default selects following word, use option w2 to table 2nd word, etc
 # - specify arg1=Keyword,arg2=Qualifier-present,arg2=Qualifier-absent
 # &\,$=/-:(.`);_*|" <--- arg4=special chars to blank
 # abcdefhklpqrsuAPQ <--- equivalents, easier to enter
 # Date=2019/02/13_09:17:44, Site=UV_Software, Host=uvsoft5, User=userxx
 #===============================================================================
 #---> uvcopy table3d,fild1=parms,arg1=user,uop=y2
 table3d  2019/02/13_09:17:47  Counts by Targetword followingspecified Keyword
 tbl#0001  tblt1f7 e0(48)
 line#     count  %    1strec#  target-word
     1         1  25         3  user01 user01pw
     2         1  25         3  user02 user02pw
     3         2  50         3  user03 user03pw
               4*100             *TOTAL*

 #25. vi stats/parms_user  <-- view report separately after running table3d
      ===================
Note
  • table3d reports are written into the stats/... directory
  • named from the directory + keyword arguments & options
  • so this 2nd demo output is named 'parms_user' (vs 'parms_open' for 1st demo)

Rerun table3d experimenting with different options

We have run 2 table3d demos using following command lines.


 #4. uvcopy table3d,fild1=parms,arg1=open
     ====================================

 #24. uvcopy table3d,fild1=parms,arg1=user,uop=y2
      ===========================================
      # parms/ftpdemo1a
      open 192.168.0.4
      user user01 user01pw
      lcd data1
      get /home/userxx/ar/sales.items
      get /home/userxx/gl/account.tran1

You can rerun table3d experimenting with different options. For example, you could table summarize just the passwords using option 'w2'


 #34. uvcopy table3d,fild1=parms,arg1=user,uop=w2
      ===========================================
      - option 'w2' table summaizes the 2nd word following keyword 'user'

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

4C1. UVtools.doc Vancouver Utility Conversion Aids

table3d - create summary table of programs in JCL

This the 3rd demo of table3d, now using JCL as input


 #30a. login userxx --> /home/userxx
 #30b. cd demo      --> /home/usrxx/demo

 #31. l    <-- list files in current directory /home/userxx/demo
     ===
      drwxrwxr-x 2 userxx apps 4096 Feb 13 15:01 jcl2
      drwxrwxr-x 2 userxx apps 4096 Feb 13 15:01 jcl3
      drwxrwxr-x 2 userxx apps 4096 Feb 13 06:47 parms
      drwxrwxr-x 2 userxx apps 4096 Feb 13 06:47 rpts
      drwxrwxr-x 2 userxx apps 4096 Feb 13 06:47 sqls
      drwxrwxr-x 2 userxx apps 4096 Feb 13 15:04 stats

 #32. l jcl2   <-- list jcl2/* input files for 3rd demo of table3d
      ======
      -rw-rw-r-- 1 userxx apps  480 Feb 13 15:01 jar100.jcl
      -rw-rw-r-- 1 userxx apps  613 Feb 13 15:01 jar120.jcl
      -rw-rw-r-- 1 userxx apps  984 Feb 13 15:01 jar200.jcl
      -rw-rw-r-- 1 userxx apps  777 Feb 13 15:01 jgl100.jcl
      -rw-rw-r-- 1 userxx apps 1238 Feb 13 15:01 jgl200.jcl  <-- listed below
      -rw-rw-r-- 1 userxx apps  617 Feb 13 15:01 jgl220.jcl
      -rw-rw-r-- 1 userxx apps 1477 Feb 13 15:01 jgl230.jcl
      -rw-rw-r-- 1 userxx apps  932 Feb 13 15:01 jgl320.jcl

 #33a. cat jcl2/jar200.jcl
       ===================
      //JAR200   JOB  (1234),'TEST/DEMO MVS JCL CONVERT'
      //* SORT AR.SALES.ITEMS BY PRODUCT CODE FOR LISTING
      //STEP010  EXEC PGM=SORT,REGION=2048K                      <--Note PGM=SORT
      //SORTIN   DD DSN=AR.SALES.ITEMS,DISP=SHR
      //SORTOUT  DD DSN=&&jar200_TEMPSLS,DISP=(NEW,PASS),...
      //SYSIN    DD *
      SORT FIELDS=(31,6,CH,A,1,6,CH,A)
      OMIT COND=((11,2,CH,EQ,C'65'),OR,(COND=(11,2,CH,EQ,C'85'))
      /*
      //*=================== step# 0020 ========================
      //* LIST AR.SALES.ITEMS IN PRODUCT CODE SEQUENCE
      //STEP020  EXEC PGM=CAR200,COND=(4,LT,STEP010),PARM=2006   <--Note PGM=CAR200
      //SALEDTL  DD DSN=&&jar200_TEMPSLS,DISP=(OLD,PASS)
      //CUSTMAS  DD DSN=AR.CUSTOMER.MASTER.INDEXED,DISP=SHR
      //SALELST  DD DSN=AR.SALES.LIST,DISP=(,CATLG,DELETE),...

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

table summarize PGM names in JCL


 #34. uvcopy table3d,fild1=jcl2,arg1=PGM,arg4=ec,uop=w1q0i7
      =====================================================
      - read following notes before executing above comamnd line

Notes re arguments & options

We will use 'PGM' as the keyword to table summarize the following word (program-name).

Re: 'arg4=ec', arg4 specifies characters to blank before word separation. Some special characters are a problem when entered using arg4=... on the command line so we allow you to use an alpha character to represent & show the equivalents as follows:

&\,$=/-:(.`);_*|" <--- arg4=special chars to blank abcdefhklpqrsuAPQ <--- equivalents, easier to enter

 //STEP010  EXEC PGM=CAR100,PARM=2008

For the above example, we need to blank the '=' & the ',' to separate the words. We used 'arg4=ec' vs 'arg4==,', because the ',' would confuse command parsing.

You could omit arg4=... from command line & enter actual characters at the prompt, but we prefer entering on the command line for this documentation.

Re: options 'uop=w1q0i7'. 'w1' means the target-word is 1st word following the keyword & we did not need to specify since it is the default.

Option 'q0' inhibits prompting for options (not needed if on the comamnd line).

Option 'i7' inhibits displaying the 'opr' commands describing options, etc.

now execute the table3d command


 #34. uvcopy table3d,fild1=jcl2,arg1=PGM,arg4=ec,uop=q0i7
      ===================================================
 enter arg2 qualifier#1 (null=disable) ----->
 enter arg3 qualifier#2 (null=disable) ----->
 enter strings to be removed (use ":" sep if multiple) --->
 190216:160322:table3d: EOF fili01 rds=34 size=1477: demo/jcl2/jgl230.jcl hits=3
 190216:160322:table3d: EOF fili01 rds=23 size=984: demo/jcl2/jar200.jcl hits=2
 190216:160322:table3d: EOF fili01 rds=11 size=480: demo/jcl2/jar100.jcl hits=1
 190216:160322:table3d: EOF fili01 rds=17 size=777: demo/jcl2/jgl100.jcl hits=1
 190216:160322:table3d: EOF fili01 rds=26 size=1238: demo/jcl2/jgl200.jcl hits=2
 190216:160322:table3d: EOF fili01 rds=22 size=932: demo/jcl2/jgl320.jcl hits=2
 190216:160322:table3d: EOF fild01 rds=8 size=4096: demo/jcl2 hits=11
 190216:160322:table3d: EOF filo01 wrts=20 size=1322: stats/jcl2_PGM_ec_w1q0i7
 EOJ, Output File written to: stats/jcl2_PGM_ec_w1q0i7
 default command = null, OR enter: more,print,uvlpr12,edit,null -->

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

table3d output report for 3rd demo JCL programs


 #34a. --> cat <-- suggest 'cat' to view outputs (when known to be small)
           ===   - alternative, null reply & use #35. below (vi stats/parms_open)
 # /home/uvadm/stats/jcl2_PGM_ec_w1q0i7  <-- This report created by uvcopy:
 # uvcopy table3d,fild1=demo/jcl2,arg1=PGM,arg4=ec,uop=w1q0i7
 # =====================================================================
 # - scan all files in directory for a keyword & table counts of following word
 # InDir=demo/jcl2  Keyword=PGM  Qual1=   Qual2=
 # WordSepsBlank==,  Options=q1a0b3c0d0f0j0l0m0p1x0w1w1q0i7
 # - default selects following word, use option w2 to table 2nd word, etc
 # - specify arg1=Keyword,arg2=Qualifier-present,arg2=Qualifier-absent
 # &\,$=/-:(.`);_*|" <--- arg4=special chars to blank
 # abcdefhklpqrsuAPQ <--- equivalents, easier to enter
 # Date=2019/02/16_16:03:21, Site=UV_Software, Host=uvsoft5, User=uvadm
 #===============================================================================
 #---> uvcopy table3d,fild1=demo/jcl2,arg1=PGM,arg4=ec,uop=w1q0i7
 table3d  2019/02/16_16:03:22  Counts by Targetword following specified Keyword
 tbl#0001  tblt1f7 e0(48)
 line#     count  %    1strec#  target-word
     1         1   9         3   CAR100
     2         1   9        15   CAR200
     3         2  18        26   CGL100
     4         2  18        17   CGL200
     5         1   9        12   IDCAMS
     6         1   9         6   IEBGENER
     7         3  27         5   SORT
              11*100             *TOTAL*

 #35. vi stats/jcl2_PGM_ec_q0i7  <-- view report separately after running table3d
      =========================
Note
  • the report is named for the directory + keyword + separators + options
  • so you do not have to make up a unique name to avoid overwriting prior report

General Purpose Utilities

The example above used JCL to test/demo table3d. You may not have JCL, but we hope you can see how table3d might be used with whatever files, scripts,& programming languages you have.

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

4D1. UVtools.doc Vancouver Utility Conversion Aids

more about table3d, pre-programmed jobs vs specific uvcopy jobs

Pre-programmed jobs make it easy to apply the power of uvcopy to your data files - analyzing, selecting, searching/replacing, etc with more options & qualifications than are provided by the standard unix/linux system utilities.

You do not need to know the uvcopy instruction set to use general purpose pre-programmed jobs such as 'table3d', but we hope you will eventually learn the uvcopy instruction set, in case you find situations where you need more specific custom processing.

You can see the instruction file for 'table3d' at /home/uvadm/pf/util/table3d. It has over 250 instructions because it processes all files in a directory & provides many options to search for & qualify keywords & build sumary tables of following targetwords.

We will show you here a much simpler table summary job (tableIP) with only 14 essential instructions that creates the same table summry as did the previous 'table3d', but it is written specifically to table summarize IP#s following the word 'open' (vs the general purpose pre-programmed table3d which accepts arguments to summarize any desired item following any desired keyword for all files in directory).

'tableIP' is stored at /home/uvadm/pf/demo/tableIP & you can run as follows:


 #0a. login userxx --> /home/userxx
 #0b. cd demo      --> /home/usrxx/demo

 #1. uvcopy tableIP,fili1=archive/parms_ftps,filo1=stats/parms_ftps_tableIP
     ======================================================================
     - run demo job to summarize IP#s in 1 file & create table same as previous table3d
 # tableIP  2019/02/14_11:20:38  table summarize TCP/IP#s in FTP scripts
 # tbl#0001  tblt1   ax6(16)
 # line#     count  %    1strec#  FTP IP#
 #     1         1  25         2  192.168.0.4
 #     2         1  25         9  192.168.0.5
 #     3         2  50        17  192.168.0.6
 #               4*100             *TOTAL*

Since this reads only 1 file (vs all files in directory), we have concatenated the parms/ftp* files used for the previous table3d demo into 1 file stored in /home/uvadm/demo/archive/parms_ftps & you have copied to /home/userxx/demo/archive/...

See the 'tableIP' demo job listed on the next page:

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

4D2. more about table3d, pre-programmed jobs vs specific uvcopy jobs

tableIP - simplified table summary demo

 # tableIP - table summarize counts of unique TCP/IP#s in FTP scripts
 #         - uvcopy demo job, by Owen Townsend, UV Software, Feb 2019
 #         - demo job used in documentation www.uvsoftware.ca/topaids.htm#4C1
 #         - you can run from /home/uvadm/demo/... as follows:
 #
 # uvcopy tableIP,fili1=archive/parms_ftps,filo1=stats/parms_ftps_tableIP
 # ======================================================================
 # - read input fili1=..., build table of IP#s, write to output filo1=... at EOF
 #
 # uvcopy tableIP    <-- same as above, I/O files default as above
 # ==============
 #
 # 'tableIP' is a simplified version of 'table3d' general purpose pre-programmed job
 #   - to create table summaries of ANY item from ALL files in a directory
 #   - without needing to write any uvcopy instructions
 # 'tableIP' builds a table of 1 specific item from only 1 file
 #   - intended to demo the power of uvcopy & encourage you to learn uvcopy
 #   - will scan for lines with word 'open' known to precede the IP#
 #
 #  open 192.168.0.4   <-- scan for lines with 'open' known to precede the IP#
 #  open   192.168.0.5   - option 'c1' of sqzl1c1 ensures 1 blank between words
 #    open 192.168.0.6   - option 'l1' of sqzl1c1 ensures 1 blank in column 1
 #   open 192.168.0.6
 #
 opr='$jobname - table summarize TCP/IP#s in FTP scripts'
 rop=r1  # option for EOF prompt to view output file
 fili1=?archive/parms_ftps,rcs=256,typ=LST
 filo1=?stats/parms_ftps_tableIP,rcs=256,typ=LSTt
 @run
         opn     all
 # begin loop to get records, build table until EOF
 man20   get     fili1,a0               get next record into area 'a'
         skp>    man90                  (cc set > at EOF)
         sqzl1c1 a0(80),' '             ensure column 1 blank & 1 blank between words
         scn     a0(80),' open '        scan for ' open ' preceding IP#
         skp!    man20                  if not found - return to get next record
         tblt1   ax6(16),'FTP IP#'      build table counts in memory
         skp     man20                  return to get next record
 #
 # EOF - dump table to output file, close files, end job
 man90   tbpt1  filo1,'table summarize TCP/IP#s in FTP scripts'
         cls    all
         eoj
 #
 #        ** sample output - stats/parms_ftps_tableIP **
 # tableIP  2019/02/14_11:20:38  table summarize TCP/IP#s in FTP scripts
 # tbl#0001  tblt1   ax6(16)
 # line#     count  %    1strec#  FTP IP#
 #     1         1  25         2  192.168.0.4
 #     2         1  25         9  192.168.0.5
 #     3         2  50        17  192.168.0.6
 #               4*100             *TOTAL*

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

4D3. more about table3d, pre-programmed jobs vs specific uvcopy jobs

Notes re uvcopy demo job 'tableIP'

  1. You could use this demo job to learn a lot about the uvcopy instruction set.

  2. Some uvcopy instructions are similar to the IBM 360 Z/OS instruciton set, but uvcopy instructions are interpretive, no compile required, just edit & run.

  3. uvcopy gives you the power of assembler in an easy to use framework. In particular, this example will illustrate the power of index registers. uvcopy operands consist of an area (a-z), optionally an index register (a-z), and a displacement. For example op1 of 'tbl' is 'ax6' which is area 'a' + the displacement in register 'x' + the displacemnt coded ('6') in this example.

  4. 'scn' finds the word ' open ' & stores its displacment in index register 'x', which is then used as by 'tbl' to address the following word for tabling.

  5. All instructions are documented at https://uvsoftware.ca#uvcopy3.htm. The 1st page is an index with links to the various instructions. Here are direct links to some of the more interesting instructions in tableIP.
      https://uvsoftware.ca#uvcopy3.htm#sqz
      https://uvsoftware.ca#uvcopy3.htm#scn
      https://uvsoftware.ca#uvcopy3.htm#tbl
      https://uvsoftware.ca#uvcopy3.htm#tbp
  1. Here are a few notes about these 4 instructions use in tableIP & you can click on the links to see the complete doc on any of these.

 #7a. sqzl1c1 a0(80),' '             ensure column 1 blank & 1 blank between words
      =================
      - option 'l1' of sqzl1c1 ensures 1 blank in column 1
      - option 'c1' of sqzl1c1 ensures 1 blank between words
        so we can know that the word following ' open ' is exactly 6 bytes higher

 #7b. scn     a0(80),' open '        scan for ' open ' preceding IP#
      =======================
      - scn stores the zero relative displacemnt of ' open ' in register x.

 #7c. tblt1   ax6(16),'FTP IP#'      build table counts in memory
      ========================
      - tblt1 builds table#1 based on the 16 bytes located in area 'a'
        + displacment in register 'x' + 6 = area 'a' + 0 + 6
      - in this example, register 'x' will be 0 for ' open 192.168.0.4 ' since 'open'
        was 1st word on the line & sqzl1c1 has ensured the leading ' ' matching ' open '

 #7d. tbpt1  filo1,'table summarize TCP/IP#s in FTP scripts'
      ======================================================
      - tbpt1 (at EOF) dumps (Prints) the table to the output file (filo1=... above)
      - operand 2 supplies an extra heading for the table.

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

4E1. UVtools.doc Vancouver Utility Conversion Aids

table3d - create summaries of TABLEs in SQL scripts


 #0a. login userxx --> /home/userxx
 #0b. cd demo      --> /home/usrxx/demo

 #1a. l        <-- list subdirs in /home/userxx/demo
      ===
      drwxrwxr-x 2 userxx apps 4096 Feb 16 17:16 ctl
      drwxrwxr-x 2 userxx apps 4096 Feb 16 17:16 jcl2
      drwxrwxr-x 2 userxx apps 4096 Feb 16 17:16 jcl3
      drwxrwxr-x 2 userxx apps 4096 Feb 16 17:16 parms
      drwxrwxr-x 2 userxx apps 4096 Feb 16 17:16 rpts
      drwxrwxr-x 2 userxx apps 4096 Feb 16 17:16 sqls     <-- SQL scripts
      drwxrwxr-x 2 userxx apps 4096 Feb 16 17:16 stats
      drwxrwxr-x 2 userxx apps 4096 Feb 16 17:16 tmp
      drwxrwxr-x 2 userxx apps 4096 Feb 16 17:16 tmp1

 #1b. l sqls     <-- list files in sqls/...
 ===========
      -rw-rw-r-- 1 userxx apps  56 Feb 16 17:16 select_customers_all    <-- simple example
      -rw-rw-r-- 1 userxx apps  97 Feb 16 17:16 select_customers_basic
      -rw-rw-r-- 1 userxx apps 152 Feb 16 17:16 select_customers_WA     <-- PROBLEM
      -rw-rw-r-- 1 userxx apps 136 Feb 16 17:16 select_employee_dept123
      -rw-rw-r-- 1 userxx apps 115 Feb 16 17:16 select_employee_seattle
      -rw-rw-r-- 1 userxx apps  79 Feb 16 17:16 select_orders_big
      -rw-rw-r-- 1 userxx apps 306 Feb 16 17:16 select_patients_old
      -rw-rw-r-- 1 userxx apps 129 Feb 16 17:16 select_students_failing

We can use the known keyword 'FROM' to summarize the following SQL TABLE-name. For example here is the SELECT stmnt from the 1st of the 8 listed on the enxt page.

      SELECT * FROM Customers;

PROBLEM in SQL scripts for table3d

table3d expects the target-word (to be summarized) to follow the known key-word on the same line, as above, but consider the SELECT in the 3rd SQL script:

       SELECT custno, Name, Birthday, Phone,
       Address, City, Zip, LYsales,Discount, FROM   <-- PROBLEM
       Customers WHERE LYsales >5000;

Our solution is to precede 'table3d' with 'combine1d' which will combine the SQL SELECT statements onto 1 line using the ';' semi-colons that end SQL statements.

Note that combine1d is a general purpose utility & could be used for other file types that you may have. 'arg1=...' defines optional statement begin patterns (up to 8 words) and 'arg4=..." defines the END patterns (up to 8 words, not necessarily 1 character).

'arg2=...' defines up to 8 words that must be present for the stmnt to be selected and 'arg3=...' defines up to 8 words that must be absent for the stmnt to be selected.

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

4E2. table3d - create summaries of TABLEs in SQL scripts


 #1c. cat sqls/*  <-- display contents of files in sqls/...
      ==========
      /* select_customers_all */
          SELECT * FROM Customers;
      /* select_customers_basic */
          SELECT Name, Birthday, Phone,
          Address, Zip FROM Customers;
      /* select_customers_WA */
          SELECT custno, Name, Birthday, Phone,
          Address, City, Zip, LYsales,Discount, FROM
          Customers WHERE LYsales >5000;
      /* select_employee_dept123 */
         SELECT EMP_ID, NAME, ADDRESS, CITY, ZIP, DEPT FROM
         EMPLOYEE WHERE DEPT = '123' AND STATUS = 'FULL';
      /* select_employee_seattle */
         SELECT EMP_ID, LAST_NAME FROM EMPLOYEE
         WHERE CITY = 'Seattle' ORDER BY EMP_ID;
      /* select_orders_big */
          SELECT item FROM Orders
          WHERE quantity > 500;
      /* select_patients_old */
      /* Alternate Age selection comment out BEGIN
         SELECT Name, Age FROM Patients WHERE Age > 70
         GROUP BY Age ORDER BY Name;
         Alternate Age selection comment out END */
      /* SELECT patients_old; */
         SELECT Name, Age FROM Patients WHERE Age > 75
         GROUP BY Age ORDER BY Name;
      /* select_students_failing */
          CREATE VIEW Failing_Students AS
          SELECT S_NAME, Student_ID FROM
          STUDENT WHERE GPA < 30;

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

4E3. table3d - create summaries of TABLEs in SQL scripts

Here is our 1st attempt, will be incorrect, as explained above.


 #2. uvcopy table3d,fild1=sqls,arg1=FROM,uop=q0i7
     ============================================
      enter arg2 qualifier#1 (null=disable) ----->
      enter arg3 qualifier#2 (null=disable) ----->
      enter arg4 chars to blank before word sep (comma,equal,etc) -->
      190216:172356:table3d: EOF fili01 rds=3 size=79: sqls/select_orders_big hits=1
      190216:172356:table3d: EOF fili01 rds=2 size=56: sqls/select_customers_all hits=1
      190216:172356:table3d: EOF fili01 rds=3 size=97: sqls/select_customers_basic hits=1
      190216:172356:table3d: EOF fili01 rds=8 size=306: sqls/select_patients_old hits=2
      190216:172356:table3d: EOF fili01 rds=3 size=115: sqls/select_employee_seattle hits=1
      190216:172356:table3d: EOF fili01 rds=4 size=152: sqls/select_customers_WA
      190216:172356:table3d: EOF fili01 rds=4 size=129: sqls/select_students_failing
      190216:172356:table3d: EOF fili01 rds=3 size=136: sqls/select_employee_dept123
      190216:172356:table3d: EOF fild01 rds=10 size=4096: sqls hits=6
      190216:172356:table3d: EOF filo01 wrts=17 size=1153: stats/sqls_FROM
      EOJ, Output File written to: stats/sqls_FROM
      default command = null, OR enter: more,print,uvlpr12,edit,null --> cat
      # /home/userxx/demo/stats/sqls_FROM  <-- This report createdby uvcopy:
      # uvcopy table3d,fild1=sqls,arg1=FROM
      # =====================================================================
      # - scan all files in directory for a keyword & table countsof following word
      # InDir=sqls  Keyword=FROM  Qual1=   Qual2=
      # WordSepsBlank=  Options=q1a0b3c0d0f0j0l0m0p1x0w1
      # - default selects following word, use option w2 to table 2nd word, etc
      # - specify arg1=Keyword,arg2=Qualifier-present,arg2=Qualifier-absent
      # &\,$=/-:(.`);_*|" <--- arg4=special chars to blank
      # abcdefhklpqrsuAPQ <--- equivalents, easier to enter
      # Date=2019/02/16_17:23:52, Site=UV_Software, Host=uvsoft5, User=userxx
      #===============================================================================
      #---> uvcopy table3d,fild1=sqls,arg1=FROM
      table3d  2019/02/16_17:23:56  Counts by Targetword followingspecified Keyword
      tbl#0001  tblt1f7 e0(48)
      line#     count  %    1strec#  target-word
          1         2  33         2   Customers;
          2         1  16         2   EMPLOYEE
          3         1  16         2   Orders
          4         2  33         3   Patients
                    6*100             *TOTAL*

PROBLEM - some TABLE names missing ?

If you compare our 1st attempt above to the 8 sql files listed on page '4E2', you will see that there are some missing. This 1st attempt found only 4 TABLE-names, & 6 occurrences, but we know there are 5 TABLE-names & 8 occurrences.

'table3d' expects the target-word to be sumamrized (SQL TABLEname in this case) to directly follow the keyword ('FROM' in this case), BUT in 4 of the 8 sql files, the keyword 'FROM' is on the line preceding the line with the target-word (TABLEname).

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

4E4. table3d - create summaries of TABLEs in SQL scripts

Solution - combine SQL statements onto 1 line

We will use the uvcopy 'combine1d' utility to combine SQL statements onto 1 line. 'arg1=SELECT' will start combining lines until the 'arg4=;' end-of-stmnt marker found and 'arg2=FROM' must occur somewhere within the combined statement.

We will use 'combine1d' to combine the SQL stmtns from all files in sqls/... and write the output combined stmtns into the tmp1/... directory as follows:


 #2. uvcopy "combine1d,fild1=sqls,fild2=tmp1,arg1=SELECT,arg2=FROM,arg4=;",uop=d1r1"
     ===============================================================================
      - copy all files in sqls/* to tmp1/... combining multi-line SQL stmtns onto 1 line
      - we use option'd1' to drop /*...comments...*/ & option 'r1' to remove the ';' marker
      uop=d1r0t0 - option defaults
          d1     - drop /* ...comments... */
            r1   - remove stmt end pattern
              t0 - no case translation (t1 lower, t2 UPPER)
      190216:173101:combine1d: EOF fili01 rds=2 size=56: sqls/select_customers_all
      190216:173101:combine1d: EOF filo02 wrts=1 size=24: tmp1/select_customers_all
      190216:173101:combine1d: EOF fili01 rds=3 size=97: sqls/select_customers_basic
      190216:173101:combine1d: EOF filo02 wrts=1 size=58: tmp1/select_customers_basic
      190216:173101:combine1d: EOF fili01 rds=4 size=152: sqls/select_customers_WA
      190216:173101:combine1d: EOF filo02 wrts=1 size=111: tmp1/select_customers_WA
      190216:173101:combine1d: EOF fili01 rds=3 size=136: sqls/select_employee_dept123
      190216:173101:combine1d: EOF filo02 wrts=1 size=99: tmp1/select_employee_dept123
      190216:173101:combine1d: EOF fili01 rds=3 size=115: sqls/select_employee_seattle
      190216:173101:combine1d: EOF filo02 wrts=1 size=78: tmp1/select_employee_seattle
      190216:173101:combine1d: EOF fili01 rds=3 size=79: sqls/select_orders_big
      190216:173101:combine1d: EOF filo02 wrts=1 size=45: tmp1/select_orders_big
      190216:173101:combine1d: EOF fili01 rds=8 size=306: sqls/select_patients_old
      190216:173101:combine1d: EOF filo02 wrts=1 size=73: tmp1/select_patients_old
      190216:173101:combine1d: EOF fili01 rds=4 size=129: sqls/select_students_failing
      190216:173101:combine1d: EOF filo02 wrts=1 size=54: tmp1/select_students_failing
      190216:173101:combine1d: EOF fili03 rds=8 size=174: tmp/infiles
      190216:173101:combine1d: EOF fild01 size=4096: sqls
      190216:173101:combine1d: EOF fild02 size=4096: tmp1

 #2a. cat tmp1/*    <-- list contents of all output files from combine1d
      ==========
      SELECT * FROM Customers
      SELECT Name, Birthday, Phone, Address, Zip FROM Customers
      SELECT custno, Name, Birthday, Phone, Address, City, Zip, LYsales,Discount, FROM Customers WHERE LYsales >5000
      SELECT EMP_ID, NAME, ADDRESS, CITY, ZIP, DEPT FROM EMPLOYEE WHERE DEPT = '123' AND STATUS = 'FULL'
      SELECT EMP_ID, LAST_NAME FROM EMPLOYEE WHERE CITY = 'Seattle' ORDER BY EMP_ID
      SELECT item FROM Orders WHERE quantity > 500
      SELECT Name, Age FROM Patients WHERE Age > 75 GROUP BY Age ORDER BY Name
      SELECT S_NAME, Student_ID FROM STUDENT WHERE GPA < 30
Note
  • options default to d1 (drop /*...comments...*/) & r1 (remove end stmnt ';')
  • you might rerun using option d0 (to NOT drop /*...cmts...*/)
  • which would report SELECT stmnt TABLEs found in /*...cmts...*/

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

4E5. table3d - create summaries of TABLEs in SQL scripts

now, use table3d to create correct table summary

We will specify the input directory as tmp1/... (output from combine1d above), and the report output of table3d defaults to stats/... Note that table3d names the output report by concatenating the input directory (now tmp1) + the keyword, so in this case the output report will be 'stats/tmp1_FROM'. You could name the output file by ading 'filo1=sqls_FROM' to the command below:


 #3. uvcopy table3d,fild1=tmp1,arg1=FROM,uop=q0i7
     ============================================
      enter arg2 qualifier#1 (null=disable) ----->
      enter arg3 qualifier#2 (null=disable) ----->
      enter arg4 chars to blank before word sep (comma,equal,etc) -->
      190216:180243:table3d: EOF fili01 rds=1 size=45: tmp1/select_orders_big hits=1
      190216:180243:table3d: EOF fili01 rds=1 size=24: tmp1/select_customers_all hits=1
      190216:180243:table3d: EOF fili01 rds=1 size=58: tmp1/select_customers_basic hits=1
      190216:180243:table3d: EOF fili01 rds=1 size=73: tmp1/select_patients_old hits=1
      190216:180243:table3d: EOF fili01 rds=1 size=78: tmp1/select_employee_seattle hits=1
      190216:180243:table3d: EOF fili01 rds=1 size=111: tmp1/select_customers_WA hits=1
      190216:180243:table3d: EOF fili01 rds=1 size=54: tmp1/select_students_failing hits=1
      190216:180243:table3d: EOF fili01 rds=1 size=99: tmp1/select_employee_dept123 hits=1
      190216:180243:table3d: EOF fild01 rds=10 size=4096: tmp1 hits=8
      190216:180243:table3d: EOF filo01 wrts=18 size=1214: stats/tmp1_FROM
      EOJ, Output File written to: stats/tmp1_FROM
      default command = null, OR enter: more,print,uvlpr12,edit,null --> cat
      # /home/userxx/demo/stats/tmp1_FROM  <-- This report createdby uvcopy:
      # uvcopy table3d,fild1=tmp1,arg1=FROM,uop=q0i7
      # =====================================================================
      # - scan all files in directory for a keyword & table countsof following word
      # InDir=tmp1  Keyword=FROM  Qual1=   Qual2=
      # WordSepsBlank=  Options=q1a0b3c0d0f0j0l0m0p1x0w1q0i7
      # - default selects following word, use option w2 to table 2nd word, etc
      # - specify arg1=Keyword,arg2=Qualifier-present,arg2=Qualifier-absent
      # &\,$=/-:(.`);_*|" <--- arg4=special chars to blank
      # abcdefhklpqrsuAPQ <--- equivalents, easier to enter
      # Date=2019/02/16_18:02:42, Site=UV_Software, Host=uvsoft5, User=userxx
      #===============================================================================
      #---> uvcopy table3d,fild1=tmp1,arg1=FROM,uop=q0i7
      table3d  2019/02/16_18:02:43  Counts by Targetword followingspecified Keyword
      tbl#0001  tblt1f7 e0(48)
      line#     count  %    1strec#  target-word
          1         3  37         1   Customers
          2         2  25         1   EMPLOYEE
          3         1  12         1   Orders
          4         1  12         1   Patients
          5         1  12         1   STUDENT
                    8*100             *TOTAL*

Now you can see that we are reporting TABLE-names found in all 8 SQL scripts (3 have Customers, 2 have EMPLOYEE,& others have only 1 TABLE-name in the script).

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

Part_5. UVtools.doc Vancouver Utility Conversion Aids

Part 5 - Search/Replace - Contents


5A1. scan1d pre-programmed job to scan all files in a directory
- searching for 1 pattern & creating a report matching lines

5B1. rep1d pre-programmed job to search for 1 pattern & replace with an alternate
- while copying all files from 1 directory to a 2nd (empty) directory

5B2. rep2d pre-programmed job to search for multiple patterns & replace with alternates
- uses a pre-edited table of search/replace patterns
- while copying all files from 1 directory to a 2nd (empty) directory

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

5A1. UVtools.doc Vancouver Utility Conversion Aids

scan1d - scan all files in directory reporting matches to 1 pattern

'scan1d' is a pre-programmed uvcopy job to scan all files in a directory searching for 1 pattern & reporting matches. Of course you would usually do this with 'grep' but you could use scan1d when you want a nicer report or you want to qualify the matches by 1 or 2 other patterns that must be present or absent on the same line.

We will demo scan1d using the FTP demo files in demo/parms/... All 4 files are listed on page '1C3', but here is the 1st 1 as a reminder.

      # parms/ftpdemo1a
      open 192.168.0.4
      user user01 user01pw
      lcd data1
      get /home/userxx/ar/sales.items

 #0a. login userxx --> /home/userxx
 #0b. cd demo      --> /home/usrxx/demo

 #1. uvcopy scan1d,fild1=parms,arg1=open,filo1=tmp/parms_open
     ========================================================
      - scan all files in parms/... reporting matches to 'open'
      - output report as follows:
      Job: scan1d  Dir: parms  Search: open  Qual1:   Qual2:
       SearchBgn:    SearchEnd:    MatchOps:   UserOps: q1a1b99999c0d256e0p1
      ====================================================== 2019/02/15_11:17:53
      00002 open 192.168.0.4
      00007                   1 hits @EOF: parms/ftpdemo1a
      00002 open 192.168.0.5
      00008                   1 hits @EOF: parms/ftpdemo1b
      00002 open 192.168.0.6
      00009                   1 hits @EOF: parms/ftpget1
      00002 open 192.168.0.6
      00009                   1 hits @EOF: parms/ftpput1
      ====================================================== 2019/02/15_11:17:53
       EOD: 00004 hits in 0004 files of 0004 total (00033 lines)

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

5B1. UVtools.doc Vancouver Utility Conversion Aids

rep1d - search/replace 1 pattern copying all files to 2nd directory

'rep1d' is a pre-programmed uvcopy job to scan all files in a directory searching for 1 pattern & replacing with an alternate. You would usually use 'sed' for this, but rep1d could be used when you need to qualify the replacements by 1 or 2 other patterns that must be present or absent on the same line.


 #1. uvcopy rep1d,fild1=parms,fild2=tmp1,arg1=192.168.0.6,arg2=\$IP6
                             ,filo1=tmp/parms_192.168.0.6
     ===============================================================
      - copy files from parms/* to tmp1/... replacing IP '192.168.0.6' with '$IP6'
      - outupt dir defaults to tmp1/... & audit file defaults to tmp/${fild1}_$arg1
      - the audit file shows the line after the replacement has been made

output audit file

      Job: rep1d InDir: parms OutDir: tmp1 Search: 192.168.0.6 Replace: $IP6
      QualPresent:   Absent:   SearchBgn:    SearchEnd:
      MatchOptions:   UserOptions: q1a1b99999c0d256e0p1
      ====================================================== 2019/02/15_11:21:34
      00002 open $IP6
      00009                   1 reps @EOF: tmp1/ftpget1
      00002 open $IP6
      00009                   1 reps @EOF: tmp1/ftpput1
      ====================================================== 2019/02/15_11:21:34
      EOD: 2 reps in 2 files of 4 total (33 lines)
      Audit filename: tmp/parms_192.168.0

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

5B2. UVtools.doc Vancouver Utility Conversion Aids

rep2d search/replace multiple patterns copying all files to 2nd dir

'rep2d' is a pre-programmed uvcopy job to copy all files in a directory to a 2nd directory, searching/replacing via a table of multiple search/replace patterns, optionally qualified by patterns that must be present or absent on the same line.

You would pre-edit the search/replace table, as shown in the demo below: I suggest you use the demo/ctl/ subdir to store your search/replace tables.


 #1. vi ctl/ipupdate_demo   <-- edit search/replace table for multiple IP#s
     ====================
      # ipupdate_demo - table of search/replace IP#s stored in /home/uvadm/demo/ctl/ipupdate
      #               - to demo uvcopy 'rep2d' search/replace by table of old/new patterns
      #               - by Owen Townsend, UV Software, Feb15/2019
      #               - see www.uvsoftware.ca/topaids.htm
      # 01-30=search, 31-60=replace,61-80=qualifier_present,81-100=qualifier_absent
      #
      192.168.0.4~~~~~~~~~~~~~~~~~~~$IP4~~~~~~~~~~~~~~~~~~~~~~~~~~open~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      192.168.0.5~~~~~~~~~~~~~~~~~~~$IP5~~~~~~~~~~~~~~~~~~~~~~~~~~open~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      192.168.0.6~~~~~~~~~~~~~~~~~~~$IP6~~~~~~~~~~~~~~~~~~~~~~~~~~open~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Note
  • the # comment lines will be ignored by the 'rep2d' job.
  • the non-comment search/replace patterns will be shown in the audit file

 #2. uvcopy rep2d,fild1=parms,fild2=tmp1,fili3=ctl/ipupdate_demo
                             ,filo1=tmp/parms_ipupdate_demo
     ===============================================================
      - copy all files from parms/* to tmp1/... searching/replacing via the table
        of multiple patterns stored in ctl/ipupdate_demo (specify with fili3=...)
      - here is the audit file, showing the search/replace table used & only
        the modified lines after replacements made
      Job: rep2d  InDir: parms  OutDir: tmp1  Table: ctl/ipupdate_demo
      SearchBgn:    SearchEnd:    MatchOptns: df2g2  UserOptns: q1a1b99999c0d256e0p1
      ====================================================== 2019/02/15_11:41:25
      192.168.0.4~~~~~~~~~~~~~~~~~~~$IP4~~~~~~~~~~~~~~~~~~~~~~~~~~open~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      192.168.0.5~~~~~~~~~~~~~~~~~~~$IP5~~~~~~~~~~~~~~~~~~~~~~~~~~open~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      192.168.0.6~~~~~~~~~~~~~~~~~~~$IP6~~~~~~~~~~~~~~~~~~~~~~~~~~open~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      ====================================================== 2019/02/15_11:41:25
      00002 open $IP4
      00007                   1 reps @EOF: tmp1/ftpdemo1a
      00002 open $IP5
      00008                   1 reps @EOF: tmp1/ftpdemo1b
      00002 open $IP6
      00009                   1 reps @EOF: tmp1/ftpget1
      00002 open $IP6
      00009                   1 reps @EOF: tmp1/ftpput1
      ====================================================== 2019/02/15_11:41:25
       EOD: 00004 reps in 0004 files of 0004 total (00033 lines)
      Audit filename: tmp/parms_ipupdate_demo

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

Permuted Index of Keywords from ** Headings **

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z 

1C2 $home: copy demo files to your $HOME/demo

1B2 .bash_profile: for userxx

2C1 Accented: dat1/accents1 - French UTF-8 accented characters
2C2 Accented: Investigating Accented Characters with 'uvhd'
2C3 Accented: Notes re UTF-8 French Accented Characters
2C4 Accented: converting accented characters to unaccented equivalents
2C6 Accented: converting accented characters with 'uvcp'
2C7 Accented: converting accented characters with 'uvfix1'
2C1 Accents1: dat1/accents1 - French UTF-8 accented characters
1C1 Account: setup user account to run demos
1B4 Advantages: Advantages of stub_profile,& common_profile
2C1 Applications: high-bit characters may cause problems for old applications
4C1 Arguments: Notes re arguments & options
2D2 Ascii: Notes Re option 'a' translate EBCDIC to ASCII
2E1 Ascii: uvcp - translate to ASCII & insert LineFeeds at same time
2E1 Ascii: uvcp demo - translate to ASCII (& insert LineFeeds)
5B1 Audit: output audit file

2B4 Carriage: Fixing the problem - Removing Carriage Returns (CRs)
2C1 Cause: high-bit characters may cause problems for old applications
2C1 Characters: dat1/accents1 - French UTF-8 accented characters
2C1 Characters: high-bit characters may cause problems for old applications
2C2 Characters: Investigating Accented Characters with 'uvhd'
2C3 Characters: Notes re UTF-8 French Accented Characters
2C4 Characters: converting accented characters to unaccented equivalents
2C6 Characters: converting accented characters with 'uvcp'
2C7 Characters: converting accented characters with 'uvfix1'
4E4 Combine: Solution - combine SQL statements onto 1 line
4C1 Command: now execute the table3d command
1B4 Common_profile: Advantages of stub_profile,& common_profile
1B3 Common_profile_abc: for VU users
1C2 Copy: demo files to your $HOME/demo
5B1 Copying: rep1d - search/replace 1 pattern copying all files to 2nd directory
5B2 Copying: rep2d search/replace multiple patterns copying all files to 2nd dir
4E5 Correct: now, use table3d to create correct table summary
2B10 Crs: 5. Remove CRs with 'uvfixA' pre-programmed uvcopy job
2B4 Crs: Fixing the problem - Removing Carriage Returns (CRs)
2B5 Crs: 1. Remove CRs using script 'removeCR'
2B5 Crs: Alternate solutions (vs uvhd) to Remove CRs from files
2B6 Crs: 2. Remove CRs using 'uvcp'
2B7 Crs: 3. Remove CRs using 'uvcopy'
2B9 Crs: 4. Remove CRs with 'uvfix1' pre-programmed uvcopy job

2C1 Dat1: dat1/accents1 - French UTF-8 accented characters
1D1 Data: demo input files - DATA files
2B3 Default: Notes re uvhd (display above) with default options
1C2 Demo: copy demo files to your $HOME/demo
1C2 Demo: copy demo files to your $HOME/demo
1D1 Demo: input files - DATA files
1D2 Demo: input files - FTP scripts
1D3 Demo: input files - SQL scripts
1D4 Demo: input files - pf
1D4 Demo: input files - sf
1D5 Demo: input files - JCL
2B1 Demo: uvhd demo - investigating problem files
2D1 Demo: uvhd demo - investigating unknown files
2E1 Demo: uvcp demo - translate to ASCII (& insert LineFeeds)
4D2 Demo: tableIP - simplified table summary demo
4D3 Demo: Notes re uvcopy demo job 'tableIP'
1C1 Demos: setup user account to run demos
4B1 Different: Rerun table3d experimenting with different options
1C1 Dir: Alternative - setup subdir in your home dir
5B2 Dir: rep2d search/replace multiple patterns copying all files to 2nd dir
1C2 Directories: llr lists directories 1st
1C2 Directories: llr lists files within directories
5A1 Directory: scan1d - scan all files in directory reporting matches to 1 pattern
5B1 Directory: rep1d - search/replace 1 pattern copying all files to 2nd directory
2B3 Display: Notes re uvhd (display above) with default options

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

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z 

2D2 Ebcdi: Notes Re option 'a' translate EBCDIC to ASCII
1B1 Env: 'profiles' provided in /home/uvadm/env
2C4 Equivalents: converting accented characters to unaccented equivalents
4C1 Execute: now execute the table3d command
4B1 Experimenting: Rerun table3d experimenting with different options

2B4 Fixing: Fixing the problem - Removing Carriage Returns (CRs)
2C1 French: dat1/accents1 - French UTF-8 accented characters
2C3 French: Notes re UTF-8 French Accented Characters
1D2 Ftp: demo input files - FTP scripts
4A1 Ftp: table3d - create summary table of IP#s in FTP scripts
4B1 Ftp: create table summary of FTP userids & passwords

4C1 General: General Purpose Utilities

2C1 High-bit: characters may cause problems for old applications
1B1 Home: 'profiles' provided in /home/uvadm/env
1C1 Home: Alternative - setup subdir in your home dir
1A2 Homedir: Vancouver Utilities homedir contents

2E1 Insert: uvcp - translate to ASCII & insert LineFeeds at same time
2E1 Insert: uvcp demo - translate to ASCII (& insert LineFeeds)
1A3 Installing: Installing Vancouver Utilities - Summary
2B1 Investigating: uvhd demo - investigating problem files
2C2 Investigating: Investigating Accented Characters with 'uvhd'
2D1 Investigating: uvhd demo - investigating unknown files
4A1 Ip: table3d - create summary table of IP#s in FTP scripts

4E4 Line: Solution - combine SQL statements onto 1 line
2E1 Linefeed: uvcp - translate to ASCII & insert LineFeeds at same time
2E1 Linefeeds: uvcp demo - translate to ASCII (& insert LineFeeds)
1C2 Lists: llr lists directories 1st
1C2 Lists: llr lists files within directories
1C2 Llr: lists directories 1st
1C2 Llr: lists files within directories
4A1 Logic: table3d Logic

5A1 Matche: scan1d - scan all files in directory reporting matches to 1 pattern
2C1 May: high-bit characters may cause problems for old applications
4E3 Missing: PROBLEM - some TABLE names missing ?

4C1 Now: execute the table3d command
4E5 Now: now, use table3d to create correct table summary

2C1 Old: high-bit characters may cause problems for old applications
4E4 Onto: Solution - combine SQL statements onto 1 line
2D2 Option: Notes Re option 'a' translate EBCDIC to ASCII
2B3 Options: Notes re uvhd (display above) with default options
4B1 Options: Rerun table3d experimenting with different options
4C1 Options: Notes re arguments & options

4B1 Passwords: create table summary of FTP userids & passwords
5A1 Pattern: scan1d - scan all files in directory reporting matches to 1 pattern
5B1 Pattern: rep1d - search/replace 1 pattern copying all files to 2nd directory
5B2 Patterns: rep2d search/replace multiple patterns copying all files to 2nd dir
2B10 Pre-programmed: 5. Remove CRs with 'uvfixA' pre-programmed uvcopy job
2B9 Pre-programmed: 4. Remove CRs with 'uvfix1' pre-programmed uvcopy job
4D1 Pre-programmed: more about table3d, pre-programmed jobs vs specific uvcopy jobs
2B1 Problem: uvhd demo - investigating problem files
2B4 Problem: Fixing the problem - Removing Carriage Returns (CRs)
4E1 Problem: PROBLEM in SQL scripts for table3d
4E3 Problem: PROBLEM - some TABLE names missing ?
2C1 Problems: high-bit characters may cause problems for old applications
1B1 Profiles: 'profiles' provided in /home/uvadm/env
4C1 Program: table3d - create summary table of programs in JCL
1B1 Provided: 'profiles' provided in /home/uvadm/env

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

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z 

2B10 Remove: 5. Remove CRs with 'uvfixA' pre-programmed uvcopy job
2B5 Remove: 1. Remove CRs using script 'removeCR'
2B5 Remove: Alternate solutions (vs uvhd) to Remove CRs from files
2B6 Remove: 2. Remove CRs using 'uvcp'
2B7 Remove: 3. Remove CRs using 'uvcopy'
2B9 Remove: 4. Remove CRs with 'uvfix1' pre-programmed uvcopy job
2B5 Removecr: 1. Remove CRs using script 'removeCR'
2B4 Removing: Fixing the problem - Removing Carriage Returns (CRs)
5B1 Rep1d: - search/replace 1 pattern copying all files to 2nd directory
5B2 Rep2d: search/replace multiple patterns copying all files to 2nd dir
5B1 Replace: rep1d - search/replace 1 pattern copying all files to 2nd directory
5B2 Replace: rep2d search/replace multiple patterns copying all files to 2nd dir
5A1 Reporting: scan1d - scan all files in directory reporting matches to 1 pattern
4B1 Rerun: Rerun table3d experimenting with different options
2C5 Results: Results Before & After conversion
2B4 Returns: Fixing the problem - Removing Carriage Returns (CRs)
1C1 Run: setup user account to run demos

2E1 Same: uvcp - translate to ASCII & insert LineFeeds at same time
5A1 Scan: scan1d - scan all files in directory reporting matches to 1 pattern
5A1 Scan1d: - scan all files in directory reporting matches to 1 pattern
5B1 Search: rep1d - search/replace 1 pattern copying all files to 2nd directory
5B2 Search: rep2d search/replace multiple patterns copying all files to 2nd dir
1C1 Setup: Alternative - setup subdir in your home dir
1C1 Setup: user account to run demos
4D2 Simplified: tableIP - simplified table summary demo
4E4 Solution: Solution - combine SQL statements onto 1 line
2B5 Solutions: Alternate solutions (vs uvhd) to Remove CRs from files
4E3 Some: PROBLEM - some TABLE names missing ?
4D1 Specific: more about table3d, pre-programmed jobs vs specific uvcopy jobs
1D3 Sql: demo input files - SQL scripts
4E1 Sql: PROBLEM in SQL scripts for table3d
4E1 Sql: table3d - create summaries of TABLEs in SQL scripts
4E4 Sql: Solution - combine SQL statements onto 1 line
4E4 Statements: Solution - combine SQL statements onto 1 line
1B4 Stub_profile: Advantages of stub_profile,& common_profile
1C1 Subdir: Alternative - setup subdir in your home dir
4E1 Summaries: table3d - create summaries of TABLEs in SQL scripts
1A3 Summary: Installing Vancouver Utilities - Summary
4A1 Summary: table3d - create summary table of IP#s in FTP scripts
4B1 Summary: create table summary of FTP userids & passwords
4C1 Summary: table3d - create summary table of programs in JCL
4D2 Summary: tableIP - simplified table summary demo
4E5 Summary: now, use table3d to create correct table summary

4A1 Table: table3d - create summary table of IP#s in FTP scripts
4B1 Table: create table summary of FTP userids & passwords
4C1 Table: table3d - create summary table of programs in JCL
4D2 Table: tableIP - simplified table summary demo
4E1 Table: table3d - create summaries of TABLEs in SQL scripts
4E3 Table: PROBLEM - some TABLE names missing ?
4E5 Table: now, use table3d to create correct table summary
4A1 Table3d: - create summary table of IP#s in FTP scripts
4A1 Table3d: Logic
4B1 Table3d: Rerun table3d experimenting with different options
4C1 Table3d: now execute the table3d command
4C1 Table3d: - create summary table of programs in JCL
4D1 Table3d: more about table3d, pre-programmed jobs vs specific uvcopy jobs
4E1 Table3d: PROBLEM in SQL scripts for table3d
4E1 Table3d: - create summaries of TABLEs in SQL scripts
4E5 Table3d: now, use table3d to create correct table summary
4D2 Tableip: tableIP - simplified table summary demo
4D3 Tableip: Notes re uvcopy demo job 'tableIP'
2B5 To: Alternate solutions (vs uvhd) to Remove CRs from files
2D2 Translate: Notes Re option 'a' translate EBCDIC to ASCII
2E1 Translate: uvcp - translate to ASCII & insert LineFeeds at same time
2E1 Translate: uvcp demo - translate to ASCII (& insert LineFeeds)

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

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z 

2C4 Unaccented: converting accented characters to unaccented equivalents
2D1 Unknown: uvhd demo - investigating unknown files
2B4 Updating: Notes re Updating with uvhd
1C1 User: setup user account to run demos
4B1 Userids: create table summary of FTP userids & passwords
1B3 Users: common_profile_abc for VU users
1B2 Userxx: .bash_profile for userxx
2C1 Utf-8: dat1/accents1 - French UTF-8 accented characters
2C3 Utf-8: Notes re UTF-8 French Accented Characters
1A2 Utilities: Vancouver Utilities homedir contents
1A3 Utilities: Installing Vancouver Utilities - Summary
4C1 Utilities: General Purpose Utilities
1B1 Uvadm: 'profiles' provided in /home/uvadm/env
2A1 Uvcopy: 6. uvcopy
2B10 Uvcopy: 5. Remove CRs with 'uvfixA' pre-programmed uvcopy job
2B7 Uvcopy: 3. Remove CRs using 'uvcopy'
2B8 Uvcopy: Notes re uvcopy jobs
2B9 Uvcopy: 4. Remove CRs with 'uvfix1' pre-programmed uvcopy job
4D1 Uvcopy: more about table3d, pre-programmed jobs vs specific uvcopy jobs
4D3 Uvcopy: Notes re uvcopy demo job 'tableIP'
2A1 Uvcp:
2B6 Uvcp: 2. Remove CRs using 'uvcp'
2C6 Uvcp: converting accented characters with 'uvcp'
2E1 Uvcp: - translate to ASCII & insert LineFeeds at same time
2E1 Uvcp: demo - translate to ASCII (& insert LineFeeds)
2B9 Uvfix1: 4. Remove CRs with 'uvfix1' pre-programmed uvcopy job
2C7 Uvfix1: converting accented characters with 'uvfix1'
2B10 Uvfixa: 5. Remove CRs with 'uvfixA' pre-programmed uvcopy job
2A1 Uvhd:
2B1 Uvhd: demo - investigating problem files
2B3 Uvhd: Notes re uvhd (display above) with default options
2B4 Uvhd: Notes re Updating with uvhd
2B5 Uvhd: Alternate solutions (vs uvhd) to Remove CRs from files
2C2 Uvhd: Investigating Accented Characters with 'uvhd'
2D1 Uvhd: demo - investigating unknown files
2A1 Uvlist:
2A1 Uvsort:

1A2 Vancouver: Vancouver Utilities homedir contents
1A3 Vancouver: Installing Vancouver Utilities - Summary

1C2 Within: llr lists files within directories

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z 

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

Visitor Counters for ThisYear and LastYear