CNVaids.doc - JCL/COBOL/DATA Conversion/Test/Debug Aids

CNVaids.doc - Contents by Part#


Part_0 - Introduction & Overview
- make new users aware of utilties available
- give short examples of utilities
- with references to complete doc elsewhere

Part_1 - General Purpose aids, using Unix/Linux utilities
- profiles, stub_profile & common_profile make administration easier
- scripts to rename all files in directory saves multi hours & keystrokes
- renameL to lower case, renameU to UPPer case,
- renameX change extension, rename+X add ext, rename-X remove ext
- directory & file listing scripts & storage used scripts
- 'dtree' diagrams directory trees, great for documentation
- diff & alldiff (text file comparisons)
- dos2unix/unix2dos utilities to insert/remove Carriage Returns
- backup scripts scheduled by cron
- script 'cfl' to Count Files & Lines in a subdir (handy tool)
- statdir1 report subdir/file counts & total KB on all levels of superdir
- dd Unix/Linux Data utility, use when you need more than 'cp'
- other Unix/Linux aids documented in ADMjobs.htm#Part_7
  (chmod_custom1 to ensure permissions OK for nightly batch runs)
- other Unix/Linux aids documented in ADMjobs.htm#Part_8
  (FTP,SSH,PUTTY,SAMBA,who,w,df,du,wall,write,mail)

Part_2 - General Purpose scripts calling Vancouver Utility programs
- 'uvlp' scripts list text files at various cpi & lpi (uvlp12,uvlp14,etc)
  print 132 cols x 66 lines Landscape/Duplex with uvlp13L/uvlp13LD
- 'spreadA' to list all filenames in directories 4-up
- 'cleanup' for COBOL & JCL, clear 73-80, convert CR/LF to LF, etc
- 'verifytext' scan text files for non-printable characters

Part_3 - Cross-References (for COBOL & JCL)
xcobcopy1 - list all 'copy'books used in each program
xcobcopy2 - shows all programs using each 'copy'book
xcobcall1 - list all 'call'ed programs in each program
xcobcall2 - shows all programs 'call'ing each program
xcobfile2 - crossref all PROGRAMS using each external-file
xcobsql1 - list all SQL Includes in any 1 PROGRAM
xcobsql2 - crossref all PROGRAMS using any 1 SQL Include
xkshfile1 - list all datafiles in each JCL/ksh/script
xkshfile2 - shows all JCL/ksh/scripts using each data-file
xkshprog1 - list all programs executed in each JCL/ksh/script
xkshprog2 - shows all JCL/ksh/scripts executing each program
xkshproc1 - list all PROCs executed in each JCL/ksh/script
xkshproc2 - shows all JCL/ksh/scripts executing each PROC
xkshparm1 - list all SYSIN/PARM modules in each JCL/ksh/script
xkshparm2 - shows all JCL/ksh/scripts referencing each SYSIN/PARM
xrefall - script to run all cross-ref reports

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

CNVaids.doc - JCL/COBOL/DATA Conversion/Test/Debug Aids

CNVaids.doc - Contents (continued)


Part_4 - Table Summaries & Statistics (JCL, logins, record-sizes, etc)
statallmvs1 - table summaries of MVS COBOL, JCL,& Korn shell scripts
statallmvs1 - table summaries of VSE COBOL, JCL,& Korn shell scripts
statmvsjcl1 - table summarize programs & top-nodes in all MVS JCLs
statvsejcl1 - table summarize programs & top-nodes in all VSE JCLs
statksh1 - table summarize programs & top-nodes in all JCL/scripts
statlogin1 - create table summary of user logins by month & userid.
table2 - general purpose table summary by any argument & 2 acums
table3d - table summary via 'key-word', preceding a 'target-word'.
tblexts1 - table summary counts of file extensions in a subdir
- can use on cblx/*.err to calc compile failure percentage
recsizes1 - create summary table of record-sizes in a text file

Part_5 - COBOL Aids
- See COBOL cross-references in Part_3
- statcbl1 table summarize COBOL copybooks & called programs
  (counts copybooks & called program found in all programs)
- cobfil51 COBOL files report I/O info for all files in all programs
- converting copybooks into record layouts (cobmaps)
- Micro Focus COBOL Animation (debugging)
- Micro Focus Error messages (File status & Runtime errmsgs)

Part_6 - JCL/script Test/Debug aids
- jobflow51 creates jobflow reports (datafile I/O step by step)
- capture joblogs (console log for 1 job at a time)
- clear output directories to aid test/debug
- providing separate sets of testdata for different programmers

Part_7 - Vancouver Utility Data file aids (investigate/manipulate data files)
- 'uvhd' utility to display datafiles with packed/binary fields
- 'uvhdcob' to display COBOL copybook fieldnames beside data contents
  uvhdcob 'v' command to verify character, numeric,& packed data fields
- 'uvcp' utility, copy datafiles converting file types, record sizes, etc
- 'uvcpF2L' script to convert Fixed record length to Line sequential text
- 'uvcpL2F' script to convert Line sequential text to Fixed record length
- data file comparison utilities for fixed/variable/Indexed packed/binary
  uvcmp1,2,3 (cannot used diff for these non-text mainframe type files)
- listing fixed length records in character or hexadecimal
- VTOC report utility to show record counts in directories
  (unix utilties only show filesizes in bytes)
- 'uvsort' provides most SYNCSORT features at a much lower price
- 'uvlist' to list text files (scripts, programs, etc)
- 'uvlist' as a filter to remove control codes, multi-blanks, etc
- 'uxcp' to convert mainframe EBCDIC variable files to ASCII Indexed

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

CNVaids.doc - JCL/COBOL/DATA Conversion/Test/Debug Aids

CNVaids.doc - Contents (continued)


Part_8 - uvcopy, the most powerful Vancouver utility
- pre-programmed jobs to help you solve data file problems
acum1 - accumulate any 1 field in any datafile
- hash total to prove file validity after conversions
  or to get a 2nd opinion when COBOL reports look suspicious
cmrpt1 - customer master sales report for test file dat1/custmas1
  (used to demo both acum1 above & selectf1 below)
selectf1 - select records depending on field value <=> 2 spcfd values.
- prompts for field displacement,length,type,number,& values.
scan5d - job to scan all files in a directory, searching for exceptions.
- specify exception conditons in a control file of patterns
  & minimum/maximum counts. Example to find COBOL programs with
  more than 1 'PROCEDURE DIVISION' or with any (> 0) 'EXEC SQL's
 splitjclproc1 - split subdir of mixed JCLs & PROCs to separate subdirs
  - used to separate emailed zip files of mixed JCLs & PROCs
  - JCL conversion requires JCLs & PROCs in separate subdirs
  - demos uvcopy ability to read directories & process files
 splitcblcpy - split subdir of mixed COBOL programs & copybooks to
  separate subdirs (required for COBOL conversions&compiles)
grepx1 - extract filenames from grep output, sort,& data reduce
  to 1 line for multiple occurrences in same file
- option to insert 'vi' prior to each filename in output file
- saves typing when you need to investigate & possibly change
- example given for mannframe COBOL covnersion
  (may need to change 'accept from date' for unix COBOL)

Part_9 - Aids & Tips for users new to Unix/Linux
- 'vi' essentials tutorial
- good housekeeping recommendations
- working directories, sub-directories & files

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

Part_0 CNVaids.doc JCL/COBOL/DATA Conversion/Test/Debug Aids

Introduction & Overview

This document is intended to make you aware of the many conversion, testing, & debugging aids supplied by the Vancouver Utilities. I believe you will find many of these aids essential to the success of your conversion project.

These aids were originally in several documents (MVSJCL,MVSCOBOL,MVSDATA,etc). In January 2008, this separate document (CNVaids) was created to avoid the duplications in the original documents, which now have links to this document.

Many of these aids are illustrated using supplied test/demo files & you can run many of these once you have installed the Vancouver Utilities. These 'practice sessions' will help you when you start working on your own conversions of JCL, COBOL,& DATA files.

Links to other documents

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.

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

Part_1. CNVaids.doc Vancouver Utility Conversion Aids

Unix/Linux Aids - Contents

 1A1. Profiles - profiles & related files provided in /home/uvadm/env/...
               - setup user appsadm & copy to /home/appsadm/env/...
    common_defines - defines TESTLIBS,TESTDATA,PRODLIBS,PRODDATA,etc
    stub_profile   - defines RUNLIBS=TESTLIBS/TESTDATA, RUNDATA=PRODLIBS/PRODDATA
                   - copied to homedirs, renamed as .bash_profile or .profile
    common_profile - defines PATHs using RUNLIBS/RUNDATA

1B1. aliases - 'aliases make life easier
- alias rm,mv,cp to confirm remove or overwrite y/n
- cdd & cdl to switch easily between RUNDATA & RUNLIBS

1C1. renameX - scripts to rename all files in a directory
- renameL to lower case, renameU to UPPer case,
- renameX change extension, rename+X add ext, rename-X remove ext
- save a lot of keystrokes working with many & long filenames

1D1. dtree - draw directory tree from any specified starting directory
- see demo & try it yourself

1E1. llr - script to list All levels of directories & files within
- useful for displaying jobtmp subdirs when testing JCL/scripts

1F1. cfl - Count Files & Lines in a directory, option to print (uvlp12)
1F2. statdir1 - report file counts & KB used in any directory & all subdirs
- uses 'find' to report all levels in the directory tree

1G1. diff - unix/linux utility to compare 2 text files
- marvelous utility, shows changes, inserts & deletes

1G2. alldiff - script using 'diff' to compare all files in 2 directories
- great for confirming results of mass changes to directories
  of JCL/scripts or COBOL source programs
- this script is supplied in /home/uvadm/sf/util/alldiff2
- it employs the marvelous unix/linux system 'diff' utility,
  repeating it for each pair of files found in the 2 directories.

1H1. grep - powerful unix/linux tool frequently used to search for patterns
in files. For example finding all 'EXEC' program names in JCL.

1I1. dos2unix - convert DOS/Windows files to Unix/Linux files (remove 'CR's)
1I2. unix2dos - convert Unix/Linux files to DOS/Windows files (insert 'CR's)

1J1. Vancouver Utility backup scripts scheduled by cron

1K1. dd - Unix/Linux Data utility, very fast, use when you do not need the
power of 'uvcopy' but need more than 'cp'.

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

CNVaids.doc Vancouver Utility Conversion Aids

Part 1 Unix/Linux Aids - Contents (continued)


1L1. other Unix/Linux aids documented in ADMjobs.htm#Part_7.
(chmod_custom1 to ensure permissions OK for nightly batch runs)
Here in CNVaids.doc, we will simply list them with a brief description.

1K1. other Unix/Linux aids documented in ADMjobs.htm#Part_8.
(FTP,SSH,PUTTY,SAMBA,who,w,df,du,wall,write,mail)
Here in CNVaids.doc, we will simply list them with a brief description.

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

1A1. CNVaids: Unix/Linux Aids

'profiles' provided in /home/uvadm/env

 /home/uvadm/env      <--- profiles provided here
 :-----common_defines    - defines TEST/PROD LIBS/DATA so stub_profile
 :                         can use $symbols to define RUNLIBS/RUNDATA
 :-----common_profile    - common profile (called by stub_profile)
 :                         defines PATH's etc using $RUNLIBS/$RUNDATA
 :-----stub_profile      - will be renamed .profile (ksh) or .bash_profile (bash)
 :                       - defines RUNLIBS/RUNDATA for programmers & operators
 :-----root_profile      - profile for root, copy to /root/.bash_profile (RedHat)
 :                         to access Vancouver Utility scripts & uvcopy jobs
 :
 /home/appsadm/env    <--- setup user 'appsadm' & copy from /home/uvadm/env/*
 :-----common_defines    - customize profiles here in /home/appsadm/env/...
 :-----common_profile    - common profile (called by stub_profile)
 :-----stub_profile      - customize & copy to homedirs .profile or .bash_profile

Mainframe conversion sites should setup an application administrator userid 'appsadm', copy /home/uvadm/env/* to /home/appsadm/env,& customize profiles there depending on the locations of their 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_defines' & 'common_profile' which are stored in /home/appsadm/env/...

  1. 'common_defines' defines locations of PRODLIBS,PRODDATA,TESTLIBS,TESTDATA,& software package HOME dirs (uvadm, COBDIR, ORACLE_BASE, ORACLE_HOME, etc)

  2. 'stub_profile' for programmers defines RUNLIBS=$TESTLIBS,RUNDATA=$TESTDATA. 'stub_profile' for operators defines RUNLIBS=$PRODLIBS,RUNDATA=$PRODDATA.

  3. 'common_profile' then defines the 'PATH's using $RUNLIBS,$COBDIR,$UV,etc For example: export PATH=$PATH:$RUNLIBS/jcls (converted JCL/scripts).

Note that stub profiles must call 'common_defines' & 'common_profile' using '.' (dot execution), which means the 'export's made in the common_defines & 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_defines & common_profile once in 1 place (actually 2 places) & those changes are effective for all users.

 See profile listings & more explanations at:
 http://www.uvsoftware.ca/admjobs.htm#1B1
 or at: http://www.uvsoftware.ca/install.htm#G0

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

1B1. CNVaids: Unix/Linux Aids

Recommended Aliases in profiles

Here are the 'alias' commands extracted from the recommended profile which is listed at ADMjobs.htm#1C2.

 # alias UNIX commands to prompt for overwrite (highly recommended)
 # - use \rm, \mv, \cp, when you have many files & know what you are doing
 # - '\' tells UNIX to ignore the alias & use native UNIX command
 alias rm='rm -i'              # confirm removes
 alias mv='mv -i'              # confirm renames
 alias cp='cp -i'              # confirm copy overwrites
 alias l='ls -l'               # saves a lot of keystrokes
 alias cdd='cd $RUNDATA'       # quick access to data dir
 alias cdl='cd $RUNLIBS'       # quick access to libs (same as cd)
 alias cdc='cd $CNVDATA'       # quick access to data conversion superdir

The 1st 3 (rm='rm -i',etc) are recommended for unix/linux beginners & experts since it is so easy to wipe out files unintentionally. When you do have multiple files to remove (using the '*' wildcard), you can disable the prompt by preceding the command with a backslash or using option '-f'.

cd aliases to RUNDATA, RUNLIBS,& CNVDATA

These are a great convenience for Your programmers & operators, because the recommended directory design has libraries & data in different filesystems & the paths can be long & awkward if you had to key them often.

 export TESTLIBS=/p1/testlibs     #<-- defs in common_defines
 export TESTDATA=/p1/testdata
 export PRODLIBS=/p2/prodlibs
 export PRODDATA=/p2/proddata
 export CNVDATA=/p3/testdata
 export RUNLIBS=$TESTLIBS         #<-- defs in .profile or .bash_profile
 export RUNDATA=$TESTDATA
         --- OR ---
 export RUNLIBS=$PRODLIBS
 export RUNDATA=$PRODDATA
 export CNVDATA=$CNVDATA
 alias cdd='cd $RUNDATA'          #<-- defs in common_profile
 alias cdl='cd $RUNLIBS'
 alias cdc='cd $CNVDATA'

With the above aliases in your profile, you can switch between your libraries & data with 3 character commands:


 cdd     <-- change to your data files superdir
 ===
 cdl     <-- change to your library files superdir
 ===
 cdc     <-- change to your data conversion superdir
 ===

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

1B2. CNVaids: Unix/Linux Aids

aliases for 'mvstest' RUNDATA & RUNLIBS

The RUNLIBS & RUNDATA above are examples for your testing & production & must be modified depending on your directory design. You will need to modify to reflect wherever you set up testing & production directories (in different file systems with possibly long awkward pathnames).

UV Software has provided test/demo files in /home/uvadm/mvstest/... and instructed you to setup user 'mvstest' & copy the demo files over there for your testing. Your profile could then define RUNLIBS & RUNDATA as follows:

 export RUNLIBS=/home/mvstest/testlibs     <-- could define like this
 export RUNDATA=/home/mvstest/testdata
 export RUNLIBS=$HOME/testlibs          <-- better like this
 export RUNDATA=$HOME/testdata            - would not matter what userid

 cdd     <-- change to mvstest data files directory
 ===

 cdl     <-- change to mvstest library files directory
 ===

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

1C1. CNVaids: Unix/Linux Aids

File Rename scripts

There are many 'rename' scripts (in /home/uvadm/sf/util/...) that we have found useful in mainframe conversions. These scripts can save you a lot of manual keying. It can be very awkward renaming many long filenames.

Here are just a few of the 27 scripts available:

renameL
  • rename all filenames in a directory to lower case
renameU
  • rename all filenames in a directory to UPPER case
renameX
  • rename all files, changing 1 specified extension to an alternate
rename-X
  • remove specified extension from all files in directory
rename+X
  • add a specified extension to all files in directory

To illustrate rename scripts, assume we have just transferred mainframe COBOL programs (UPPER case filenames) to unix/linux (subdir jcl0/...), & we wish to rename them from UPPER case to lower case & add extension '.jcl'.


 #1. l jcl0    <-- list files before rename
     ======        (UPPER case, No extension)
 -rw-rw-r-- 1 mvstest  users    648 Jan 10 07:18 JAR100
 -rw-rw-r-- 1 mvstest  users    891 Jan 10 07:18 JAR120
 -rw-rw-r-- 1 mvstest  users   1053 Jan 10 07:18 JAR130
 -rw-rw-r-- 1 mvstest  users   1053 Jan 10 07:18 JAR140
 -rw-rw-r-- 1 mvstest  users   1053 Jan 10 07:18 JAR150

 #2. renameL jcl0   <-- rename to Lower case
     ============

 #3. rename+X jcl0 .jcl   <-- add extension '.jcl'
     ==================

 #4. l jcl0         <-- list files AFTER renaming
     ======             (lower case with .jcl extension)
 -rw-rw-r-- 1 mvstest  users    648 Jan 10 07:22 jar100.jcl
 -rw-rw-r-- 1 mvstest  users    891 Jan 10 07:22 jar120.jcl
 -rw-rw-r-- 1 mvstest  users   1053 Jan 10 07:22 jar130.jcl
 -rw-rw-r-- 1 mvstest  users   1053 Jan 10 07:22 jar140.jcl
 -rw-rw-r-- 1 mvstest  users   1053 Jan 10 07:22 jar150.jcl

You can see more 'rename' scripts listed at scripts1.htm and all are available at /home/uvadm/sf/util/...

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

1D1. CNVaids: Unix/Linux Aids

dtree - draw directory tree

Here is a convenient script to draw directory trees. UV Software uses it for documentation & it is illustrated here in case you can wish to use it.


 dtree /home/mvstest         <-- try this (output illustrated below)
 ===================
 /home/mvstest
 :-----cnvdata
 :-----testdata
 :     :-----ap
 :     :-----ar
 :     :-----gl
 :     :-----jobctl
 :     :-----joblog
 :     :-----jobtmp
 :     :-----rpts
 :     :-----sf
 :     :-----sysout
 :     :-----tmp
 :     :-----wrk
 :-----testlibs
 :     :-----4up
 :     :-----cbl0
 :     :-----cbl1
 :     :-----cbl2
 :     :-----cbls
 :     :-----cblst
 :     :-----cblx
 :     :-----cpy0
 :     :-----cpy1
 :     :-----cpy2
 :     :-----cpys
 :     :-----Csub
 :     :-----ctl
 :     :-----errs
 :     :-----jcl0
 :     :-----jcl1
 :     :-----jcl2
 :     :-----jcl3
 :     :-----jcls
 :     :-----joblog
 :     :-----maps
 :     :-----parm0
 :     :-----parms
 :     :-----pf
 :     :-----proc0
 :     :-----procs
 :     :-----sf
 :     :-----sfun
 :     :-----tmp
 :     :-----xref

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

1E1. CNVaids: Unix/Linux Aids

llr - display all files in multilevel subdirs

The 'llr' script is convenient to examine the contents of multi-level subdirs, such as $RPTS, $JTMP, or the entire $TESTDATA.


 #1. Login as yourself ---> your homedir

 #2. mkdir tmp        <-- make a tmp dir if not already existing
     =========

 #3. llr > tmp/llr    <-- run the 'llr' script & capture output
     =============

 #4. uvlp12 tmp/llr   <-- print results (or vi, more, etc)
     ==============

sample llr of TESTDATA after running 1 job

 drwxrwxr-x    2 lynnv3   users        4096 Feb 13 08:43 joblog
 drwxrwxr-x    2 lynnv3   users       16384 Jan 14 14:12 jobparms1
 drwxrwxr-x    2 lynnv3   users       16384 Jan 14 14:12 jobparms2
 drwxrwxr-x    3 lynnv3   users        4096 Feb 13 08:43 jobtmp
 drwxrwxr-x    2 lynnv3   users        4096 Feb 12 11:23 mstr
 drwxrwxr-x    3 lynnv3   users        4096 Feb 13 08:43 rpts
 drwxrwxr-x    3 lynnv3   users        4096 Feb 13 08:43 sysout
 drwxrwxr-x    5 lynnv3   users        4096 Feb 13 08:08 tape
 drwxrwxr-x    2 lynnv3   users        4096 Feb 16 16:55 tmp
 drwxrwxr-x    2 lynnv3   users        4096 Feb 13 08:43 wrk
 ./joblog:
 -rw-rw-r--    1 lynnv3   users        5743 Feb 13 08:43 28401d23x.log
 ./jobparms1:
 -rw-rw-r--    1 lynnv3   users         251 Jan 14 14:12 24502R01_S0010_E173001C
                    - - - - - - - etc - - - - - -
 -rw-rw-r--    1 lynnv3   users         327 Jan 14 14:12 33001R02_S0010_E173001C
 ./jobtmp:
 drwxrwxr-x    2 lynnv3   users        4096 Feb 13 08:43 28401D23
 ./jobtmp/28401D23:
 -rw-rw-r--    1 lynnv3   users          80 Feb 13 08:43 jobbgn
 -rw-rw-r--    1 lynnv3   users          80 Feb 13 08:43 jobend
 -rw-rw-r--    1 lynnv3   users          70 Feb 13 08:43 jobtimes
 -rw-rw-r--    1 lynnv3   users       45220 Feb 13 08:43 S0060_E212640C
Note
  • you can see that all levels of subdirs & file contents are listed
  • we can omit the remainder (mstr,rpts,sysout,tape,tmp,wrk)

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

1F1. CNVaids: Unix/Linux Aids

cfl - Count Files & Lines in a directory

 #!/bin/ksh
 # cfl - Korn shell script from UVSI stored in: /home/uvadm/sf/util/
 # cfl - Count Files & Lines in a directory (option to print via uvlp12)
 #     - option to count only files matching suffix supplied by arg#2
 d="$1"; p="$2"; db=$(basename $d); tmpf=tmp/$db.cfl
 if [ -d "$d" ]; then :
    else echo "usage: cfl directory [suffix]"
         echo "       ======================"
         echo "- arg1=directory, arg2=prefix file select (optional)"
    exit 1; fi
 echo "cfl Count Files & Lines in subdir: $d (with optional prefix=$p )" >$tmpf
 integer fs=0 fsp=0 lnt=0 ln2=0;
 for df in $d/*
 do
   ((fs+=1))
   f=${df##*/}
   if [[ "$p" == "" || "$f" == "$p"* ]]; then
      ((fsp+=1))
      ln1=$(wc -l $df); ln2=${ln1% *}; ln3=${ln2##* };
      fdus=$(\du -s -h $df | tr '\t' ' '); fdu=${fdus%% *};
      printf "#%03d" $fsp  >>$tmpf
      if [[ -d $df ]]; then printf "/ " >>$tmpf; else printf "  " >>$tmpf; fi
      printf "%8s " $fdu   >>$tmpf
      printf "%8d " $ln3   >>$tmpf
      printf "$df \n"      >>$tmpf
      ((lnt+=ln3))                # accum total lines
   fi
 done
 echo "Totals: $fs files & $lnt lines in subdir: $d" >>$tmpf
 if [ -n "$p" ]; then echo "$fsp files with prefix=$p (null=all)" >>$tmpf; fi
 more   $tmpf
 echo "enter 'p' to print"; read reply
 if [[ "$reply" == "p" ]]; then uvlp12 $tmpf; fi
 exit 0

 cfl /home/uvadm/env   <-- example, count files & Lines in env/ (profiles)
 ===================     - output shown below:
 cfl Count Files & Lines in subdir: env (with optional prefix= )
 #001      4.0K       36 env/bashrc
 #002      8.0K      133 env/common_defines
 #003       16K      272 env/common_profile
 #004      4.0K       36 env/kshrc
 #005/     100K        0 env/other_profiles
 #006      4.0K       49 env/root_profile
 #007      4.0K       57 env/smb.conf
 #008      8.0K      147 env/stub_profile
 #009      4.0K       50 env/stub_profile_appsadm
 #010      4.0K       36 env/stub_profile_appsadm_cronlogdemo
 #011      4.0K       54 env/utilities_profile
 Totals: 11 files & 870 lines in subdir: env

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

1F2. CNVaids: Unix/Linux Aids

statdir1 - report file counts & KB used in a Parent dir

This script should be very useful to any unix/linux site:

  1. Helps control disc storage used. Note the sample report shown below for all user /home/... dirs. You can quickly spot any users with extreme Total KB of storage.

  2. Helps verify results of batch runs, you might know how many files & approx how much disc usage there should be for each subdir.

  3. Helps maintain the integrity of your directories & files. The report shows if there are any subdirs within a subdir, which might be a problem if you have batch jobs that process all entries in a directory & might be upset by the appearance of an unintended subdir created by mistake.

Here is the report I created for all /home/... dirs on my machine:


 statdir1 /home      <-- call script, arg1 is directory to be examined
 ==============

statdir1 - sample report

 stats/home.rpt - FileCounts & DiscUsage for SubDirs in ParentDir: /home
 #1 Files=0000063 SubDirs=0049 TotKB=0004308 - /home/appsadm
 #2 Files=0000126 SubDirs=0022 TotKB=0001180 - /home/aquitec
 #3 Files=0000266 SubDirs=0057 TotKB=0018216 - /home/berks
 #4 Files=0000036 SubDirs=0037 TotKB=0000372 - /home/callatay
                  - - - - - etc - - - - -
 #82 Files=0003280 SubDirs=0252 TotKB=0060484 - /home/uvadm
 #83 Files=0003995 SubDirs=0297 TotKB=0070032 - /home/uvext
 #84 Files=0000015 SubDirs=0006 TotKB=0000100 - /home/uvtest1
 #85 Files=0000407 SubDirs=0079 TotKB=0003168 - /home/vsetest
 Total Dirs=85, Files=33711, SubDirs=3646, KB=1550852, for ParentDir=/home

You can rerun for homedirs using a lot of storage, for example:


 statdir1 /home/uvadm     <-- rerun for selected homedirs
 ====================

'statdir1' is a very powerful & interesting script. You can see it listed at http://www.uvsoftware.ca/admjobs.htm#7G2

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

1G1. CNVaids: Unix/Linux Aids

diff & alldiff - marvelous utilities

The Unix/Linux 'diff' utility is fantastic whenever you want to see the difference between any 2 programs, copybooks, jcls. It is useful to see the differences between the BEFORE & AFTER of some conversion process such as the COBOL conversion (see example shown below).

We will illustrate the 'diff' for a COBOL program 'Before' & 'After' conversion. The COBOL converter reads input from subdir 'cbl1' & writes output to 'cbl2'. You cannot 'diff' between original mainframe program in 'cbl0' & 'cbl2' since cbl0 is still UPPER case & may have data in cols 1-6 &/or 73-80 which is removed by the 'cleanup' job.


 diff -b cbl1/car100.cbl cbl2/car100.cbl
 =======================================
 8,10c8,10
 <            select custmas assign custmas
 <                   organization sequential access mode sequential.
 <            select nalist assign nalist
 ---
 > uvM        select custmas assign external custmas
 > uvM               organization record sequential access mode sequential.
 > uvM        select nalist assign external nalist
 25a26
 > uvJ    01   jobid      pic  x(8).
 28a30,31
 > uvJ        display "JOBID" upon environment-name
 > uvJ        accept jobid from environment-value.
 34c37
 <            stop run.
 ---
 > uvM        stop run returning 0.
Note
  • Specify the old file 1st & the new file 2nd, then:
  • '<' indicates the old version
  • '>' indicates the new version

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

1G2. CNVaids: Unix/Linux Aids

alldiff script

The 'alldiff' script makes the 'diff' command even more powerful. The 'alldiff' script is supplied with the Vancouver Utilities (uvadm/sf/util/alldiff) to repeat the Unix/Linux 'diff' utility on each pair of files in 2 directories.

This is great whenever you are making mass changes to directories - save a copy of the original, make the mass changes,& run alldiff to confirm them.

The COBOL conversion is a good example. After the 1st conversion you will probably fine tune the conversion search/replace table & possibly the conversion tool itself (cnvMF4/cnvMF5). Before you reconvert, save the original output subdir so you can run 'alldiff' after the reconversion.

Simply change the name of the current output directory & remake a new output directory. For example (using MVS conversion job cnvMF5)


 #1a. vi ctl/cnvcob5.tbl          - modify the search/replace table
 #1b. vi pf/cnvMF5                - modify the conversion tool

 #2. mv cbls cbls.old             - change name of outdir (contains old versions)

 #3. mkdir cbls                   - make a new directory to receive new output

 #4. uvcopy cnvMF5 ...            - reconvert COBOL programs with modified
                                    table &/or cnvMF5 conversion job

 #5. alldiff cbls.old cbls |more  - run alldiff to see differences
     ===========================

 #5a. alldiff cbls.old cbls >tmp/cbls.dif  OR redirect diffs to tmp file
      ==================================

 #5b. alldiff2 cbls.old cbls  OR use 'alldiff2' (saves dif file automatically)
      ======================

 #5b. vi tmp/cbls.dif                      inspect tmp dif file

 #5c. uvlp12 tmp/cpys.dif                  OR print tmp dif file

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

1H1. CNVaids: Unix/Linux Aids

grep - search for patterns in files

'grep' is a powerful unix/linux tool that programmers frequently use to search for patterns in files. For example if you wanted to find all the 'EXEC' program names used in the JCL, you might use the following command:

example - grep for EXEC in all JCL


 grep ' EXEC ' jcl1/* >tmp/grepx
 ===============================

grep results

 jcl1/jar100.jcl:3://STEP010  EXEC PGM=CAR100
 jcl1/jar110.jcl:9://STEP010  EXEC PGM=CAR100
 jcl1/jar120.jcl:3://STEP010  EXEC PGM=CAR120,PARM=2002
 jcl1/jar130.jcl:5://STEP010  EXEC PGM=CAR120,PARM=2003
 jcl1/jar140.jcl:5://STEP020  EXEC PGM=CAR120,PARM=2004
 jcl1/jar150.jcl:5://STEP010  EXEC PGM=CAR150
 jcl1/jar155.jcl:4://STEP020  EXEC PGM=CAR150
 jcl1/jar200.jcl:12://STEP020  EXEC PGM=CAR100,COND=(4,LT,STEP010),PARM=2003
 jcl1/jar200.jcl:20://*STEP030  EXEC PGM=SORT,REGION=2048K
 jcl1/jgl300.jcl:5://STEP010  EXEC PGM=IEBGENER
 jcl1/jgl300.jcl:9://STEP020  EXEC PGM=IDCAMS,COND=(4,LT,STEP010)
 jcl1/jgl320.jcl:6://STEP010  EXEC PGM=IEBGENER
 jcl1/jgl320.jcl:11://STEP020  EXEC PGM=IDCAMS,COND=(4,LT,STEP010)
 jcl1/jgl330.jcl:4://STEP010  EXEC PGM=IEBGENER
 jcl1/jgl330.jcl:10://STEP020  EXEC PGM=IDCAMS,COND=(8,LT,STEP010)
 If our objective is to get a concise list of programs used in all JCL
 - grep for 'EXEC' does a poor job, because of varying step# & PARMs

Please see 'grepsum1' on page '2F1', which will sort the 'grep' search results & drop duplicates depending on options that allow you to specify the sort field by column range or by word occurrence numbers.

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

1I1. CNVaids: Unix/Linux Aids

dos2unix & unix2dos

dos2unix
  • Linux utility to convert text files from DOS to UNIX
  • remove Carriage-Returns, leaving only Line-Feeds
  • change end lines from CR/LF to LF (x'0D0A' to x'0A')
unix2dos
  • Linux utility to convert text files from UNIX to DOS
  • insert Carriage-Returns, prior to EOL Line-Feeds
  • change end lines from LF to CR/LF (x'0A' to x'0D0A')

examples


 dos2unix -n ftp/dosfile tmp/unixfile
 ====================================

 unix2dos -n tmp/unixfile ftp/dosfile
 ====================================
Note
  • use the '-n' option to avoid changing your existing input file
Note
  • dos2unix & unix2dos are Linux utilities, Unix systems may name these
    differently (dtoa, atod, etc)
Note
  • dos2unix & unix2dos only work with text files (must have LF's)
  • to insert or remove 'CR's in fixed length record files,
    see scripts 'uvcpF2L' & 'uvcpL2F' documented on pages '7D1' & '7D2'

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

1J1. CNVaids: Unix/Linux Aids

Vancouver Utility Backups & crontabs

  1. This system takes advantage of the massive inexpensive disc systems now available to maintain zip file backups on-disc for the last 40 days, the last 15 end of month backups,& the last 7 end of year backups.

  2. Backups automatically scheduled by 'cron'

  3. Two days backup on-disc, unzipped, instantly available for file recovery.

  4. Zipped file of nightly backups maintained on-disc for 40 days, 1st of month zip file maintained on-disc for 15 months, & 1st of year zip file maintanined on-disc for 7 years.

  5. Zip file names have embedded date & time to eliminate confusion. For example, the 3 nightly zip files used in the backup examples are: proddata_yymmdd_HHMM.zip, prodlibs_yymmdd_HHMM.zip, homedirs_yymmdd_HHMM.zip.

  6. This backup system is intended application files (production data, libraries, & home dirs), that may need quick restore. Most sites will already have backups for the entire system, but those probably do not provide the quick restore possible with these smaller targeted ondisc backup files.

  7. Nightly zip files backed up to tape by cron & tapes cycled over 31 days. For smaller sites with single tape units, I suggest you simply label 31 tapes with numbers 1 to 31. Each morning the operator changes tapes & inserts the tape# for today's day of month, with no need to write anything.

  8. The nightly backup tapes can be stored onsite in fireproof vault. The end of month tape should be taken offsite & new tape inserted in rotation, progressing thru the 31 tapes, so tapes are reused maximum 31 times.

  9. Directories & devices defined in 1 place (/home/appsadm/env/common_defines), to make it easier, to install backup scripts at new sites & to make changes, when directories or tape devices change.

  10. This is achieved by having all scripts '.' dot-execute the 'appsadm profile' & 'common_defines' which define the symbols ($PRODDATA, $PRODLIBS, $BACKUP, $TAPERWD, $TAPENRW), which are used thruout the scripts. Please see the profiles listed begining on page http://www.uvsoftware.ca/admjobs.htm#1B1.

  11. Executing the backups under cron means the console logs will be 'mailed' to the crontab owner, which is 'appsadm', so the site administrator can investigate any errors.

  12. These scripts use zip/unzip for Linux, but Unix users may have to change these to gzip/gunzip or to tar+compress/uncompress/untar.
 See details & examples at http://www.uvsoftware.ca/admjobs.htm#Part_4

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

1K1. CNVaids: Unix/Linux Aids

dd - Unix/Linux Data utility

The 'dd' utility is very fast and should be used when you do not need the extensive data manipulation provided by 'uvcopy', but need more than provided by 'cp'. We will illustrate a few of the basic 'dd' commands here (see the man page for others).

if=InputFile
  • specify Input Filename
of=OutputFile
  • specify Output Filename
bs=BlockSize
  • specify BlockSize (bytes)
count=blocks
  • number of blocks to be copied
skip=blocks
  • number of blocks to be skipped
conv=ascii
  • translate from EBCDIC to ASCII

notes

  1. The dd 'BlockSize' is not related to any logical 'RecordSize' in mainframe type files (such as customer masters & sales transactions).

  2. BlockSize defaults to 512. You should specify at least 4k for faster file copies. Very large BlockSizes might be slower if the disc file contained bad tracks requiring multiple read retries.

  3. If you are copying mainframe type files, to create smaller test files, specify BlockSize as a multiple of RecordSize, so your application programs will not fail on a partial record at EOF.

    dd example #1 - create a smaller test file

Assume we have a very large file (ar/customer.master with record-size 256), and we wish to create a smaller test file (tmp/custmas1 with 10,000 records).


 dd if=ar/customer.master of=tmp/custmas1 bs=25600 count=100
 ===========================================================

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

dd - Unix/Linux Data utility

dd example #2 - translate EBCDIC to ASCII


 dd if=ar/sales.items of=tmp/sales1 conv=ascii
 =============================================
  1. You can use dd 'conv=ascii' to translate EBCDIC files to ASCII, if you are certain there are no packed/binary fields, which would be destroyed if translated.

  2. If there are packed/binary fields, see www.uvsoftware.ca/datacnv1.htm which documents methods to translate the character fields, preserving packed/binary fields. Conversion jobs are generated automatically from the COBOL copybook record layouts.

  3. Usually do not need dd translate, since if you know there are no packed/ binary fields, you can simply FTP from mainframe in text mode, which performs EBCDIC to ASCII translate automatically.

    script 'dd2ascii' to translate all files in subdir

We provide a script 'dd2ascii' to copy/translate all files from 1 subdir to a 2nd subdir (which is checked by the script to ensure initially empty).

For example, assume subdir jcl0/ has 500 mainframe JCLs in EBCDIC:


 #1. mv jcl0 jcl0E         <-- rename subdir
     =============

 #2. mkdir jcl0            <-- remake new empty subdir
     ==========

 #3. dd2ascii jcl0E jcl0   <-- copy/translate all JCLs from jcl0E to jcl0
     ===================

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

1L1. CNVaids: Unix/Linux Aids

There are several other Unix/Linux aids documented in ADMjobs.htm#Part_8 and ADMjob.htm#Part_7. Here in CNVaids.doc, we will simply list them with a brief description.

Vital Unix/Linux aids documented in ADMjobs.doc

 ADMjobs.htm#7B1 - chmod1 script to fix permissions on all subdirs & files
                     within a super directory.
                   - might use to ensure nightly batch jobs do not fail due
                     to bad files created by FTP or programmers using root
                     and forgetting to fix perms for batch jobs.
 ADMjobs.htm#7B1 - chmod_custom1 suggested script to run under 'root' cron
                     prior to nightly batch run by 'appsadm' cron
                   - too dangerous to run batch jobs under root

1K1. Unix/Linux aids documented in ADMjobs.doc

ADMjobs.htm#8D1 FTP - transfer files between my computers, sample session

ADMjobs.htm#8E1 SSH - Secure SHell (telnet replace) login to remote computer

ADMjobs.htm#8F1 PUTTY - SSH Terminal Emulator for Windows (free download from www.chiark.greenend.org.uk)

ADMjobs.htm#8G1 SAMBA - Linux file-server for Windows, sample config file

ADMjobs.htm#8J1 show info about other users (who,w,finger,last,lastlog)

ADMjobs.htm#8J2 Sample outputs from: who, w,& finger

ADMjobs.htm#8L1 System info commands (df, du, free, uname)

ADMjobs.htm#8M1 Killing hung-up jobs (ps & kill demo)

ADMjobs.htm#8N1 Messaging (wall, write, mail)

ADMjobs.htm#8O1 TOP - Unix/Linux system performance analysis tool

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

Part_2. CNVaids.doc Vancouver Utility Conversion Aids

Vancouver Utility General Purpose Aids - Contents


2A1. uvlp__ - 'uvlp' scripts to list files at various chars per inch
- 'uvlp12' is most popular (12 chars/inch, 60 lines/page)
- uvlp12D prints Duplex at 12 cpi, uvlp12L prints Landscape
- all the 'uvlp' scripts call the 'uvlist' utility C program
  which provides page headings with filename, date last modified,
  date listed, userID, line#,& page#.
- No more wondering where a listing came from & when it was made.
- see uvlist.htm for more about 'uvlist', the 'uvlp' scripts &
  the many options (cpi,lpi,spacing,portrait,landscape,etc)

2A2. uvlp13LD - script to list mainframe reports on PCL5 laser printers
- 132 columns x 66 lines on 8 1/2 x 11 Landscape (13 cpi, 9 lpi)

2B1. listall - very useful for printing all contents of a directory which
  contains many small files.
- does not page break between files, just leaves a space.
- ideal for 'parms' subdir of control cards (SORT FIELDS, etc).

2C1. spreadA - list all filenames in a directory 4-up. Convenient for listing
the hundreds of JCLs,scripts,& COBOL programs in the conversion.

2D1. cleanup - source code maintenance utility (for JCL, COBOL, etc).
- many options to translate, clear columns, gang constants, etc
- see demo for COBOL with options explained

2E1. verifytext - scan all files in a subdir & report unprintable characters
- verify COBOL programs, copybooks,& JCL have no bad data

2F1. grepsum1 - a uvcopy utility job that will sort the grep results, dropping
duplicates, to get the desired unique list of EXEC programs.

2G1. scan/replace - Vancouver Utility scan/replace jobs can be more effective
  than grep/sed because you can have qualifiers present/absent
- they create an audit trail to guide subsequent edits

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

2A1. CNVaids: Vancouver Utility Aids

'uvlp__' scripts for Laser printers

The 'uvlp' scripts (uvlp12, uvlp14, uvlp12D, uvlp12L, etc) all call the 'uvlist' text file list utility to provide page headings with filename, date last modified, date listed, userID, line#,& page#.

It is vital to Identify the various listings you make & when you made them. There are few things more frustrating than picking up some important listing & not knowing what the source filename is & when it was created.

You don't use uvlist directly but rather via 1 of the many scripts provided that specify the desired options & pipe the output to the desired printer. The printer is identified by an environmental variable in your profile


 export UVLPDEST="-dlp0"  <-- modify profile with your printer -d destination
 =======================

We will illustrate 'uvlp12' which lists at 12 cpi & leaves margins for three hole punched paper.

When testing & debugging your JCL, you might want to list out the original MVS JCL (from jcl2) & the corresponding script (from jcl3). For example:


 uvlp12 jcl2/jar200.jcl     <-- list JCL with PROCs expanded
 ======================

 uvlp12 jcl3/jar200.ksh     <-- list Korn shell script (converted JCL)
 ======================

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

2A2. CNVaids: Vancouver Utility Aids

Listing ALL files in a directory

You might want to list all JCL & all scripts. It might save you time in the long run. The listings give you a place to plan your changes, write your changes,& track your progress.

I suggest you use 3 hole punched paper & mount the listings in 3 ring binders. The 'uvlpd12' script will list all files in any directory leaving enough margin for the 3 hole punches.

I suggest we only need to list jcl2 (JCL with PROCs expanded) & jcl3 (converted Korn shell scripts). Don't list jcl3 (converted scripts) until you have tested a few jobs, in case improvements & re conversions are required. Of course you can try this now using the supplied test/demo JCLs which are very few.


 uvlpd12 jcl2        - list all original mainframe JCL (PROCs expanded)
 ============

 uvlpd12 jcl3        - list all scripts (converted from JCL)
 ============

list 1st page only of all files in directory

'uvlpd1p' will list the 1st page only of all files in a directory, or of all files matching a specified suffix. This is useful after COBOL compiles, which leave .err reports in subdir cblx/...err. The .err reports could be long, but we usually only need to correct the 1st error & the rest go away.


 mfcblA all cbls cblx cpys  <-- compile all cbls/... to cblx/...
 =========================    - leaving any .err reports in cblx/prgmxx.err

 uvlpd1p cblx .err   <-- print 1st page of all files in cblx/ with '.err' suffix
 =================

See many more 'uvlp__' scripts in uvlist.htm.

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

2A2. CNVaids: Vancouver Utility Aids

uvlp13LD - print Mainframe reports on Unix/Linux

 #!/bin/ksh
 # uvlp13LD - print Landscape DUPLEX at 13 cpi horizontal & 9 lpi vertical
 #            (135 chars wide & 66 lines down on 8 1/2 x 11 Landscape)
 #          - for mainframe reports migrated to Unix/Linux systems
 #          - pg hdngs with: filename, mod-date, today-date, page#s
 #          - for HP laserjet PCL5 printers & compatibles
 #          - by Owen Townsend - UV Software Inc - Jan 2001
 #
 #usage: uvlp13LD filename [group1] [group2]  <-- may override default options
 #       ===================================
 #
 # - 1 of several: uvlp12,uvlp14,uvlp16,uvlp12L,uvlp14L,uvlp12D,uvlp14LD,etc
 # - these scripts invokes uvlist & pipe to the spooler
 # - see uvlist.doc for many group1(file) & group2(laser printer) options
 # - these scripts convert group2 options into HP PCL5 escape sequences
 # - scriptnames reflect commonly used uvlist options, for example:
 # grp1: p66   = 66 lines per page
 #       h      = could add option 'h' to inhibit uvlist page headings
 #                (if reports already have page headings)
 # grp2: a2     - letter size paper
 #       d1    = duplex
 #       c13   = 13 cpi = 135 chars across on 11 inch wide
 #       v5.2  = vertical spacing 5.2/48" (9 lines/inch)
 #       o1    = Landscape orientation (see o3 below for holes other side)
 #       j-200 = front long edge margin offset - neg right, pos left *excetion*
 #       k-200 = back  long edge margin offset - neg right, pos left *exception*
 #       m050  = front short edge margin offset - neg up, pos down
 #       n-100 = back  short edge margin offset - neg down, pos up *exception*
 #
 # .profile should specify environmental variables for 'lp', for example:
 # export UVLPDEST="-dlp0"       #<-- destination 'lp0' ("-dLPT1" for SFU)
 # export UVLPDEST=""            #<-- null to use lpadmin default
 # export UVLPOPTN="-onobanner"  #<-- 'nobanner' option for lp
 # export UVLPOPTN=""            #<-- null disable for Windows SFU
 if [ ! -f "$1" ]; then echo "ERROR - $1 is not a file"; exit 1; fi
 #
 uvlist $1 p66$2 a2o1d1p80j-200k-200m050n-100c13v=5.2,$3 | lp $UVLPOPTN $UVLPDEST
 #===============================================================================
 uvln=$(basename $0)
 linesf=$(wc -l $1); lines=${linesf% *}
 echo "$uvln printing $1 on $UVLPDEST, lines=$lines"
 exit 0

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

2B1. CNVaids: Vancouver Utility Aids

listall - List All (small) Files in Directory

'listall' is very useful for printing all contents of a directory which contains many small files, because it does not page break between files (just leaves a space). 'listall' is ideal for listing the 'parms' subdir which contains control cards (SORT FIELDS, etc).

listall - sample command & output


 listall parms    - list all files in directory (space only between files)
 =============

file# 1 - parms/ikjdemo1 DSN SYSTEM(DB2P) RUN PROGRAM(IKJPROG1) PLAN(IKJPROG1) LIB('MEPP.WXS91.LOADLIB') END

file# 2 - parms/pap100s1 SORT FIELDS=(78,2,CH,A,61,15,CH,A,11,25,CH,A)

file# 3 - parms/pgl200s1 SORT FIELDS=(1,8,CH,A,69,12,CH,A)

file# 4 - parms/ppy200s2 SORT FIELDS=(1,19,CH,A,75,6,CH,A)

See 'listall' at /home/uvadm/sf/util/listall

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

2C1. CNVaids: Vancouver Utility Aids

spreadA - list files 4-up for doc & control

To create 4-up module name listings, use the 'spreadA' UV script:

spreadA - Operating Instructions


 #1. mkdir 4up         - make output dir if not already existing
     =========

 #2. spreadA cbls      - create 4-up listing of all COBOL programs
     ============      - prompts for report disposition
 spread1 - convert a file of 1 item/line to multi items/line
 uop = q1a0b0c14s1n5   - option defaults
         a0            - input offset columns to item
           b0          - output offset columns to 1st item
             c14       - columns per item
                s1     - spaces between items
                  n5   - number of items per line
 User OPtion (uop) defaults  = q1a0b0c14s1n5
  null to accept or re-specify (1 or more) -->
 End of Job, Output has been written to: 4up/cbls
 enter command: vi,cat,more,lp,uvlp12,etc (or null) --> uvlp12 <-- enter cmd

spreadA - sample report


 $jobname: 4up/cobs  options=q1a0b0c14s1n5  date=2004/04/05_14:46:04
 ===========================================================================
 ars010.cbl     ars020.cbl     ars030.cbl     ars040.cbl     dms001.cbl
 dms002.cbl     dms010.cbl     dms020.cbl     dms030.cbl     dms031.cbl
 dms040.cbl     dms041.cbl     dms110.cbl     dms200.cbl     dms210.cbl
 dms211.cbl     dms212.cbl     dms213.cbl     dms214.cbl     dms250.cbl
 dms260.cbl     dms310.cbl     dms311.cbl     dms312.cbl     dms313.cbl
 dms314.cbl     pas100.bat     pas100.cbl     pas110.cbl
 00029 total items in 4up/cobs

 #3. uvlp12 4up/cbls     - OR print report from 4up subdir
     ===============       if print command not entered at prompt above

See 'spreadA' script listed at script.htm#28A or /home/uvadm/sf/util/spreadA. 'spreadA' script calls uvcopy job 'spread1' from /home/uvadm/pf/util/spread1.

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

2C2. CNVaids: Vancouver Utility Aids

spreadA - list files 4-up for doc & control

If you are begining a mainframe conversion, I strongly suggest you run the 4-up reports for all files transferred from the mainframe. These will be a big help in controlling your conversion project. You might use the 4-up reports in conjunction with the cross-reference reports in Part_3.


 #0. mkdir 4up       - make output dir if not already existing
     =========

 #1. spreadA cbl0    - create 4-up listing of all COBOL program names
     ============      (transferred from mainframe, not yet converted)

 #2. spreadA cpy0    - create 4-up listing of all CopyBook names
     ============

 #3. spreadA jcl0    - create 4-up listing of all JCL names
     ============

 #4. spreadA proc0   - create 4-up listing of all PROC names
     =============

 #5. spreadA parm0   - create 4-up listing of all SYSIN/PARM modules
     =============
Note
  • spreadA prompts for report disposition
  • reply 'uvlp12' to print immediately
  • OR, you could reply null & print all reports in 4up/... as folows

 #6. uvlpd12 4up    <-- print all reports in subdir 4up/...
     ===========
Note
  • after conversion, you might print converted results as follows
  • mainframe files stored in '0' subdirs (cbl0,cpy0,jcl0,proc0,parm0)
  • converted files stored in 's' subdirs (cbls,cpys,jcls,procs,parms)

 #1a. spreadA cbls    - create 4-up listing of all COBOL program names
      ============      (after conversion)

 #2a. spreadA cpys    - create 4-up listing of all CopyBook names
      ============

 #3a. spreadA jcls    - create 4-up listing of all JCL/script names
      ============      (Korn shell scripts)

 #4a. spreadA procs   - create 4-up listing of all PROCs
      =============   - N/A, 1 time expansion into JCL/scripts during conversion

 #5a. spreadA parms   - create 4-up listing of all SYSIN/PARM modules
      =============   - some modules may be inserted into JCL during conversion

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

2D1. CNVaids: Vancouver Utility Aids

cleanup - source code maintenance utility

'cleanup' is a uvcopy job to copy source code (COBOL,JCL,etc) with many options (translate, clear columns, gang constants, modify copbooknames, etc). The options list is displayed when 'uvcopy cleanup' is run (as shown below).


 uvcopy cleanup   <-- minimum entry, will prompt for options & filenames
 ==============
 uop=q1a0b0c0d0e0f0g0j0k0n0p0r0s0t0v4w0x0y0z0 - dflt options (copy no chg)
     q0                 - inhibit option prompt (uop=q0?? on cmd line)
       b1               - drop all blank lines
       b2               - drop lines blank in cols 2-128 (ignore col 1)
       b4               - convert blank lines to * col 7 (for COBOL)
         c1             - translate COBOL copy BOOKNAMES to lower case
         c2             - translate COBOL copy booknames to UPPER case
           d1           - convert double quotes to singles
           d2           - convert single quotes to doubles
             e1         - enclose COBOL copy `booknames` in single quotes
             e2         - enclose COBOL copy "booknames" in double quotes
             e4         - append copybook names with ".cpy" (in programs)
               f1       - insert #!/bin/ksh & drop any existing (ID on #!/)
               f2       - insert // JOB jobname (jobname from filename)
                 g1     - sequence number columns 73-80 incrementing by 1
                 g2     - sequence number columns 73-80 incrementing by 10
                 g4     - gang program name in 73-80 (any .ext removed)
                 g8     - clear columns 73-128 to blanks
                   j1   - translate call subrtn names to lower case
                   j2   - translate call subrtn NAMES to UPPER case
                     k1 - enclose call subrtn names in single quotes
                     k2 - enclose call subrtn names in double quotes
                   l1   - COBOL inhibit changes to lines with "*" col 7
                   l2   - Assembler inhibit mods to lines with "*" col 1
                   l4   - script inhibit changes to lines with "#" col 1
                 n1     - translate output filename to lowercase
                 n2     - translate output filename to UPPERcase
                 n4     - remove any existing extension on output filename
               p1       - convert " picture " to " pic "
             r1         - remove any : colons from columns 1-71
           s1           - sequence# in columns 1-6 incrementing by 1
           s2           - sequence# in columns 1-6 incrementing by 10
           s4           - copy to cols 1-6 from cols 73-78
           s8           - clear columns 1-6 to blanks
         t1             - translate text to lower (except in quotes)
         t2             - translate text to UPPER
       v4               - cnvrt tabs to blanks (v2 = 2 blanks, etc)
     w1                 - drop lines with " PAGE " anywhere in 80-128
     w2                 - drop lines with "MEMBER NAME" anywhere in 1-80
   x#                   - shift left  #columns (x6 shifts 7-128 to 1-122)
   y#                   - shift right #columns (y6 shifts 1-122 to 7-128)
 z1                     - concatenate assembler continued lines NB col 72
 z2                     - squeeze asmblr *cmt lines to 1 blank btwn words
 User OPtion (uop) defaults  = q1v4
  null to accept or re-specify (1 or more) -->

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

2D2. CNVaids: Vancouver Utility Aids

cleanup demo - for COBOL programs


 uvcopy cleanup   <-- minimum entry, will prompt for filenames & options
 ==============

 uvcopy cleanup,fili1=cbl0/CAR200.cbl,filo1=cbl1/car200.cbl,uop=c5e15g8j1k1l1n1s8t1
 ==============================================================================

Or we can enter filenames & options on the command line as above, Or we could enter just the filenames,& be prompted for options as below:

 User OPtion (uop) defaults  = q1a0b0c0d0e0f0g0j0k0n0p0r0s0t0v1w0x0
  null to accept or re-specify (1 or more) --> c5e15g8j1k1l1n1s8t1 <--- NOTE

cleanup demo - sample INPUT

 000010 IDENTIFICATION DIVISION.                                         CAR200
 000020 PROGRAM-ID. CAR200.                                              CAR200
 000030 ENVIRONMENT DIVISION.                                            CAR200
 000040 INPUT-OUTPUT SECTION.                                            CAR200
 000050 FILE-CONTROL.                                                    CAR200
 000060     SELECT SALEDTL ASSIGN SALEDTL                                CAR200
 000070            ORGANIZATION SEQUENTIAL ACCESS MODE SEQUENTIAL.       CAR200
 000080 DATA  DIVISION.                                                  CAR200
 000090 FILE SECTION.                                                    CAR200
 000100 FD  SALEDTL RECORD CONTAINS 64 CHARACTERS.                       CAR200
 000110     01 SALEREC. COPY SALEDTL.                                    CAR200

cleanup demo - sample OUTPUT

        identification division.
        program-id. car200.
        environment division.
        input-output section.
        file-control.
            select saledtl assign saledtl
                   organization sequential access mode sequential.
        data  division.
        file section.
        fd  saledtl record contains 64 characters.
            01 salerec. copy "saledtl.cpy".

Note the effect above of the options entered: ---> c1g8s8t1e3 (here are explanations from the previous page)

         c1             - translate COBOL copy BOOKNAMES to lower case
             e1         - enclose COBOL copy "booknames" in double quotes
             e2         - append copybook names with ".cpy" (in programs)
                 g8     - clear columns 73-128 to blanks
           s8           - clear columns 1-6 to blanks
         t1             - translate text to lower (except in quotes)

Note that options are 'binary', hence we enter 'e3' to select both e1 & e2. The input COPY SALEDTL (no quotes) is changed to "saledtl.cpy" (in double quotes & extension .cpy added). Also translated to lower case due to option 'c1'.

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

2E1. CNVaids: Vancouver Utility Aids

verifytext - scan files in subdir for binary data

'verifytext' is a uvcopy job that will scan all files in a directory, searching for unprintable characters that should not be in text files, such as COBOL programs, copybooks,& JCL.

If any binary data found, it will be reported as shown below, in vertical hexadecimal, similar to the 'uvhd' utility (documented on page '2D1').

verifytext - sample report

verifytext
  • scan for binary data, all files in cbl0 - tmp/cbl0_vfy.txt
 line# - binary data in file: cbl0/HPH2937B.CBL
                1         2         3         4         5         6         7
       123456789012345678901234567890123456789012345678901234567890123456789012
 00211 J90614       VALUE '!....L........TRAY1J  '.
       43333322222225445422200014BF00000055453422222222222222222222222222222222
       A90614000000061C550710000CF600000342191A007E0000000000000000000000000000
 00215 J90614       VALUE '.*I...COVTOPLINE1lllllllllllllllllllllllllllllllllll
       4333332222222544542202401F4455454444366666666666666666666666666666666666
       A90614000000061C55070A90AB3F64F0C9E51CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC

EOF: binary data in 1 of 8 total files in cbl0

verifytext - Operating Instructions


 uvcopy verifytext,fild1=cbl0[,filo1=tmp/cbl0_vfy.txt]  <-- example
 =====================================================
 - read all files in subdir 'cbl0' & create output report file
 - in 'tmp' subdir, named same as input subdir + '_vfy.txt'

 uvcopy verifytext,fild1=cbl0    <-- only need to specify the input directory
 ============================      - output file defaults as shown above

 uvlp12 tmp/cbl0_vfy.txt                    <-- print report
 =======================

See 'verifytext' at /home/uvadm/pf/IBM/verifytext

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

2F1. CNVaids: Vancouver Utility Aids

grepsum1 - summarize grep search results

Page '1G1' gave an example of using 'grep' to create a list of all EXEC programs used in the JCL directory. The results were NOT very good if our objective was to create a concise list of unique program names.

'grepsum1' is a uvcopy utility job that will sort the grep results, dropping duplicates, to get the desired unique list of EXEC programs.

example - grep for EXEC & drop duplicates from result


 1. grep EXEC jcl1/* >tmp/grepx
    ===========================

 2a. uvcopy grepsum1,fili1=tmp/grepx,filo1=tmp/grepx1
     ================================================
 uop=a0b80c0d0e0f2j1 - option defaults
     a0              - dsplcmnt to begin sort/sum key
       b80           - length of sort key
          c0         - begin sort key word#
            d0       - end sort key word# (disabled if d0)
            d1       - end sort key word#1 (overrides a/b dsplcmnt/lth)
            d1       - end sort key word#1 (overrides a/b dsplcmnt/lth)
              e1     - consider "," comma same as blank for word delimiter
                f1   - number of :colons in grep filenames prior to text
                f2   - scan past 2 :s for text (use if -n option on grep)
                  j1 - drop comments in JCL "//*" in cols 1-3
                  j2 - drop comments in COBOL "*" in col 7
 User OPtion (uop) defaults  = q1a0b80c0d0e0f2j1
  null to accept or re-specify (1 or more) ----->  <-- default options
 060326:085105:grepsum1: EOF fili01 rds=15 size=817: tmp2/grepx
 060326:085105:grepsum1: EOF filo01 wrts=10 size=351: tmp2/grepx3

results AFTER default options a0b80c0d0e0f2j1

 jcl1/jar100.jcl:3:(2) //STEP010 EXEC PGM=CAR100
 jcl1/jar120.jcl:3:(1) //STEP010 EXEC PGM=CAR120,PARM=2002
 jcl1/jar130.jcl:5:(1) //STEP010 EXEC PGM=CAR120,PARM=2003
 jcl1/jar150.jcl:5:(1) //STEP010 EXEC PGM=CAR150
 jcl1/jgl300.jcl:5:(3) //STEP010 EXEC PGM=IEBGENER
 jcl1/jar200.jcl:12:(1) //STEP020 EXEC PGM=CAR100,COND=(4,LT,STEP010),PARM=2003
 jcl1/jar140.jcl:5:(1) //STEP020 EXEC PGM=CAR120,PARM=2004
 jcl1/jar155.jcl:4:(1) //STEP020 EXEC PGM=CAR150
 jcl1/jgl300.jcl:9:(2) //STEP020 EXEC PGM=IDCAMS,COND=(4,LT,STEP010)
 jcl1/jgl330.jcl:10:(1) //STEP020 EXEC PGM=IDCAMS,COND=(8,LT,STEP010)
 The default options 'a0b80' set the sort/compare field to the entire record
 - displacement 0 & length 80
 - duplicates are removed only if they have the same STEP# & PARMs
 Also note that option 'j1' (default) has dropped the //* comment:
 jcl1/jar200.jcl:20:(1) //*STEP030 EXEC PGM=SORT

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

2F2. CNVaids: Vancouver Utility Aids

modify grepsum1 options to improve results

We will now use the 'word count' options to improve our results. On the grepsum1 command below, we specify options 'c0d3e1' which specifies the sort field as starting at word 0 (begin line) & ending after word 3.

Option 'e1' means that ',' commas are considered same as blanks for delimiting words, so the 1st 3 words will be STEP#, EXEC,& PGM=... Note the word#s are zero relative.


 2b. uvcopy grepsum1,fili1=tmp/grepx,filo1=tmp/grepx2,uop=c0d3e1
     ===========================================================

results AFTER options a0b0c0d3e1f2j1 + c0d3e1

 jcl1/jar100.jcl:3:(2) //STEP010 EXEC PGM=CAR100
 jcl1/jar120.jcl:3:(2) //STEP010 EXEC PGM=CAR120,PARM=2002
 jcl1/jar150.jcl:5:(1) //STEP010 EXEC PGM=CAR150
 jcl1/jgl300.jcl:5:(3) //STEP010 EXEC PGM=IEBGENER
 jcl1/jar200.jcl:12:(1) //STEP020 EXEC PGM=CAR100,COND=(4,LT,STEP010),PARM=2003
 jcl1/jar140.jcl:5:(1) //STEP020 EXEC PGM=CAR120,PARM=2004
 jcl1/jar155.jcl:4:(1) //STEP020 EXEC PGM=CAR150
 jcl1/jgl300.jcl:9:(3) //STEP020 EXEC PGM=IDCAMS,COND=(4,LT,STEP010)

Some duplicates have been removed by sorting/comparing on 1st 3 words, but we still have duplicates caused by differing STEP#s (1st word)

Our next test will specify options 'c2d3' which means start compare after word#2 & end after word#3, which selects only the PGM=..., since option 'e1' considers the ',' to end word3 as well as a blank.


 2c. uvcopy grepsum1,fili1=tmp/grepx,filo1=tmp/grepx2,uop=c2d3e1
     ===========================================================

results AFTER options a0b0c0d3e1f2j1 + c2d3e1

 jcl1/jar100.jcl:3:(2) //STEP010 EXEC PGM=CAR100
 jcl1/jar200.jcl:12:(1) //STEP020 EXEC PGM=CAR100,COND=(4,LT,STEP010),PARM=2003
 jcl1/jar120.jcl:3:(3) //STEP010 EXEC PGM=CAR120,PARM=2002
 jcl1/jar150.jcl:5:(2) //STEP010 EXEC PGM=CAR150
 jcl1/jgl300.jcl:9:(3) //STEP020 EXEC PGM=IDCAMS,COND=(4,LT,STEP010)
 jcl1/jgl300.jcl:5:(3) //STEP010 EXEC PGM=IEBGENER

We now have the desired concise list of unique programs EXECuted in all our JCLs. You will see only the 1st occurrence of filename, STEP# and PARM data (if any).

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

2G1. CNVaids: Vancouver Utility Aids

scan/replace jobs more powerful than grep & sed

Vancouver Utilities provides several general purpose 'scan/replace' utilities that can be more effective than 'grep' & 'sed' in complex situations because:

  1. The search pattern can be qualified with 1 or 2 other patterns that must or must not be present on the same line.

  2. Table driven scan jobs provide unlimited no of search & qualifier patterns

  3. These scan jobs create a much more informative report, with page headings to document the search & qualifier patterns, directory scanned, date, etc - matching lines reported with line# - End-Of-File total hits & total lines for each file with at least 1 hit - End-Of-Directory total hits & total lines

  4. Some of these scan jobs allow for patterns on 1 line qualified by patterns on other lines, preceding or following.

  5. Most of these jobs show matched data lines with their line numbers, which are useful for subsequent edit sessions.

  6. The scan reports are handy for assigning work to other programmers. Scan for patterns & qualifiers that represent a problem & the report can be used as a check list during editing & to make notes about problem situations.

    sample problem for scan1d

Suppose we wanted to scan a directory of mainframe JCL for all 'EXEC's with CONDition codes. Here are a few lines (of thousands):

 //JOBA     JOB
 .......... most lines not shown ..........
 //STEP020  EXEC PGM=IDCAMS,COND=(4,LT,STEP010)
 //JOBB     JOB
 .......... most lines not shown ..........
 //STEP050  EXEC PGM=CGL100,COND=(4,LT),REGION=1024K,PARM=$PARM1

Operating Instructions


 uvcopy scan1d,fild1=jcl0,arg1=EXEC,arg2=PGM,arg3=COND,uop=p2
 ============================================================
 - could enter all info on the command line as above

 uvcopy scan1d,fild1=jcl0,uop=p2
 ===============================
 - OR you will be prompted for info not on the command line
 - see next page for console display prompts & entries

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

2G2. CNVaids: Vancouver Utility Aids


 uvcopy scan1d,fild1=jcl0,uop=p2
 ===============================
 uop=q1a1b99999c0d256e0p1 - option defaults
       a1                 - begin scan at line #1 (default) of input file
       a0                 - causes prompt for search pattern to BEGIN scan
         b99999           - end scan at line #99999 (dflt) of input file
         b0               - causes prompt for search pattern to END scan
               c0         - begin scan at col #1 (zero rel) of input lines
                 d256     - length of scan area default 256 bytes
                     e1   - inhibit errmsgs when LF not found within rcsz
                       p1 - 1 present qual(31-60) & 1 absent qual(61-80)
                       p2 - 2 present quals(31-60+61-80) & NO absent quals
                       p4 - 2 absent quals(31-60+61-80) & NO present quals
 User OPtion (uop) defaults  = q1a1b99999c0d256e0p1
  null to accept or re-specify (1 or more) --> p2   <-- enter p2 2 present Quals
 enter search pattern (max 64) --------------> EXEC <-- enter search pattern
 enter 1st qualifier           --------------> PGM  <-- enter 1st qual
 enter 2nd qualifier           --------------> COND <-- entire 2nd qual
 enter options: i,p,q1/q2/q3,n,or null ----->
 080109:205346:scan1d: EOF filo01 wrts=47 size=2172: tmp/jcl0_EXEC hits=14
 EOJ, Output File written to: tmp/jcl0_EXEC
 enter command: vi,cat,more,lp,uvlp12,null -->

sample report

 Job: scan1d  Dir: jcl0  Search: EXEC  Qual1: PGM  Qual2: COND
  SearchBgn:    SearchEnd:    MatchOps:   UserOps: q1a1b99999c0d256e0p1p2
 ====================================================== 2008/01/09_20:53:46
 00005 //STEP020  EXEC PGM=CGL200,COND=(4,LT,STEP010),PARM=&YEAREND
 00010                   1 hits @EOF: jcl0/JGL220.jcl
 00011 //STEP020  EXEC PGM=IDCAMS,COND=(4,LT,STEP010)
 00018                   1 hits @EOF: jcl0/JGL320.jcl
 00012 //STEP020  EXEC PGM=CAR200,COND=(4,LT,STEP010),PARM=2006
 00017                   1 hits @EOF: jcl0/JAR200.jcl
 00006 //STEP020  EXEC PGM=IDCAMS,COND=(4,LT,STEP010)
 00011                   1 hits @EOF: jcl0/JPY402.jcl
 ====================================================== 2008/01/09_20:53:46
  EOD: 00014 hits in 0014 files of 0046 total (00576 lines)

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

Part_3. CNVaids.doc Vancouver Utility Conversion Aids

Part 3 Cross-Refs for COBOL & JCL - Contents


3A1. Cross-References for COBOL programs/copybooks & JCL/scripts
summary of all cross-refs available

3B1. Operating Instructions to generate ALL Cross-Ref reports
xrefall - script leaves all reports in subdir xref/...

3B2. Operating Instructions to generate any 1 Cross-Ref report
xcobcopy2 - sample Op. Instrns. for COBOL copybooks

COBOL Cross-Ref sample reports


3C1. xcobcopy1 - list all COPYBOOKS in any 1 PROGRAM
3C1. xcobcopy2 - crossref all PROGRAMS using any 1 COPYBOOK
3C2. xcobcall1 - list of all CALLED-PROGRAMs in each PROGRAM
3C2. xcobcall2 - crossref all PROGRAMS calling any 1 CALLED-PROGRAM
3C3. xcobfile2 - crossref all PROGRAMS using each external-file
3C4. xcobsql1 - list all SQL Includes in any 1 PROGRAM
3C4. xcobsql2 - crossref all PROGRAMS using any 1 SQL Include

JCL Cross-Ref sample reports


3D1. xkshfile1 - list all DATAFILES used in any 1 ksh SCRIPT
3D2. xkshfile2 - crossref show all ksh SCRIPTs using any 1 DATAFILE
3E1. xkshprog1 - list all PROGRAMs executed in any 1 ksh SCRIPT
3E2. xkshprog2 - crossref show all ksh SCRIPTS executing any 1 PROGRAM
3F1. xkshproc1 - list all PROCs executed in each JCL/ksh/script
3F2. xkshproc2 - shows all JCL/ksh/scripts executing each PROC
3G1. xkshparm1 - list all SYSIN/PARM modules in each JCL/ksh/script
3G2. xkshparm2 - shows all JCL/ksh/scripts referencing each SYSIN/PARM

5C1. cobfil51 - COBOL Files Report (related report in Part 5)
(not exactly a cross-reference, but a very useful report)
- information extracted from all COBOL programs in directory
- filenames, Input/Output, Org, Access, record size, copybook
- all programmers should have a copy before starting test/debug

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

3A1. CNVaids.doc Vancouver Utility Conversion Aids

Cross References for COBOL & JCL/scripts

These cross-reference reports will be invaluable during testing & debugging. Before you start test/debug, run these reports & house in 3-ring binders (with indexed tabs) for instant accessibility when needed.

Cross-Ref Reports Available

xcobcall1
  • list of all CALLED-PROGRAMs in each PROGRAM
xcobcall2
  • crossref all PROGRAMS calling any 1 CALLED-PROGRAM
xcobcopy1
  • list all COPYBOOKS in any 1 PROGRAM
xcobcopy2
  • crossref all PROGRAMS copying any 1 COPYBOOK
xcobfile2
  • crossref all PROGRAMS using each external-file
xcobsql1
  • list all SQL Includes in any 1 PROGRAM
xcobsql2
  • crossref all PROGRAMS using any 1 SQL Include
xkshfile1
  • list all DATAFILES used in any 1 ksh SCRIPT
xkshfile2
  • crossref show all ksh SCRIPTs using any 1 DATAFILE
xkshprog1
  • list all PROGRAMs executed in any 1 ksh SCRIPT
xkshprog2
  • crossref show all ksh SCRIPTS executing any 1 PROGRAM
xkshproc1
  • list all PROCs executed in each JCL/ksh/script
xkshproc2
  • shows all JCL/ksh/scripts executing each PROC
xkshparm1
  • list all SYSIN/PARM modules in each JCL/ksh/script
xkshparm2
  • shows all JCL/ksh/scripts referencing each SYSIN/PARM
xmvsfile1
  • list all DSN filenames in any 1 MVS JCL
xmvsfile2
  • crossref show all JOBnames using any 1 DSN datafile
xmvsprog1
  • list all EXEC/PGM names in any 1 MVS JCL
xmvsprog2
  • crossref all MVS JOBnames for any 1 EXEC/PGM name
xmvsproc1
  • list all PROCs executed in each MVS JCL
xmvsproc2
  • shows all MVS JCL executing each PROC
xvsefile1
  • list all DSN filenames in any 1 VSE JCL
xvsefile2
  • crossref show all JOBnames using any 1 DSN datafile
xvseprog1
  • list all EXEC/PGM names in any 1 VSE JCL
xvseprog2
  • crossref all VSE JOBnames for any 1 EXEC/PGM name

The 4 'xksh' reports provide the same info as the 4 'xmvs' or 4 'xvse' reports.

The 'xksh' reports are generated from the 'jcl3' directory of converted scripts, whereas the 'xmvs' & 'xvse' reports are generated from the 'jcl2' directory of JCLs before conversion. The 'xksh' reports will be more relevant after test/debug since they can then be run using the 'jcls' directory of tested & debugged scripts.

more Cross-References

See XREFjobs.htm for more detailed descriptions of these cross-references including listings of some of the scripts (xrefall, xcobcopy2, etc).

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

3B1. CNVaids: Cross-References for COBOL & JCL/scripts

Operating Instructions

The easiest way to run the cross-references is to run script 'xrefall' which generates all 'xcob' & all 'xksh' COBOL & JCL/script cross-references.

generating ALL Cross-Refs reports


 #1. xrefall cbls jcl3 ksh    <-- crossref COBOL & ksh scripts
     =====================

 #1a. xrefall cbls jcl2 mvs   <-- alternative for unconverted MVS JCL
      =====================

 #1b. xrefall cbls jcl2 vse   <-- alternative for unconverted VSE JCL
      =====================

 #2.  uvlpd12 xref            <-- print all files in the directory
      ============
  1. All cross-reference scripts leave the output reports in subdir xref/...

  2. arg3 on the xrefall command could be 'mvs' or 'vse' to crossreference unconverted MVS JCLs. arg2 would then have to be 'jcl2' to match.

  3. arg3 could be 'ksh' to crossref the converted Korn shell scripts. arg2 should then be 'jcl3' the output subdir for the JCL converter.

  4. If you are just starting to test/debug, arg2 must be 'jcl3' NOT 'jcls' Only 'jcl3' has ALL converted scripts, since we copy to 'jcls' 'one at a time' before starting debug of each jcl/script. After you have completed your conversion you would of course use 'jcls'.

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

3B2. CNVaids: Cross-References for COBOL & JCL/scripts

Op. Instrns. - Cross-Ref 1 at a time

We will use 'xcobcopy2' (COBOL copybook crossref) to illustrate the Op. Instrns. for 1 cross-ref report at a time (vs ALL shown above).


 xcobcopy2 directory options  <-- command format
 ===========================

 xcobcopy2 cbls [a16b16c4e1]  <-- cross-ref copybooks for prgms in cbls/...
 ===========================    - option defaults shown (described below)
 uop=q1a16b12c5e0d0j0l0s2w1 - option defaults
       a16                  - column to align references
          b12               - columns for fixed word horizontal spacing
          b30               - max cols, indicates variable (blank between)
             c5             - count max words per line (c5*b12=60+a16 = 76)
               e1           - bypass "*" col 7 & blank ". " (COBOL)
               e2           - target word must be enclosed in "quotes"
                 d1         - cnvrt "/" to " " (directory/filename)
                 d2         - cnvrt "_" to " " (printer class codes)
                 d4         - cnvrt "." to " " (drop extensions)
                 d8         - cnvrt "()" to " " (drop parens)
                   j1       - MVS JCL (bypasses //* cmts)
                   j2       - VSE JCL (bypasses * or /* cmts)
                   j4       - Korn shell scripts (bypasses # col1)
                     l1     - translate to lower case (keywords lower)
                       s2   - space2 (space1 in multiline groups)
                         w1 - target-word offset, to word after key-word
 User OPtion (uop) defaults  = q1a16b16c4e0d0j0l0s2w1a16b16c4e3l1
  null to accept or re-specify (1 or more) -->
 080405:105049:xref2: sort phase complete, used 64 megabytes, sort output begin
 080405:105049:xref2: EOF fili01 rds=38 size=1963: tmp/grep1
 080405:105049:xref2: EOF filo01 wrts=16 size=526: tmp/xcobcopy2a
 chkcopy2 - *flag missing copybooks on COBOL cross-reference report
 080405:105049:chkcopy2: EOF fili01 rds=16 size=526: tmp/xcobcopy2a
 080405:105049:chkcopy2: EOF fili02 rds=6 size=74: tmp/cpys2
 080405:105049:chkcopy2: EOF filo01 wrts=16 size=536: xref/xcobcopy2
 report generated = xref/xcobcopy2
  - use uvlp12,uvlp14,uvlp16 to laser print at 12,14,16 cpi
 enter command (vi,cat,more,uvlp12,uvlp14,uvlp16,etc)  ----> more <--

sample report

 xcobcopy2 ** crossref all PROGRAMS using each COPYBOOK **
 Keyword=copy:include  Exclude=unix Include=.cpy  page#  1
 Directory=/home/mvstest/testlibs/cbls Options=q1a16b16c4e0d0j0l0s2w1a16b16c4e3l1
 =======================================================2008/04/05_10:50:49
  custmas.cpy      car100.cbl      car120.cbl      car130.cbl      car140.cbl
  ____________6    car150.cbl      car200.cbl
 *paymas.cpy       cpy100.cbl
  saledtl.cpy_2    car150.cbl      car200.cbl

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

3C1. CNVaids: Cross-References for COBOL

COBOL Cross-Ref Sample Reports

These sample reports are based on the supplied test/demo JCL & COBOL programs. We will illustrate: xcobcopy1/2, xcobcall1/2, xcobfile2, xcobsql1/2, xkshfile1/2, xkshprog1/2.

xcobcopy1 - list all COPYBOOKS in any 1 PROGRAM


 xcobcopy1 cbls  <-- run separately (or xrefall, create all rpts in xref/...)
 ==============
 xcobcopy1 ** list all COPYBOOKS in each PROGRAM **
 Keyword=copy:include  Exclude=unix Include=.cpy  page#  1
 Directory=/home/mvstest/testlibs/cbls
 Options=q1a16b16c4e0d0j0l0s2w1a16b16c4e3l1q0i7
 =======================================================2008/04/05_11:46:21
 car100.cbl       custmas.cpy
 car120.cbl       custmas.cpy
 car130.cbl       custmas.cpy
 car140.cbl       custmas.cpy
 car150.cbl_2     custmas.cpy     saledtl.cpy
 car200.cbl_4     custmas.cpy     saledtl.cpy     sdline.cpy      stline.cpy
 cpy100.cbl       paymas.cpy

xcobcopy2 - crossref all PROGRAMS using any 1 COPYBOOK


 xcobcopy2 cbls  <-- run separately (or xrefall, create all rpts in xref/...)
 ==============
 xcobcopy2 ** crossref all PROGRAMS using each COPYBOOK **
 Keyword=copy:include  Exclude=unix Include=.cpy  page#  1
 Directory=/home/mvstest/testlibs/cbls Options=q1a16b16c4e0d0j0l0s2w1a16b16c4e3l1q0i7
 =======================================================2008/04/05_11:46:21
  custmas.cpy      car100.cbl      car120.cbl      car130.cbl      car140.cbl
  ____________6    car150.cbl      car200.cbl
 *paymas.cpy       cpy100.cbl
  saledtl.cpy_2    car150.cbl      car200.cbl
  sdline.cpy       car200.cbl
  stline.cpy       car200.cbl
Note
  • the '*' above indicates missing copybooks
  • this crossref script runs an additional uvcopy job
  • to check existence of the copybook in the 'cpys' subdir

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

3C2. CNVaids: Cross-References for COBOL

xcobcall1 - list of all Called-Programs in each Program


 xcobcall1 cbls  <-- run separately (or xrefall, create all rpts in xref/...)
 ==============
 Keyword=call  Exclude= Include=  page#  1
 Directory=/home/mvstest/cbls
 Options=q1a16b16c4e0d0j0l0s2w1a16b16c4e1q0i7
 =======================================================2005/03/17_15:15:51
 car130.cbl       getparm
 car140.cbl       getparm

xcobcall2 - crossref all Programs calling any 1 Called-Program


 xcobcall2 cbls  <-- run separately (or xrefall, create all rpts in xref/...)
 ==============
 Keyword=call  Exclude= Include=  page#  1
 Directory=/home/mvstest/cbls
 Options=q1a16b16c4e0d0j0l0s2w1a16b16c4e1q0i7
 =======================================================2005/03/17_15:15:51
 *getparm_2        car130.cbl      car140.cbl
Note
  • the '*' above indicates missing called programs
  • this crossref script runs an additional uvcopy job
  • to check existence of the called program in the 'cbls' subdir

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

3C3. CNVaids: Cross-References for COBOL

xcobfile2 - cross-ref programs using each filename


 xcobfile2 cbls  <-- run separately (or xrefall, create all rpts in xref/...)
 ==============
 xcobfile2 ** crossref all PROGRAMS using each external-file **
 Keyword=external  Exclude= Include=  page#  1
 Directory=/home/mvstest/cbls Options=q1a16b16c4e0d0j0l0s2w1a16b16c4e1l1
 =======================================================2007/06/10_19:19:39
 acctmas          cgl100.cbl
 actlist          cgl100.cbl
 custmas          car100.cbl      car120.cbl      car130.cbl      car140.cbl
 ________7        car150.cbl      car200.cbl      testunix1.cbl
 custmas1         car101.cbl
 glmsnew          cgl200.cbl
 glmsold          cgl200.cbl
 gltrans          cgl200.cbl
 nalist           car100.cbl      car101.cbl      car120.cbl      car130.cbl
 _______7         car140.cbl      car150.cbl      cpy100.cbl
 paymas           cpy100.cbl
 saledtl          car200.cbl
 salelst          car200.cbl

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

3C4. CNVaids: Cross-References for COBOL

xcobsql1 list all SQL Includes in any 1 Program


 xcobsql1 cbls  <-- run separately (or xrefall, create all rpts in xref/...)
 =============
 xcobsql1 ** list all SQL-INCLUDES in each PROGRAM **
 Keyword=sql include  Exclude=~~ Include=~~  page#  1
 Directory=/home5/efunds2/testlibs/cbls
 Options=q1a16b16c4e0d0j0l0s2w1a16b16c4e1l1w2
 =======================================================2008/04/05_15:50:52
 avf00800.cbl_4   sqlca.cpy       tdbns04.cpy     tdbns05.cpy     tdbrf14.cpy
 avf01000.cbl_2   sqlca.cpy       tdbdw19.cpy
 avf01300.cbl_2   sqlca.cpy       tdbrf14.cpy
 avf01400.cbl_2   sqlca.cpy       tdbrf14.cpy
 avf50000.cbl_2   sqlca.cpy       tdbrf01.cpy
 avf50200.cbl_4   sqlca.cpy       tdbrf01.cpy     tdbrf06.cpy     tdlrf01.cpy
 avf50300.cbl_2   sqlca.cpy       tdbrf01.cpy

xcobsql2 crossref all Programs using any 1 SQL Include


 xcobsql2 cbls  <-- run separately (or xrefall, create all rpts in xref/...)
 =============
 xcobsql2 ** crossref all PROGRAMS using each SQL-INCLUDE **
 Keyword=sql include  Exclude=~~ Include=~~  page#  1
 Directory=/home5/efunds2/testlibs/cbls Options=q1a16b16c4e0d0j0l0s2w1a16b16c4e1l1w2
 =======================================================2008/04/05_15:51:05
  actbp.cpy_4      dbasrb26.cbl    dbasrb27.cbl    dbasrb31.cbl    dbasrb32.cbl

actbpsum.cpy_2 dbasrb26.cbl dbasrb27.cbl

  actgbp.cpy_4     dbasrb26.cbl    dbasrb27.cbl    dbasrb31.cbl    dbasrb32.cbl
  actsmd.cpy_3     dbasrb30.cbl    dbasrb31.cbl    dbasrb32.cbl
  actsum.cpy_2     dbasrb26.cbl    dbasrb27.cbl
  bpsmd.cpy_3      dbasrb30.cbl    dbasrb31.cbl    dbasrb32.cbl
  cpy077.cpy       dba00300.cbl    nas20500.cbl    nas21200.cbl    nas21300.cbl
  __________       nas23500.cbl    nas24700.cbl    nas24800.cbl    nas24900.cbl
  ___________9     pdw20300.cbl
  cpy078.cpy       pdw20300.cbl

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

3D1. CNVaids: Cross-References for JCL/scripts

xkshfile1 - list all DATAFILES used in any 1 ksh SCRIPT


 xkshfile1 jcl3  <-- run separately (or xrefall, create all rpts in xref/...)
 ==============
 xkshfile1 ** list all DATAFILES used in any 1 ksh SCRIPT **
 Keyword=exportfile:exportgen  Exclude=autoload Include=  page#  1
 Directory=/home/mvstest/jcl3
 Options=q1a16b16c4e0d0j0l0s2w1a16b50c1j4w2q0i7
 =======================================================2005/03/08_09:05:02
 ikjeft01.ksh     $DW/mxplib/ikjdemo1
 jar100.ksh       ar/customer.master
 ___________2     ar/customer.namelist
 jar200.ksh       $DW/${JOBID}_tempsls_2
 __________       ar/customer.master.indexed
 __________       ar/sales.items
 ___________5     ar/sales.list
 jgl100.ksh       gl/account.acntlist_
 ___________2     gl/account.master_
 jgl200.ksh       $DW/${JOBID}_tempglt_2
 __________       gl/account.master__2
 __________       gl/account.trans
 ___________6     gl/ctlcdlib/pgl200s1
 jgl300.ksh       $DW/${JOBID}_tempglm_2
 ___________4     gl/account.master__2
 jgl320.ksh       $DW/${JOBID}_tempglm_2
 ___________4     gl/account.master__2
 jgl400.ksh       $DW/${JOBID}_tempglm_2
 ___________4     gl/account.master__2
 jgl420.ksh       $DW/${JOBID}_tempglm_2
 ___________4     gl/account.master__2
 jgl500.ksh       gl/account.acntlist_
 ___________2     gl/account.export
 jpy200.ksh       $DW/${JOBID}_temptc_2
 __________       py/ctlcdlib/ppy200s1
 __________       py/payroll.master_
 __________       py/time.cards
 ___________6     py/timecard.edit_
 splitsl1.ksh     ar/sales.items
 ____________     work/sales.group1
 _____________3   work/sales.group2

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

3D2. CNVaids: Cross-References for JCL/scripts

xkshfile2 - crossref all ksh SCRIPTs using any 1 DATAFILE


 xkshfile2 jcl3  <-- run separately (or xrefall, create all rpts in xref/...)
 ==============
 xkshfile2 ** crossref to show all ksh SCRIPTs using any 1 DATAFILE **
 Keyword=exportfile:exportgen  Exclude=autoload Include=  page#  1
 Directory=/home/mvstest/jcl3
 Options=q1a16b16c4e0d0j0l0s2w1a40b16c3j4w2q0i7
 =======================================================2005/03/08_09:05:03
 $DW/${JOBID}_tempglm                     jgl300.ksh_2    jgl320.ksh_2    jgl400.ksh_2
 _____________________8                   jgl420.ksh_2
 $DW/${JOBID}_tempglt_2                   jgl200.ksh_2
 $DW/${JOBID}_tempsls_2                   jar200.ksh_2
 $DW/${JOBID}_temptc_2                    jpy200.ksh_2
 $DW/mxplib/ikjdemo1                      ikjeft01.ksh
 ar/customer.master                       jar100.ksh
 ar/customer.master.indexed               jar200.ksh
 ar/customer.namelist                     jar100.ksh
 ar/sales.items_2                         jar200.ksh      splitsl1.ksh
 ar/sales.list                            jar200.ksh
 gl/account.acntlist__2                   jgl100.ksh      jgl500.ksh
 gl/account.export                        jgl500.ksh
 gl/account.master_                       jgl100.ksh      jgl200.ksh_2    jgl300.ksh_2
 ___________________11                    jgl320.ksh_2    jgl400.ksh_2    jgl420.ksh_2
 gl/account.trans                         jgl200.ksh
 gl/ctlcdlib/pgl200s1                     jgl200.ksh
 py/ctlcdlib/ppy200s1                     jpy200.ksh
 py/payroll.master_                       jpy200.ksh
 py/time.cards                            jpy200.ksh
 py/timecard.edit_                        jpy200.ksh
 work/sales.group1                        splitsl1.ksh
 work/sales.group2                        splitsl1.ksh

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

3E1. CNVaids: Cross-References for JCL/scripts

xkshprog1 - list all PROGRAMs executed in any 1 ksh SCRIPT


 xkshprog1 jcl3  <-- run separately (or xrefall, create all rpts in xref/...)
 ==============
 xkshprog1 ** list all PROGRAMs executed in any 1 ksh SCRIPT **
 Keyword=PROGID  Exclude= Include=  page#  1
 Directory=/home/mvstest/jcl3
 Options=q1a16b16c4e0d0j0l0s2w1a16b16c4j4q0i7
 =======================================================2005/03/08_09:05:03
 ikjeft01.ksh     ikjeft01
 jar100.ksh       car100
 jar200.ksh_2     car200          sort
 jar300.ksh       car300
 jgl100.ksh       cgl100
 jgl200.ksh_2     cgl200          sort
 jgl300.ksh_2     idcams          iebgener
 jgl320.ksh_2     idcams          iebgener
 jgl360.ksh       idcams
 jgl400.ksh_2     cobol1          cobol2
 jgl420.ksh_2     cobol1          cobol2
 jgl500.ksh       iefbr14
 jpy200.ksh_2     cpy200          sort
 splitsl1.ksh     sort

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

3E2. CNVaids: Cross-References for JCL/scripts

xkshprog2 - crossref all ksh SCRIPTS executing any 1 PROGRAM


 xkshprog2 jcl3  <-- run separately (or xrefall, create all rpts in xref/...)
 ==============
 xkshprog2 ** crossref to show all ksh SCRIPTS executing any 1 PROGRAM **
 Keyword=PROGID  Exclude= Include=  page#  1
 Directory=/home/mvstest/jcl3
 Options=q1a16b16c4e0d0j0l0s2w1a16b16c4j4q0i7
 =======================================================2005/03/08_09:05:03
  car100           jar100.ksh
  car200           jar200.ksh
  car300           jar300.ksh
  cgl100           jgl100.ksh
  cgl200           jgl200.ksh
  cobol1_2         jgl400.ksh      jgl420.ksh
  cobol2_2         jgl400.ksh      jgl420.ksh
  cpy200           jpy200.ksh
 *idcams_3         jgl300.ksh      jgl320.ksh      jgl360.ksh
 *iebgener_2       jgl300.ksh      jgl320.ksh
 *iefbr14          jgl500.ksh
 *ikjeft01         ikjeft01.ksh
 *sort_4           jar200.ksh      jgl200.ksh      jpy200.ksh      splitsl1.ksh
Note
  • the '*' above indicates missing programs
  • this crossref script runs an additional uvcopy job
  • to check existence of the programs in the 'cbls' subdir
  • of course the mainframe utilities will not be found there

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

3F1. CNVaids: Cross-References for JCL/scripts

xkshproc1 - list all PROCs executed in any 1 ksh SCRIPT


 xkshproc1 jcl3  <-- run separately (or xrefall, create all rpts in xref/...)
 ==============
 xkshproc1 ** crossref all MVS JOBnames for each EXEC PROCname **
 Keyword=EXEC  Exclude=PGM Include=call  page#  1
 Directory=/home/mvstest/testlibs/jcl3
 Options=q1a16b16c4e0d0j0l0s2w1a16b16c4w1q0i7
 =======================================================2009/05/08_15:57:05
 jgl100.ksh       PGL100
 jgl200.ksh       PGL200
 jpy200.ksh_3     PPY200          PPY299          PPY300

3F2. xkshproc2 - crossref ksh SCRIPTS executing any 1 PROC


 xkshproc2 jcl3  <-- run separately (or xrefall, create all rpts in xref/...)
 ==============
  xkshproc2 ** crossref all MVS JOBnames for each EXEC PROCname **
  Keyword=EXEC  Exclude=PGM Include=call  page#  1
  Directory=/home/mvstest/testlibs/jcl3 Options=q1a16b16c4e0d0j0l0s2w1a16b16c4w1q0i7
  =======================================================2009/05/08_15:57:05
  PGL100           jgl100.ksh
  PGL200           jgl200.ksh
  PPY200           jpy200.ksh
 *PPY299           jpy200.ksh
  PPY300           jpy200.ksh

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

3G1. CNVaids: Cross-References for JCL/scripts

xkshparm1 - list all SYSIN/PARMs referenced in any 1 ksh SCRIPT


 xkshparm1 jcl3  <-- run separately (or xrefall, create all rpts in xref/...)
 ==============
 xkshparm1 ** crossref to show all ksh SCRIPTS referencing each PARM **
 Keyword=parms  Exclude=~~ Include=exportfile  page#  1
 Directory=/home/mvstest/testlibs/jcl3
 Options=q1a16b16c4e0d0j0l0s2w1a16b16c4d1j4l1w1q0i7
 =======================================================2009/05/08_15:57:05
 iebcopy.ksh      products
 ikjeft01.ksh     ikjdemo1
 jgl200.ksh       pgl200s1
 jgl910.ksh       pgl200s1
 jpy200.ksh       ppy200s1
 jpy910.ksh       pgl200s1

3G2. xkshparm2 - crossref ksh SCRIPTS executing any 1 PARM


 xkshparm2 jcl3  <-- run separately (or xrefall, create all rpts in xref/...)
 ==============
  xkshparm2 ** crossref to show all ksh SCRIPTS referencing each PARM **
  Keyword=parms  Exclude=~~ Include=exportfile  page#  1
  Directory=/home/mvstest/testlibs/jcl3 Options=q1a16b16c4e0d0j0l0s2w1a16b16c4d1j4l1w1q0i7
  =======================================================2009/05/08_15:57:05
  ikjdemo1         ikjeft01.ksh
  pgl200s1_3       jgl200.ksh      jgl910.ksh      jpy910.ksh
 *ppy200s1         jpy200.ksh
  products         iebcopy.ksh

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

Part_4. CNVaids.doc Vancouver Utility Conversion Aids

Table Summaries & Statistics - Contents


4A1. statallmvs1 - table summaries of COBOL, MVS JCL,& Korn shell scripts
4A1. statallvse1 - table summaries of COBOL, VSE JCL,& Korn shell scripts
- used here for the JCL/ksh summaries (see '4B1' for COBOL)

4B1. statmvsjcl1 - table summarize (gather statistics from) mainframe MVS JCL
- count references in all JCL in directory for each:
program, PROC, top-node, SYSIN/parm module,& DSN/filename

4B1. statvsejcl1 - similar report for VSE vs MVS (reports not shown)

4B2. statksh1 - table summarize (get stats for) converted Korn shell scripts
- count references in all Korn shell scripts for each:
  program, top-node, exportfile/gen, parm module,& filename
- similar info as statmvsjcl1, but from converted scripts (vs JCL)

4B3. statcbl1 - table summarize (gather statistics) for COBOL programs
- count refs to each copybook, called program,& file ORG type

4C1. statlogin1 - should appeal to Unix/Linux system administrators.
- reads system file /var/log/messages and creates table summary
report of user logins by month & userid.

4D1. table2 - general purpose table summary by any desired argument
- for any file of fixed length records
- specify table arguments & acum fields by displacement & length
- see sample table summary of sales qty & amount by product#

4D2. table3d - allows you to specify a 'key-word', preceding a 'target-word'.
- job searches all lines of all files in the directory
- report shows 1 line for each target-word with counts & '%'s

4E1. recsizes1 - create summary table of record-sizes in a text file
- demo uvcopy to table analyze any item with very little code

4F1. tblexts1 - create table summary counts of file extensions in a subdir
  (.cbl, .cpy, .jcl, .ctl, etc)
- can use on cblx/*.err to calc compile failure percentage
  (.cbl, .idy, .int, .err)

4F2. tblexts2 - table summary of filename extensions in a directory tree
- reads filenames from all sub-dirs in a directory tree
- prior job (tblexts1) reads filenames from only 1 directory

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

4A1. CNVaids: Table Summaries & Statistics

statallmvs1/statallvse1 - table stats from JCL/scripts

Script 'statallmvs1' runs several uvcopy jobs to create table summaries by analyzing all files in jcl2 (MVS JCL), jcl3 (converted JCL/scripts), & cbls (converted COBOL). 'statallvse1' is the same,but for VSE JCL.


4B1. statmvsjcl1 - table summarize (gather statistics from) mainframe JCL
- count refs to each program, PROC, & top-node used in all JCLs

4B2. statksh1 - table summarize (get stats for) converted Korn shell scripts
- count refs to each program, PROC, & top-node used in Ksh scripts

4B3. statcbl1 - table summarize (gather statistics) for COBOL programs
- count refs to each copybook, called program,& file ORG type
Note
  • original mainframe JCL is in jcl0/... BUT we run reports from jcl2/...
  • because jcl2/... has all PROCs expanded
  • just before conversion to Korn shell scripts in jcl3/...

statallmvs1/statallvse1 - Operating Instructions


 #1. cdl   <-- change to libraries superdir (/home/mvstest/testlibs for demo)
     ===     - or your Libraries

 #2. mkdir stats   <-- make subdir to receive report (if not existing)
     ===========

 #3. statallmvs1 all  <-- script to run uvcopy jobs statcbl1,statmvsjcl2,statksh1
     ===============

 #3a. statallvse1 all <-- same, but for VSE JCL
      ===============

 #4a. vi stats/jcl2_pgms        <-- see sample reports on page '4B1'
 #4b. vi stats/jcl2_procs
 #4c. vi stats/jcl2_topnodes
 #4d. vi stats/jcl2_parms         - (module) names from DSNs
 #4e. vi stats/jcl2_filenames     - full DSN names (may be very long)

 #5a. vi stats/jcl3_pgms        <-- see sample report on page '4B2'
 #5b. vi stats/jcl3_topnodes
 #5c. vi stats/jcl3_exportfiles
 #5d. vi stats/jcl2_parms         - (module) names from DSNs
 #5e. vi stats/jcl2_filenames     - full DSN names (may be very long)

 #6a. vi stats/cbls_calledpgms  <-- see sample reports on page '4B3'
 #6b. vi stats/cbls_copybooks
 #6c. vi stats/cbls_ORGtypes

The following sample reports were run for the supplied set of test/demo JCL & COBOL programs in /home/uvadm/mvstest/testlibs/...

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

4B1. CNVaids: Table Summaries & Statistics

statmvsjcl1 - mainframe JCL stat report samples


 uvcopy statmvsjcl1 <-- create stats of: JCL programs, procs,& Top-Nodes
 ==================
 statmvsjcl1  2009/05/01_11:15:22  Summary table of EXEC PGMs in jcl2 jcl2/jobtest2.jcl
 tbl#001 pg#001     -argument-
 line#  count    %  EXEC PGM
    1       25  36  ALLCOBOL(3+digits)
    2        4   5  FTP
    3       13  18  IDCAMS
    4        1   1  IEBCOPY
    5       10  14  IEBGENER
    6        5   7  IEFBR14
    7        1   1  IKJEFT01
    8        2   2  ISRSUPC
    9        1   1  MAILTOLN
   10        7  10  SORT
            69*100   *TOTAL*
 statmvsjcl1  2009/05/01_11:15:22  Summary table of EXEC PROCs in jcl2 jcl2/jobtest2.jcl
 tbl#002 pg#001     -argument-
 line#  count    %  EXEC PROC
    1        1  25  PGL100
    2        1  25  PGL200
    3        1  25  PPY200
    4        1  25  PPY300
             4*100   *TOTAL*
 statmvsjcl1  2009/05/01_11:15:22  Summary table of DSN Top-Nodes in jcl2 jcl2/jobtest2.jcl
 tbl#003 pg#001     -argument-
 line#  count    %  Top-Node
    1       29  18  &&(ALLTempFiles)
    2       35  22  AR
    3       65  41  GL
    4       14   8  PY
    5        7   4  PYTEST
    6        2   1  RPTS
    7        3   1  WRK
    8        1   0  WRK(IKJDEMO1)
           156*100   *TOTAL*

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

MVS JCL statistics tables continued

 statmvsjcl1  2009/07/13_19:57:42  Summary table of DSN (parms) in jcl2 jcl2/jobtest2.jcl
 tbl#004 pg#001     -argument-
 line#  count    %  (parm-name)
    1        1  16  IKJDEMO1
    2        3  50  PGL200S1
    3        1  16  PPY200S1
    4        1  16  PRODUCTS
             6*100   *TOTAL*
Note
  • (sysins) or (parms) above extracted from DSN(modules) listed below
  • several filenames omitted from table below to fit on this page
 statmvsjcl1  2009/07/13_19:57:42  Summary table of DSN filenames in jcl2 jcl2/jobtest2.jcl
 tbl#005 pg#001     -argument-
 line#  count    %  DSN/filename
    1       16   9  &&TEMPGLM
    5        2   1  &&TEMPTC
    6        1   0  AR.ACCOUNT.MASTER
    7       11   6  AR.CUSTOMER.MASTER
    8        2   1  AR.CUSTOMER.MASTER.INDEXED
    9        2   1  AR.CUSTOMER.NAMEADRS.LIST100
   14        1   0  AR.PARMLIB(PRODUCTS)
   15        2   1  AR.SALES$TRAN#WEEK
   16        4   2  AR.SALES.ITEMS
   19        2   1  AR.SALES.LIST
   20        1   0  AR.SALES.PRODUCTS
   21        1   0  AR.TRAN&MONTH.SALES
   22        1   0  GL.ACCOUNT.ACNTLIST
   23        1   0  GL.ACCOUNT.ACNTLIST(+1)
   24        1   0  GL.ACCOUNT.EXPORT
   25        1   0  GL.ACCOUNT.MASTER
   26       16   9  GL.ACCOUNT.MASTER(+1)
   27        1   0  GL.ACCOUNT.MASTER(+2)
   28        1   0  GL.ACCOUNT.MASTER(+3)
   29        1   0  GL.ACCOUNT.MASTER(-1)
   30        1   0  GL.ACCOUNT.MASTER(-2)
   33       22  13  GL.ACCOUNT.MASTER(0)
   34        4   2  GL.ACCOUNT.TRAN1
   35        1   0  GL.ACCOUNT.TRANS
   36        5   3  GL.ACCOUNT.TRANS(+1)
   39        6   3  GL.ACCOUNT.TRANS(0)
   41        3   1  GL.PARMS(PGL200S1)
   42        1   0  PY.PARMS(PPY200S1)
   43        4   2  PY.PAYROLL.MASTER
   44        1   0  PY.PAYROLL.MASTER2
   46        1   0  PY.TIME.&DAY
   47        1   0  PY.TIME.&DAY.&MONTH.&YEAR
   56        2   1  RPTS.CUSTOMER.NAMES
   57        1   0  WRK(IKJDEMO1)
   60        1   0  WRK.SALES.GROUP2
           161*100   *TOTAL*

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

4B2. CNVaids: Table Summaries & Statistics

statksh1 - converted JCL/script statistics


 uvcopy statksh1 <-- create stats of: Korn shell Programs, PROCs,& Top-Nodes
 ===============
 statksh1  2009/05/01_11:14:42  Summary table of PROGIDs in jcl3 jcl3/ikjeft01.ksh
 tbl#001 pg#001     -argument-
 line#  count    %  PROGID
    1       26  37  ALLCOBOL(3+digits)
    2        4   5  ftp
    3       13  18  idcams
    4        1   1  iebcopy
    5       10  14  iebgener
    6        5   7  iefbr14
    7        2   2  isrsupc
    8        1   1  mailtoln
    9        7  10  sort
            69*100   *TOTAL*
 statksh1  2009/05/01_11:14:42  Summary topnode/subdirs in jcl3 jcl3/ikjeft01.ksh
 tbl#003 pg#001     -argument-
 line#  count    %  topnode/
    1        4   1   $INPUT1
    2       28  13   $JGDG/
    3       34  16   $JTMP/
    4        1   0   $PARMFILE
    5        6   2   $RUNLIBS/
    6       12   5   $SYOT/
    7       27  12   $SYSIN
    8       34  16   ar/
    9       41  19   gl/
   10        9   4   misc/
   11       11   5   py/
   12        2   0   rpts/
           209*100   *TOTAL*
 statksh1  2009/05/01_11:14:42  Summary exportfile/exportgen subdirs in jcl3 jcl3/ikjeft01.ksh
 tbl#002 pg#001     -argument-
 line#  count    %  exportfile/gen subdir/
   - - - exportfiles omitted, exportgen... shown - - -
   12       27  12  exportgen0 gl/
   13        1   0  exportgen0 py/
   14       26  12  exportgen1 $JGDG/
   15        1   0  exportgen2 $JGDG/
   16        1   0  exportgen3 $JGDG/
   17        3   1  exportgenall gl/
   18        1   0  exportgenall py/
   19        2   0  exportgenp gl/
           209*100   *TOTAL*
Note
  • Korn shell statistics tables 4 & 5 (parms & filenames) omitted
  • same as for JCL tables 4 & 5 listed on previous page

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

4B3. CNVaids: Table Summaries & Statistics

statcbl11 - COBOL stat report samples


 uvcopy statcbl1 <-- create stats: COBOL copybooks, called-programs,& ORG types
 ===============
 statcbl1  2009/05/01_11:15:02  Summary of copybooks in cbls cbls/cgl100.cbl
 tbl#001 pg#001     -argument-
 line#  count    %  copybook
    1        6  17  custmas.cpy
    2        1   2  paymas.cpy
    3        2   5  saledtl.cpy
    4        1   2  sdline.cpy
    5        1   2  stline.cpy
    6       12  34  unixproc1.cpy
    7       12  34  unixwork1.cpy
            35*100   *TOTAL*
 statcbl1  2009/05/01_11:15:02  Summary of called programs in cbls cbls/cgl100.cbl
 tbl#002 pg#001     -argument-
 line#  count    %  called program
    1        2 100  getparm
             2*100   *TOTAL*
 statcbl1  2009/05/01_11:15:02  Summary of ORGANIZATION types in cbls cbls/cgl100.cbl
 tbl#003 pg#001     -argument-
 line#  count    %  organization
    1        2   8  indexed
    2        9  39  line sequential
    3       12  52  record sequential
            23*100   *TOTAL*
Note
  • the 'statcbl1' reports are also documented in Part_5 (COBOL aids)
  • duplicated here since part of the 'statallmvs1/statallvse1' scripts

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

4C1. CNVaids: Table Summaries & Statistics

statlogin1 - table summary user logins by month & userid

'statlogin1' should appeal to Unix/Linux system administrators. It reads a system file (/var/log/messages) and creates a table summary report of user logins by month & userid. Here are a few lines of the input file, followed by a sample report.

sample input /var/log/messages

 Oct 23 06:11:51 uvsoft3 login[16341]: session opened for user laval4 by LOGIN(uid=0)
 Oct 23 06:11:51 uvsoft3  -- laval4[16341]: LOGIN ON tty5 BY laval4
 Oct 23 06:13:08 uvsoft3 ftpd[16342]: FTP LOGIN FROM 192.168.0.2, uvsoft2.uvsoft.ca (laval4)
 Oct 23 07:15:00 uvsoft3 login[16341]: session closed for user laval4
 Oct 23 07:15:23 uvsoft3 login[16516]: authentication failure; logname=LOGIN uid=0 euid=0 tty=tty5 ruser= rhost=  user=mvstest
 Oct 23 07:15:33 uvsoft3 login[16516]: session opened for user mvstest by LOGIN(uid=0)
 Oct 23 07:15:33 uvsoft3  -- mvstest[16516]: LOGIN ON tty5 BY mvstest
 Oct 23 21:00:42 uvsoft3 shutdown: shutting down for system halt

sample output report

 statlogin1  2007/11/26_21:24:24  logins by month & userid
 tbl#001 pg#001     -argument-
 line#  count    %  mth login
     1      13   5  Nov efunds2
     2      13   5  Nov laval4
     3      23  10  Nov mvstest
     4      27  12  Nov root
     5      26  11  Nov uvadm
     6      26  11  Nov uvbak
     7       8   3  Oct efunds2
     8       7   3  Oct laval4
     9      10   4  Oct mvstest
    10      11   4  Oct root
           222*100   *TOTAL*

This uvcopy job scans for 'session opened', then scans for ' user ', extracts the following word (userid),& uses the userid & month as the table argument

See 'statlogin1' job listed at http://www.uvsoftware.ca/tablejobs.htm#J1. To scan for desired data & build table above requires only 21 lines of code. The job is 87 lines total because we include 66 lines of comments for operating instructions & a samples of input & output.

Using this job as an example, you should be able to write other jobs to table summarize other items that interest you from this file or other system files.

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

4D2. CNVaids: Table Summaries & Statistics

statlogin1 - uvcopy coding

 # statlogin1 - table summary of user logins by month & userid
 #            - based on /var/log/messages
 #            - by Owen Townsend, UV Software, Nov 26/2007
 #
 # uvcopy statlogin1,fili1=/var/log/messages,filo1=stats/login.rpt1
 # ================================================================
 # uvcopy statlogin1   <-- same & easier (files default as shown above)
 # =================
 #
 rop=r1    # option to prompt for report disposition at EOJ
 fili1=/var/log/messages,typ=LST,rcs=256
 filo1=stats/login.rpt1,typ=LSTt,rcs=128
 @run
        opn     all
 #
 # begin loop to get & process messages lines until EOF
 man20  get     fili1,a0              get next line of messages
        skp>    man90                 (cc set > at EOF)
        sqzc1   a0(256),' '           ensure only 1 blank between words
 #
 # scan for 'session opened' & 'user' login
 # table user logins by month & by month+day
        scn     a0(100),' session opened '
        skp!    man20
        scn     a0(100),' user '
        skp!    man20
        clr     b0(500),' '           clear workarea
        mvu     b0(25),ax6,' '        store user login until ending blank
        mvc     b100(3),a0            store mth (1st 3 bytes)
        mvc     b104(25),b0           follow with userid
        tblt1f4 b100(32),'mth login'
        skp     man20                return to get next line
 #
 # EOF - dump tables, close files, prompt for report view (rop=r1), end job
 man90  tbpt1   filo1,'logins by month & userid'
        cls     all
        eoj
Note
  • this uvcopy job is stored at /home/uvadm/pf/demo/statlogin1
  • please see the sample report & explanations on the previous page

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

4D1. CNVaids: Table Summaries & Statistics

table2 - Table Summaries for Fixed Length Fields

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

demo input file - 1st 3 of 20 records

            1        2         3         4         5         6
 0123456789012345678901234567890123456789012345678901234567890123
  cust# slsm#  date  invoice# product#    qty   price    amount
 130140    21 940802 IN111001  HAM001  00020+ 0000001 00000020+
 130140    21 940802 IN111001  SCR012  00021+ 0001001 00021021+
 139923    35 950802 IN111002  CHR001  00022+ 0002001 00044022+

Operating Instructions

cd testdata
  • change into testdata dir (with subdirs ar & tmp)

 uvcopy table2,fili1=ar/sales1,uop=a30b6c38d6e53f9g3r64,filo1=tmp/sales1.tbl
 ===========================================================================
 uvcopy table2               <-- Try this Now
 =============                 - You only need to enter/remember this much
                               - you will be prompted for filename & options
                               - filenames default as shown above (for this demo)
 uop--> a30b6c38d6e53f9g3r64 <-- ENTER options for demo
        ====================   - can enter just 'a30b6r64' for counts by product#
 ar/sales1 = default fili01 accept/reenter-->    <-- enter null to accept dflt

sample output report

 table2  2003/04/26_20:15:34  Sales Summary by Product#
 tbl#001 pg#001     -argument-            -acum#1-    %        -acum#2-    %
 line#  count    %  product               quantity
     1       2  10  BBQ001                      12   12        1,420.12   31
     2       1   5  CHR001                      22   22          440.22    9
     3       5  25  HAM001                      41   41        1,390.41   30
     4       2  10  HAX129                      10   10          600.10   13
     5       2  10  SAW051                      24-  24-         560.24-  12-
     6       1   5  SCR012                      21   21          210.21    4
     7       4  20  TAB013                      17   17           29.83-
     8       3  15  WHIP75                       1    1        1,030.01   22
            20*100   *TOTAL*                   100 *100        4,501.00 *100

Please see the rerun on the next page to better illustrate the options ---->

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

4D2. CNVaids: Table Summaries & Statistics

table2 - OPTIONS (for Fixed Field files)


 uvcopy table2,fili1=ar/sales1,uop=a10b2c38d6e53f9g3r64,filo1=tmp/sales1.tbl
 ===========================================================================
 - May specify all filenames & options on the command line (as above)

 uvcopy table2     - minimum entry, will be prompted for file & options
 =============     - will be prompted for options
                   - output filename same as input, in tmp subdir with .tbl ext

table2 demo - console display

 uop=a0b0c0d0e0f0g1p0r0 - option defaults
 uop=a0                 - argument displacement (0 rel)
 uop=  b0               - argument length
 uop=              note - may omit options c,d,e,f,p for record counts only
 uop=    c0             - acum#1 displacement (0 rel)
 uop=      d0           - acum#1 length
 uop=        e0         - acum#2 displacement (0 rel)
 uop=          f0       - acum#2 length
 uop=            g1     - edit all acums as qty (commas, no decimal)
 uop=            g2     - edit all acums as $ (commas & decimal point)
 uop=            g3     - edit acum#1 qty, acums#2-#6 $amounts
 uop=            g__    - table formats g1-g12 see uvcopy.doc tbf f1-f12
 uop=        p0         - acum-fields unpacked, "p1" packed, "p2" binary
 uop=          r8192    - input record size (max 8192)
 uop=              note - if file type LST specify r > largest possible
 uop=a30b6c38d6e53f9g3r64  <-- ENTER this for demo with sales1 file
     ====================
 product#;quantity;amount  <-- ENTER this for demo Field Headings
 ========================
 Summary of Qty & Amt by Product#  <-- ENTER this for demo Report Heading
 ================================
               <-- ENTER null at filename prompt to accept demo input
                   Notes re: input File TYPE prompts
 RSF (default) <-- Record Seqntl Fixed (recsize option r must be correct)
 LST           <-- Line Seqntl Terminated (specify r > largest possible)
 Option defaults  = q1a0b0c0d0e0f0g1p0r0
 null accept or re-specify (1 or more) --> a30b6c38d6e53f9g3r64 <--ENTER for demo
                                           ====================
 ar/sales1 = default fili01 accept/reenter -->     <-- ENTER null to accept dflt
 RSF = typ default accept or enter new typ -->     <-- ENTER null to accept dflt
 enter table hdr fieldnames separated by semicolons
 --> argument;acum1;acum2 --> product#;quantity;$amount <-- ENTER fieldnames
                              =========================
 enter Report Heading (optional)
 --> Sales Summary by Product#                    <-- ENTER Report Heading
     =========================
 enter to command to view/print report --> more   <-- to display report
                                           ====
 <-- See the sample report listed on the previous page

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

4D3. CNVaids: Table Summaries & Statistics

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

'table3d' is a more useful than 'table2' for JCL/script & COBOL conversions because it is designed to process entire directories of files (vs 'table2' which processes only fixed length data files & only 1 at a time).

'table3d' allows you to specify a 'key-word', preceding a 'target-word'. The job searches all lines of all files in the directory & the report shows one line for each target-word with the counts & percentages of the total line. Some examples of possible reports might be:

  1. count occurrences in JCL of each program-name (using EXEC as the keyword)
  2. count occurrences in COBOL of each copybook (using 'copy' as the keyword)
  3. count occurrences in JCL of High Level Qualifiers (using DSN as the keyword)

Note that the 'cross-reference' reports XREFjobs.htm provide for the 1st 2 above, so we use #3 as our example. High Level Qualifier refers to the top-node in DSN filenames which becomes the sub-directory in the converted scripts. A few samples of 'DSN's from our test files might be:

       //CUSTMAS  DD DSN=AR.CUSTOMER.MASTER.INDEXED,DISP=SHR
       //SORTIN   DD DSN=GL.ACCOUNT.TRANS,DISP=SHR
       //SORTOUT  DD DSN=&&TEMPSLS,DISP=(NEW,PASS),...

Op. Instrns to create top-node summary table


 uvcopy table3d,fild1=jcl0,arg1=DSN,arg2=.,arg4=.=
 =================================================

sample report - summary of HLQs in all JCL

 Job: table3d Dir: jcl0 Keyword(s): DSN
 Qual1: .  Qual2:   Blanked: =. Userops: q1c0f0l0k0m0p1w1
 table3d  2007/09/08_16:11:24  Counts by Targetword following specified Keyword
 tbl#001 pg#001     -argument-
 line#  count    %  target-word
     1      27  28   AR
     2       1   1   ARTEST
     3       1   1   FTP
     4      52  54   GL
     5       1   1   GLTEST
     6       1   1   MXP
     7       4   4   PY
     8       4   4   PYTEST
     9       2   2   RPTS
            93*100   *TOTAL*

Do you see how you can run table3d to summarize other components of JCL or COBOL by choosing appropriate keywords, targetwords,& options. See more explanations at: TABLEjobs.htm#E1.

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

4E1. CNVaids: Table Summaries & Statistics

record-size summary

'recsizes1' is a uvcopy utility job that will read any text file & create a summary table of all different record-sizes found in the file - based on LineFeed terminators x'0A' (or CR+LF x'0D0A').

The uvcopy job may be found at /home/uvadm/pf/util/recsizes1 & is listed below. Note the operating instructions & sample report as #comments within the listing. You can run the job using the supplied test file /home/uvadm/dat1/customers.

 # recsizes1 - create summary table of record-sizes in a text file
 #           - by Owen Townsend, June 6, 2007
 #
 # uvcopy recsizes1,fili1=dat1/customers,filo1=tmp/custrecsizes
 # ============================================================
 #
 #                   ** sample report **
 #
 # recsizes1  2007/06/07_13:54:02  summary of record-sizes in: dat1/customers
 # tbl#001 pg#001     -argument-
 # line#  count    %  record-size
 #     1       1   3  0079
 #     2      10  31  0086
 #     3       2   6  0098
 #     4      19  59  0102
 #            32*100   *TOTAL*
 #
 rop=r1x2      # option r1=display outfile at EOJ, x2=more (default command)
 was=a8192     # increase area 'a' to allow recsizes up to 8192 bytes
 fili1=?infile,rcs=8192,typ=LST
 filo1=?recsizesummary,rcs=128,typ=LSTt
 @run
         opn     all
 # begin loop to get records & table record-size, until EOF
 # - 'get' instrn stores binary recsize in rgstr 'z' ($rz)
 # - use 'mvn' to convert binary $rz to 4 numerics for table argument
 man20   get     fili1,a0(8192)         get next record
         skp>    man80
         mvn     c0(4),$rz              store recsize in digits
         tblt1   c0(4),'record-size'    build table of record-sizes
         skp     man20                  return to get next record
 # EOF - dump table to outfile, close files & end job
 man80   tbpt1v1 filo1,'summary of record-sizes in: $fili1'
         cls     all
         eoj

This job illustrates the powerful 'tbl' instruction of uvcopy. 'tbl' builds a table in memory based on a specified argument. It creates a new table entry on the 1st occurrence of any given argument & increments a counter on subsequent occurrences. Optionally you can specify up to 6 accumulators. At EOF, you use the 'tbp' instruction to dump the table to a file for printing.

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

4F1. CNVaids: Table Summaries & Statistics

tblexts1 - table summary counts by file extensions

uvcopy job 'tblexts1' will create table summary counts of file extensions in a directory (.CBL .CPY .JCL .PROC .CTL .zip etc).

sample report

 tblexts1  2006/04/16_20:58:01  table summary of extensions/counts in directory
 tbl#001 pg#001     -argument-            -acum#1-    %
 line#  count    %  file extension           count
     1      37  13  .CBL                        37   13
     2       8   2  .CPY                         8    2
     3     212  75  .CTL                       212   75
     4      21   7  .JCL                        21    7
     5       1   0  .zip                         1    0
           279*100   *TOTAL*                   279 *100

Operating Instructions

Assume we have just FTP'd a mixture of mainframe files to subdir 'ftp' on our unix system & we wish to know counts by file extension.


 uvcopy tblexts1,fild1=ftp[,filo1=rpts/ftp.exts]
 ===============================================
 - no need to specify output file, it defaults as shown
 - to subdir tmp with filename=indirname.exts (tmp/ftp.exts in this case)

tblexts1 to calc compile failure %

'tblexts1' is handly to calculate the COBOL compile failure percentage. The 'mfcblA' script compiles all programs in cbls/* & writes output to cblx/... Clean compiles write .cbl, .idy,& .int, But failures write only a .err file


 mfcblA all     <-- compile all programs from cbls/* to cblx/...
 ==========

 uvcopy tblexts1,fild1=cblx  <-- table summarize (dflt output in rpts/cblx.exts)
 ==========================
 tblexts1  2009/08/30_17:55:34  table summary of extensions/counts in directory
 tbl#001 pg#001     -argument-            -acum#1-    %
 line#  count    %  file extension           count
    1       12  31  .cbl                        12   31
    2        2   5  .err                         2    5
    3       12  31  .idy                        12   31
    4       12  31  .int                        12   31
            38*100   *TOTAL*                    38 *100

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

4F2. CNVaids: Table Summaries & Statistics

tblexts2 - summarize .exts in all files in a tree

 # tblexts2 - table summary of filename extensions in a directory tree
 #          - reads filenames from all sub-dirs in a directory tree
 #          - by Owen Townsend, September 2009
 # tblexts1 - (prior job) reads filenames from only 1 directory
 #*tblexts2 - (this job) reads filenames from all directories in a tree
 #
 # uvcopy tblexts2,fild1=directorytree[,filo2=rpts/basedir.exts]
 # =============================================================
 # - no need to specify output file, it defaults as shown
 #
 opr='$jobname - table summary of filename extensions in a directory'
 rop=r2  #run option to prompt at EOJ for report disposition (vi,cat,more,etc)
 fild1=?xxx,typ=DIR,rcs=256    # '?' solicits dirname if not on command line
 fili1=xxxx,typ=LST,rcs=256
 filo2=rpts/dirname.exts,typ=LSTt,rcs=80
 @run
 # create output filename in rpts subdir with same name as input subdir + .exts
        opn     fild1                    ensure directory present
        mvu     f1(80),$fild1,x'00'      move input dir path to w/s
        scnr    f0(80),'/'               scan for rightmost '/'
        mvc     f100(60),fx1             isolate input base subdir
        mvc     f200(5),'rpts/'          setup rpts/ subdir
        cat     f200(60),fx1(60)         concat basedir for rpts/filename
        cata8   f200(60),'.exts'         concat suffix & nullterminate
        mvft1   $filo2,f200(60)          store outfile name
        sys     'if test -d rpts || mkdir rpts'  make rpts/ if not present
        opn     filo2                    open output rpts/file
 #
 # capture all filenames from all subdirs into a tmp/file for readback
 man10  sysv1   'find $fild1 -print -type f >tmp/tblexts2s'
        mvft1   $fili1(60),'tmp/tblexts2s'
        opn     fili1                    open file of filenames
 #
 # begin loop to read filenames & build table by suffix til EOF
 man20  get     fili1,a0(256)            get each record into area 'a'
        skp>    man90                    cc set > if EOF
        mvf     b0(80),'none'            in case no extension found
        scnr    a0(80),'.'               scan for rightmost '.'
        skp!    man30                    '.' found ?
        mvc     b0(80),ax0               yes - store the .xxx for tbl
 man30  tblt1f1 b0(16),'file extension;count',1
        skp     man20                    repeat loop until end of dir
 #
 # EOD - dump table to outfile & query oprtr for display/edit/print ?
 man90  tbpt1s1 filo2,'table summary of extensions/counts in directory'
        cls     all
        eoj

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

Part_5. CNVaids.doc Vancouver Utility Conversion Aids

COBOL aids - Contents


5A1. Cross-Refs for COBOL copybooks & called programs
Note
  • see all cross-refs in 'Part_3' (COBOL & JCL)

5B1. 'statallmvs1' creates table summaries from all converted COBOL programs in
the cbls/... subdir. and also creates table summaries for mainframe MVS JCL
in jcl2/... and converted scripts in jcl3/... (already shown in Part_4).
'statallvse1' is the same,but for VSE JCL.

5B2. statcbl1 - table summarize mainframe COBOL copybooks & called programs
- counts each copybook & called program found in all programs

5C1. cobfil51 - COBOL Files Report
- information extracted from all COBOL programs in directory
- filenames, Input/Output, Org, Access, record size, copybook
- all programmers should have a copy before starting test/debug

5D1. cobmap1 - create record layouts from COBOL copybooks
- another of the favorite tools in Vancouver Utilities
- short demo here, fully documented in COBaids1.htm.

5E1. Animation - essential for debugging MicroFocus COBOL programs
- animation illustrated for Server Express under Unix/Linux
- also illustrated for Net Express under SFU/UWIN/CYGWIN/Windows
- This discussion shows you how our JCL/script conversion
makes it easy for you to turn animation on & off.
- Animation is fully documented in the MicroFocus manuals

5F1. Micro Focus COBOL 'file status' error codes
- 2 byte codes 00-49, excluding 1st byte '9'
- codes extracted from Micro Focus website:

5F2. Micro Focus COBOL 'run time' error codes
- 1st byte character '9' x'39'
- 2nd byte binary x'00'- x'FF' (decimal 000-255)

5F3. Micro Focus COBOL 'run time' error messages
- 1st line only of full text error messages on the web site
 http://supportline.microfocus.com/Documentation/books/sx40sp1/smpubb.htm

5G1. splitcblcpy1 - split mixed directories of COBOL programs & copybooks
to separate subdirs required by COBOL conversion & compile
- see job listed on page '8G1'

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

5A1. CNVaids: COBOL aids, cobfiles, cobmaps, Animation, etc

COBOL Cross-References

xcobcall1
  • COBOL calls -----> list of all 'call's in each program
xcobcall2
  • COBOL calls -----> crossref shows all programs calling each program
xcobcopy1
  • COBOL copybooks--> list of all copybooks in each program
xcobcopy2
  • COBOL copybooks--> crossref shows all programs using each copybook
Note
  • see COBOL & JCL cross-refs in 'Part_3' (COBOL & JCL)
  • see more details & script listings in XREFjobs.htm

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

5B1. CNVaids: COBOL aids, cobfiles, cobmaps, Animation, etc

statallmvs1/statallvse1 - table stats from JCL/scripts


5B1. 'statallmvs1' runs several uvcopy jobs to create table summaries by
analyzing all files in jcl2 (MVS JCL), jcl3 (converted JCL/scripts),
& cbls (converted COBOL). 'statallvse1' is the same,but for VSE JCL.
The JCL reports have already been shown in Part_4.

5B2. statcbl1 - table summarize (gather statistics) for COBOL programs
- count refs to each copybook, called program,& file ORG type

4B1. statmvsjcl1 - table summarize (gather statistics from) mainframe JCL
- count refs to each program, PROC, & top-node used in all JCLs

4B2. statksh1 - table summarize (get stats for) converted Korn shell scripts
- count refs to each program, PROC, & top-node used in Ksh scripts

statallmvs1/statallvse1 - Operating Instructions


 #1. cdl   <-- change to libraries superdir (/home/mvstest/testlibs for demo)
     ===     - or your Libraries

 #2. mkdir stats   <-- make subdir to receive report (if not existing)
     ===========

 #3. statallmvs1 all  <-- script to run uvcopy jobs statcbl1,statmvsjcl2,statksh1
     ===============

 #3a. statallvse1 all <-- same, but for VSE JCL
      ===============

 #4a. vi stats/cbls_calledpgms  <-- see sample reports on page '5B2'
 #4b. vi stats/cbls_copybooks
 #4c. vi stats/cbls_ORGtypes

 #4d. vi stats/jcl2_pgms        <-- see sample reports on page '4B1'
 #4e. vi stats/jcl2_procs
 #4f. vi stats/jcl2_topnodes

 #4g. vi stats/jcl3_pgms        <-- see sample report on page '4B2'
 #4h. vi stats/jcl3_topnodes
 #4i. vi stats/jcl3_exportfiles

The following sample reports were run for the supplied set of test/demo JCL & COBOL programs in /home/uvadm/mvstest/testlibs/...

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

5B2. CNVaids: Table Summaries & Statistics

statcbl11 - COBOL stat report samples


 uvcopy statcbl1 <-- create stats: COBOL copybooks, called-programs,& ORG types
 ===============
 statcbl1  2009/05/01_11:15:02  Summary of copybooks in cbls cbls/cgl100.cbl
 tbl#001 pg#001     -argument-
 line#  count    %  copybook
    1        6  17  custmas.cpy
    2        1   2  paymas.cpy
    3        2   5  saledtl.cpy
    4        1   2  sdline.cpy
    5        1   2  stline.cpy
    6       12  34  unixproc1.cpy
    7       12  34  unixwork1.cpy
            35*100   *TOTAL*
 statcbl1  2009/05/01_11:15:02  Summary of called programs in cbls cbls/cgl100.cbl
 tbl#002 pg#001     -argument-
 line#  count    %  called program
    1        2 100  getparm
             2*100   *TOTAL*
 statcbl1  2009/05/01_11:15:02  Summary of ORGANIZATION types in cbls cbls/cgl100.cbl
 tbl#003 pg#001     -argument-
 line#  count    %  organization
    1        2   8  indexed
    2        9  39  line sequential
    3       12  52  record sequential
            23*100   *TOTAL*
Note
  • the 'statcbl1' reports are also documented in Part_4 (JCL aids)
  • since part of the 'statallmvs1/statallvse1' scripts

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

5C1. CNVaids: COBOL aids, cobfiles, cobmaps, Animation, etc

COBOL Files Report

For each file used in each program, this report shows:

  1. external name from the 'select' stmnt (to match DDname in JCL)
  2. Organization & Access Method
  3. Open mode - Input, Output, Extend, Input-Output
  4. Record-size
  5. Copybook name (if any)
  6. internal name from the 'select' stmnt

See sample report on the next page '5C2' --->

All programmers should have a copy of this report before they begin testing & debugging. It supplies instant answers to questions about file inputs & outputs, access methods, record sizes, copybooks, etc.

cobfil51 vs cobfiles5A

You could create the report with just 'cobfil51', but 'cobfiles5A' is strongly recommended, because it generates Indexed files of COBOL file info that is used by cobfil51 & also by the 'jobflow' reports.


 #1.  uvcopy cobfil51,fild1=cbls[,filo2=xref/cobfiles.rpt]
      ====================================================

 #1a. uvcopy cobfil51   <-- easy alternative (files default as shown above)
      ===============

 #2a. vi xref/cobfiles.rpt       <-- view the COBOL files report
      ====================

 #2b. uvlp12 xref/cobfiles.rpt   <-- list the COBOL files report
      ========================       see sample report on the next page -->

cobfiles5A - recommended alternative


 #1. cobfiles5A cbls    <-- generate xref/cobfil51s & load xref/cobfil51I
     ===============

 #2. uvlp12 xref/cobfiles.rpt   <-- list the COBOL files report
     ========================       see sample report on the next page -->

The jobflow reports (page '6A1') require Indexed files xref/cobfil51I to merge COBOL file info with the JCL/script info.

'cobfiles5A' is a handy script to both generate the cobfiles report & load the Indexed file that will be required by jobflow51 & jobflow5A.

See the 'cobfiles5A' script listed at XREFjobs.htm#3X1

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

5C2. CNVaids: COBOL aids, cobfiles, cobmaps, Animation, etc

sample COBOL files report

 cobfil51  ** COBOL Files Report ** Dir=cbls  2009/08/30_17:47:40
 progname.cbl DDname       OAM   open recsz  copybook.cpy  FDname / Key    lines
 ============================================se=in=up=de=========================
 car100.cbl   custmas      SS    I      256  custmas.cpy   custmas
 car100.cbl   nalist       L     O      120                nalist
                                                                              52
 car101.cbl   custmas1     SS    I      256                custmas1
 car101.cbl   nalist       L     O       90                nalist
                                                                              41
 car120.cbl   custmas      SS    I      256  custmas.cpy   custmas
 car120.cbl   nalist       L     O       90                nalist
                                                                              71
 car130.cbl   custmas      SS    I      256  custmas.cpy   custmas
 car130.cbl   nalist       L     O       90                nalist
                                                                              65
 car140.cbl   custmas      SS    I      256  custmas.cpy   custmas
 car140.cbl   nalist       L     O       90                nalist
                                                                              62
 car150.cbl   custmas      SS    I      256  custmas.cpy   custmas
 car150.cbl   nalist       L     O      120                nalist
                                                                              60
 car200.cbl   saledtl      SS    I       64  saledtl.cpy   saledtl
 car200.cbl   custmas      IR    I      256  custmas.cpy   custmas
 car200.cbl          key->                                    cm-cust
 car200.cbl   salelst      L     O      120  sdline.cpy    salelst
                                                                              65
 car300.cbl     -NoFiles-                                                     34
 cgl100.cbl   acctmas      SS    I       80                acctmas
 cgl100.cbl   actlist      L     O      120                actlist
                                                                              53
 cgl200.cbl   glmsold      SS    I       80                glmsold
 cgl200.cbl   glmsnew      SS    O       80                glmsnew
 cgl200.cbl   gltrans      SS    I       80                gltrans
                                                                              61
 cpy100.cbl   paymas       SS    I      256  paymas.cpy    paymas
 cpy100.cbl   nalist       L     O      120                nalist
                                                                              46
 sqlora1.cbl  cust1in      LS    I       80                cust1
 sqlora1.cbl  exec_sql                       cust1             I01
                                                                             110
 sqlora2.cbl  cust1out     LS    O       80                cust1
 sqlora2.cbl  exec_sql                       sqlca.cpy
 sqlora2.cbl  exec_sql                       cust1         S01
                                                                             112
 testunix1.cblcustmas      IS    I      256                custmas
 testunix1.cbl       key->                                    custnum
                                                                              76
 Total programs = 14, total files = 25

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

5D1. CNVaids: COBOL aids, cobfiles, cobmaps, Animation, etc

'cobmap1' - generate record layouts from COBOL copybooks

'cobmap1' generates record layouts from your COBOL copybooks. It copies the copybook to another file (we call it a 'cobmap'), calculating & appending field start, end,& length onto the right side of each field definition. This information is essential to verify data records, specify SORT FIELD locations, etc.

Try the following demo, using demo copybook cpys/custmas.cpy as input, and generating the cobmap output in maps/custmas. Note that 'cobmap1' is a 'uvcopy job', a file of instructions that requires the 'uvcopy' interpreter. 'uvcopy' finds the instruction file via 'PFPATH' which is defined in the profile. 'cobmap1' is found in /home/uvadm/pf/util/cobmap1.

cobmap1 Operating Instructions


 uvcopy cobmap1,fili1=cpys/custmas.cpy,filo1=maps/custmas
 ========================================================

Output cobmap - maps/custmas

 cobmap1  start-end bytes for cobol record fields    200310101805  pg# 0001
 cpys/custmas.cpy                                  RCSZ=00256  bgn  end  lth typ
 * custmas - cobol copy book for customer.master file mvsjcl
      10 cm-num           pic  9(6).                          0000 0005  006 n  6
      10 cm-delete        pic  x(4).                          0006 0009  004
      10 cm-name          pic  x(25).                         0010 0034  025
      10 cm-adrs          pic  x(25).                         0035 0059  025
      10 cm-city          pic  x(16).                         0060 0075  016
      10 filler001        pic  x.                             0076 0076  001
      10 cm-prov          pic  x(2).                          0077 0078  002
      10 filler002        pic  x.                             0079 0079  001
      10 cm-postal        pic  x(10).                         0080 0089  010
      10 cm-phone         pic  x(12).                         0090 0101  012
      10 cm-contact       pic  x(18).                         0102 0119  018
      10 cm-thisyr-sales  pic  s9(7)v99 comp-3 occurs 12.     0120 0124  005pns 9
      10 cm-lastyr-sales  pic  s9(7)v99 comp-3 occurs 12.     0180 0184  005pns 9
      10 filler003        pic  x(16).                         0240 0255  016
 *RCSZ=00256                                                       0256

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

5D2. CNVaids: COBOL aids, cobfiles, cobmaps, Animation, etc

generating 'cobmap's for ALL copybooks in directory

The Operating Instructions are actually simpler to generate 'cobmap's for all copybooks in the directory. Try the following:


 uvcopyx cobmap1 cpys maps uop=q0i7p0
 ====================================

'uvcopyx' is a script that re-runs the 'uvcopy' interpreter using the 'cobmap1' instructions on each file found in the input directory 'cpys', and writes the corresponding output to the output directory 'maps' with the same name as input.


 vi maps/*        <-- examine all outputs
 =========

See more at COBaids.htm#A1

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

5E1. CNVaids: COBOL aids, cobfiles, cobmaps, Animation, etc

Animating MicroFocus COBOL on Unix/Linux

The following assumes you have converted the JCL as shown on page '1Q1' - '1Q6', and that you have converted & compiled the programs as shown on pages '1R3' thru '1R4' (with mfcblA). We will illustrate using test/demo program /home/mvstest/cbls/car100.cbl'. & test/demo jcl/script /home/mvstest/jcls/jar100.ksh'. Relevant directories are:

cbls
  • cobol source programs
    'car100.cbl' is the program to be animated
cblx
  • compiled programs
    'car100.int' is the compiled program
  • compiling for animation will add 'car100.idy' & 'car100.cbl'
    (the mfcbl1 & mfcblA scripts now always compile for animation)
  • any errors will be collected in 'car100.err'
jcls
  • converted scripts to execute the demo COBOL programs
    'jar100.ksh' will execute the 'car100' program
  • The program is executed about line #40 as follows:
    'cobrun $ANIM $RLX/car100'

ANIMATION operating instructions


 #1.  export ANIM=+A    - set switch (environmental variable) for animation
      ==============      $ANIM is otherwise null in 'cobrun $ANIM $RLX/car100'

 #1a. export COBSW=+A   <-- use COBSW for Windows SFU/Cygwin/Uwin & Net Express
      ===============       (vs ANIM for unix/linux scripts on Server Express)

 #2.  jar100.ksh        - run the job (will now ANIMATE)
      ==========

 #3.  export ANIM=""    - reset the Animation switch (to run normally)
      =============

Note that the converted scripts execute the COBOL programs as follows:


 cobrun $ANIM $RLX/car100    <-- sample COBOL execution in JCL/script
 =======================

advantages of this animation method

Whenever you need to animate a program, all you have to do is set the animation switch on via 'export ANIM=+A', debug the program, & then set the animation switch off via 'export ANIM=-A'.

The mfcbl1 & mfcblA scripts always compile with the animation option '-A' & always copies the source .cbl from source directory (cbls) to the executable directory (cblx) as is required for animation.

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

5F1. CNVaids: COBOL aids, cobfiles, cobmaps, Animation, etc

Micro Focus COBOL - File Status Codes


 http://supportline.microfocus.com/Documentation/books/sx40sp1/smpubb.htm
 ========================================================================

00 Successful completion

02 Indexed files only. One of two possibilities: For a READ statement, the key value for the current key is equal to the value of that same key in the next record in the current key of reference. For a WRITE or REWRITE statement, the record just written created a duplicate key value for at least one alternate record key for which duplicates are allowed.

04 Length of the record being processed does not conform to the fixed file attributes for that file.

05 The referenced optional file is not present at the time the OPEN statement is executed. (see '35' for non-optional file)

07 Sequential files only. For an OPEN or CLOSE statement with the REEL/UNIT phrase the referenced file is a non-reel/unit medium.

10 No next logical record exists. You have reached the end of the file.

14 Relative files only. The number of significant digits in the relative record number is larger than the size of the relative key data item described for that file.

21 Sequentially accessed files only. Indicates a sequence error. The ascending key requirements of successive record key values has been violated, or, the prime record key value has been changed by a COBOL program between successful execution of a READ statement and execution of the next REWRITE statement for that file.

22 Indexed and relative files only. Indicates a duplicate key condition. Attempt has been made to store a record that would create a duplicate key in the indexed or relative file OR a duplicate alternate record key that does not allow duplicates.

23 Indicates no record found. An attempt has been made to access a record, identified by a key, and that record does not exist in the file. Alternatively a START or READ operation has been tried on an optional input file that is not present.

24 Relative and indexed files only. Indicates a boundary violation arising from one of the following conditions: an attempt is made to write beyond the externally defined boundaries of a file; a sequential WRITE operation has been tried on a relative file, but the number of significant digits in the relative record number is larger than the size of the relative key data item described for the file.

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

Micro Focus COBOL - File Status Codes (continued)

30 The I/O statement was unsuccessfully executed as the result of a boundary violation for a sequential file or as the result of an I/O error, such as a data check parity error, or a transmission error.

34 The I/O statement failed because of a boundary violation. This condition indicates that an attempt has been made to write beyond the externally defined boundaries of a sequential file.

35 OPEN operation with the I-O, INPUT, or EXTEND phrases has been tried on a non-OPTIONAL file that is not present.

37 OPEN operation has been tried on a file which does not support the open mode specified in the OPEN statement.

38 OPEN operation has been tried on a file previously closed with a lock.

39 Conflict has been detected between the fixed file attributes and the attributes specified for that file in the program.

41 OPEN operation has been tried on file already opened.

42 CLOSE operation has been tried on file already closed.

43 Files in sequential access mode. The last I/O statement executed for the file, before the execution of a DELETE or REWRITE statement, was not a READ statement.

44 Boundary violation exists. Possible violations are: * An attempt has been made to WRITE or REWRITE a record that is larger than the largest, or smaller than the smallest record allowed by the RECORD IS VARYING clause of the associated file. * An attempt has been made to REWRITE a record to a file, and the record is not the same size as the record being replaced.

46 Sequential READ operation has been tried on a file open in the INPUT or I-O mode but no valid next record has been established.

47 READ or START operation has been tried on a file not opened INPUT or I-O.

48 WRITE operation has been tried on a file not opened in the OUTPUT, I-O, or EXTEND mode, or on a file open I-O in the sequential access mode.

49 DELETE or REWRITE operation has been tried on a file that is not opened I-O.

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

5F2. CNVaids: COBOL Aids

Micro Focus COBOL - Run-time Error Codes

'Run-Time' error codes have 1st byte '9' & 2nd byte is a binary code that must be converted from binary to decimal. You can then look up the meaning on the Micro Focus COBOL website.

These messages are output by the run-time system (RTS), and so can be produced while you are compiling, debugging, or running your program. When you select an error message number, its text and severity is listed, along with an explanation of the error or problem that caused the message, and advice on how to prevent the error.

Goto the Web-Site & Click the error number you require details about:

   	001 	002 	003 	004 	005 	006 	007 	008 	009
 010 	011 	012 	013 	014 	015 	016 	017 	018 	019
 020 	021 	022 	023 	024 	025 	026 	027 	028 	029
 030 	031 	032 	033 	034 	035 	036 	037 	038 	039
 040 	041 	042 	043 	044 	045 	  	047 	048 	
   	  	  	  	  	055 	  	  	  	
   	  	  	  	  	065 	066 	067 	068 	069
 070 	071 	072 	073 	074 	075 	076 	077 	078 	079
 080 	081 	082 	  	  	  	086 	  	  	
   	  	  	  	  	  	  	  	  	099
 100 	101 	102 	103 	104 	105 	106 	107 	108 	109
 110 	111 	112 	  	114 	115 	116 	117 	118 	119
 120 	121 	122 	123 	124 	125 	126 	127 	  	129
   	  	  	  	  	135 	136 	137 	138 	139
   	141 	142 	143 	144 	  	146 	147 	148 	149
   	151 	152 	153 	154 	155 	156 	157 	158 	159
 160 	161 	162 	163 	164 	165 	166 	167 	168 	169
 170 	171 	  	173 	174 	175 	176 	177 	  	179
 180 	181 	182 	183 	184 	185 	186 	187 	188 	189
 190 	191 	192 	193 	194 	195 	196 	197 	198 	199
 200 	201 	  	203 	  	205 	206 	207 	208 	209
 210 	211 	212 	213 	214 	215 	216 	217 	218 	219
 220 	221 	222 	223 	224 	225 	226 	227 	228 	229
   	231 	  	  	  	235 	236 	237 	238 	239
 240 	241 	242 	243 	  	  	  	  	  	249
 250 	251 	252 	253 	254 	  	  	  	  	

Goto the Web-Site & Click the error number you require details about:


 http://supportline.microfocus.com/Documentation/books/sx40sp1/smpubb.htm
 ========================================================================

Mainframe COBOL programs did not expect binary & will display garbage for the 2nd byte. Note that the VU conversions insert copybooks 'unixwork1.cpy' & 'unixproc1.cpy'. unixproc1 contains a subrtn to display the binary codes. BUT, you have to insert 'perform mf-display-filestat-eoj' wherever the COBOL program tests file status.

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

5F3. CNVaids: COBOL Aids

Micro Focus COBOL - Run-time Error Messages

Note
  • Here is 'FIRST LINE ONLY' of full text error messages on the web site
  • goto web site adrs above to get full text & recoveries
 001 Insufficient buffer space (Recoverable)
 002 File not open when access attempted (Recoverable)
 003 Serial mode error (Recoverable)
 004 Illegal file name (Recoverable)
 005 Illegal device specification (Recoverable)
 006 Attempt to write to a file opened for INPUT (Recoverable)
 007 Disk space exhausted (Fatal)
 008 Attempt to input from a file opened for OUTPUT (Recoverable)
 009 Directory not found (Recoverable)
 010 File name not supplied (Recoverable)
 011 Process limit reached (Fatal)
 012 Attempt to open a file which is already open (Recoverable)
 013 File not found (Recoverable)
 014 Too many files open simultaneously (Recoverable)
 015 Too many indexed files open (Recoverable)
 016 Too many device files open (Recoverable)
 017 Record error: probably zero length (Recoverable)
 018 Read part record error: EOF before EOR or file open in wrong mode (Recover-
 019 Rewrite error: open mode or access mode wrong (Recoverable)
 020 Device or resource busy (Recoverable)
 021 File is a directory (Fatal)
 022 Illegal or impossible access mode for OPEN (Recoverable)
 023 Illegal or impossible access mode for CLOSE (Recoverable)
 024 Disk input-output error (Recoverable)
 025 Operating system data error (Fatal)
 026 Block I-O error (Fatal)
 027 Device not available (Recoverable)
 028 No space on device (Fatal)
 029 Attempt to delete open file (Recoverable)
 030 File system is read-only (Recoverable)
 031 Not owner of file (Recoverable)
 032 Too many indexed files, or no such process (Recoverable)
 033 Physical I-O error (Fatal)
 034 Incorrect mode or file descriptor (Recoverable)
 035 Attempt to access a file with incorrect permission (Recoverable)
 036 File already exists (Recoverable)
 037 File access denied (Fatal)
 038 Disk not compatible (Fatal)
 039 File not compatible (Fatal)
 040 National Language initialization not set up correctly (Fatal)
 041 Corrupt index file (Recoverable)
 042 Attempt to write on broken pipe (Recoverable)
 043 File information missing for indexed file (Fatal)
 044 Attempt to OPEN an NLS file in a non-NLS program (Fatal)
 045 Attempt to OPEN an NLS file using incompatible language definition (Fatal)
 047 Indexed structure overflow (Fatal)
 048 Attempt to divide by zero (Fatal)
 055 Routine table overflow (Fatal)
 065 File locked (Recoverable)
 066 Attempt to add duplicate record key to indexed file (Fatal)
 067 Indexed file not open (Recoverable)
 068 Record locked (Recoverable)
 069 Illegal argument to isam module (Fatal)
 070 Too many indexed files open (Recoverable)
 070 Too many indexed files open (Recoverable)
 071 Bad indexed file format (Fatal)
 072 End of indexed file (Fatal)
 073 No record found in indexed file (Fatal)
 074 No current record in indexed file (Fatal)
 075 Indexed data file name too long (Fatal)
 076 Can't create lock file in /isam directory (Fatal)
 077 Internal ISAM module error (Fatal)
 078 Illegal key description in indexed file (Fatal)
 079 COBCONFIG syntax error (Fatal)
 080 Can't convert to/from Unicode codeset (Fatal)
 081 Key already exists in indexed file (Fatal)
 082 CALL convention not supported (Fatal)
 086 Remote file system failure (Fatal)
 099 Illegal operation in SORT/MERGE module (Fatal)
 100 Invalid file operation (Fatal)
 101 Illegal operation on an indexed file (Fatal)
 102 Sequential file with non-integral number of records (Fatal)
 103 Parameter cannot be passed BY VALUE (Fatal)
 104 Null file name used in a file operation (Fatal)
 105 Memory allocation error (Fatal)
 106 Dictionary error (Fatal)
 107 Operation not implemented in this run-time system (Fatal)
 108 Failure to initialize data division (Fatal)
 109 Invalid checksum in run-time system (Recoverable)
 110 Generated code not supported by this RTS (Fatal)
 111 Incompatible Class Library and Run-Time Environment versions (Fatal)
 112 Unable to locate/access the required security key (Recoverable)
 114 Attempt to access item beyond bounds of memory (Fatal)
 115 Unexpected signal (Fatal)
 116 Cannot allocate memory (Fatal)
 117 Bad collating sequence (Fatal)
 118 Symbol not found (Fatal)
 119 Symbol redefined (Fatal)
 120 Symbol string table of zero size (Fatal)
 121 Symbol is not in TEXT section (Fatal)
 122 Coblongjmp() called below level of cobsavenv() (Fatal)
 123 Unknown relocation type (Fatal)
 124 Communication failure during I/O request to the central file handler
 125 All locks/ current transactions canceled due to exceeding time limit
 126 Record size exceeds system limit (Fatal)
 127 coblongjmp() called from a different thread to cobsetjmp() (Fatal)
 129 Attempt to access record zero of relative file (Recoverable)
 135 File not found (Recoverable)
 136 Corrupt or invalid executable file (Fatal)
 137 Illegal device specification - not mass storage
 138 File closed with lock - cannot be opened (Recoverable)
 139 Record length or key data inconsistency (Recoverable)
 141 File already open - cannot be opened (Recoverable)
 142 File not open - cannot be closed (Recoverable)
 143 Rewrite/delete in sequential mode not preceded by successful read (Recover-
 144 Boundary violation (Recoverable)
 146 No current record defined for sequential read (Recoverable)
 147 Wrong open mode or access mode for read/start (Recoverable)
 148 Wrong open mode or access mode for write (Recoverable)
 149 Wrong open mode or access mode for rewrite/delete (Recoverable)
 151 Random read on sequential file (Recoverable)
 152 REWRITE on file not opened I-O (Recoverable)
 153 Subscript out of range (Fatal)
 154 PERFORM nested too deeply (Fatal)
 155 Illegal command line (Fatal)
 156 Too many parentheses in compute statement (Fatal)
 157 Not enough program memory: object file too large to load (Recoverable)
 158 Attempt to REWRITE to a line-sequential file (Recoverable)
 159 Malformed line-sequential file (Recoverable)
 160 Overlay loading error (Recoverable)
 161 Illegal intermediate code (Fatal)
 162 Arithmetic overflow or underflow (Fatal)
 163 Illegal character in numeric field (Fatal)
 164 Run-Time subprogram not found (Fatal)
 165 Version number incompatibility (Fatal)
 166 Recursive COBOL CALL is illegal (Fatal)
 167 Too many USING items (Fatal)
 168 Stack overflow (Fatal)
 169 Illegal configuration information (Fatal)
 170 System program not found (Fatal)
 171 Japanese operations illegal with this RTS (Fatal)
 173 Called program file not found in drive/directory (Fatal)
 174 Imported file not found (Fatal)
 175 Attempt to run intermediate code program which had severe errors (Fatal)
 176 Illegal intersegment reference (Fatal)
 177 Attempt to cancel program failed (Fatal)
 179 Error during chain (program not found) (Fatal)
 180 End-of-file marker error (Fatal)
 181 Invalid parameter error (Fatal)
 182 Console input or console output open in wrong direction (Fatal)
 183 Attempt to open line sequential file for I-O (Fatal)
 184 ACCEPT/DISPLAY I-O error (Fatal)
 185 File malformed (Recoverable)
 186 Attempt to open stdin, stdout or stderr with incorrect mode (Recoverable)
 187 Run-time system not found on $COBDIR path (Fatal)
 188 Filename too large (Fatal)
 189 Intermediate code load error (Fatal)
 190 Too many arguments to CALL (Fatal)
 191 Terminal type not defined (Fatal)
 192 Required terminal capability description missing (Fatal)
 193 Error in variable length count (Fatal)
 194 File size too large (Fatal)
 195 DELETE/REWRITE not preceded by a read (Fatal)
 196 Record number too large in relative or indexed file (Fatal)
 197 Screen handling system initialization error (Fatal)
 198 Load failure (Fatal)
 199 Operating System error code lies outside expected range (Fatal)
 200 Run-time system internal logic error (Fatal)
 201 I-O error in paging system (Fatal)
 203 CALL parameter not supplied (Fatal)
 205 Invalid mainframe pointer value (Fatal)
 206 Reading unwritten data from memory (Fatal)
 207 Machine does not exist (Recoverable)
 208 Error in multi-user system (Fatal)
 209 Network communication error (Recoverable)
 210 File is closed with lock (Fatal)
 211 Program not executable by Run-Time System (Fatal)
 212 Run-Time System version incompatible with object-oriented program (Fatal)
 213 Too many locks (Recoverable)
 214 GO TO has not been ALTERed (Fatal)
 215 Cannot ANIMATE a program running COMMUNICATIONS (Fatal)
 216 Cannot initialize the named communications device (Fatal)
 217 Incompatible host for native code file (Fatal)
 218 Malformed MULTIPLE REEL/UNIT file (Fatal)
 219 Operating system shared file limit exceeded (Recoverable)
 220 Attempt to execute more than one SORT or MERGE simultaneously (Fatal)
 221 Internal sort error (Fatal)
 222 Merge files out of sequence (Fatal)
 223 NLS language expansion error (Fatal)
 224 External Language Initialization failure
 225 Dynamic load error - program component missing (Fatal)
 226 EXTERNAL file definition inconsistent
 227 EXTERNAL data definition inconsistent (Fatal)
 228 Could not allocate memory for EXTERNAL item (Fatal)
 229 SORT/MERGE module does not support EXTERNAL using/giving files (Recover-
 231 GENERATE encountered before corresponding INITIATE in report (Fatal)
 235 Error in animator communications channel (Fatal)
 236 Animated program has terminated unexpectedly (Fatal)
 237 Unable to initialize animated process (Fatal)
 238 STOP RUN encountered during GNT animation (Informational)
 239 Shared run-time system initialization failure (Informational)
 240 Object reference not valid (Fatal)
 241 Cannot instantiate an abstract class (Fatal)
 242 Could not resolve DoesNotUnderstand message (Fatal)
 243 Class could not be loaded (Fatal)
 249 Process killed (signal-number) (Fatal)
 250 Not enough mainframe address space to load or run the program (Fatal)
 251 Attempt to load AMODE(24) program when current setting is AMODE(31) only
 252 Memory corruption detected (Fatal)
 253 Cannot load file - unsupported format (Fatal)
 254 Keyboard interrupt to ANIMATOR during ACCEPT (Fatal)

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

Part_6. CNVaids.doc Vancouver Utility Conversion Aids

JCL/script Test/Debug Aids - Contents


6A1. jobflow51 - JCL data files with COBOL file information inserted
- jobname,progname,LFD,org,access,I/O,rcsz,copybook,datafilename
- illustrates data file usage in multi-step jobs
- invaluable aid to debugging converted JCL
- short demo here, fully documented in XREFjobs.htm#Part5.

6A2. jobflow5A - generate jobflow reports for ALL JCL/scripts (too big)
jobflow51 - generate jobflow report for 1 JCL/script
- regen as needed during test/debug to reflect changes

6B1. joblog1 - run a JCL/script & capture a log file (via tee)
- names the log file by dropping the .ksh & appending .log
- writes the logfile into subdir 'log' (creates it if not present)
joblog1 - writes the log file to $RUNLIBS/log/jobname.log
joblog2 - writes the log file to $RUNDATA/log/jobname.log
joblog3 - writes the log file to $HOME/log/jobname.log

6C1. separate datafiles - supplied profiles make it easy for programmers
to have their own set of testdata

6D1. lastgenr - display latest generation of a file without having to go look.
- you can run from anywhere, without keying long pathnames.

6E1. getEtime - script to display 'job times' for last run of any JOBNAME
- retrieves jobtimes file written by last run of any JCL/script
- demos how to retrieve data fields into environmental variables

6F1. splitjclproc1 - split mixed directories of JCL & PROCs to separate subdirs
required for JCL conversion to Korn shell scritps
- see job listed on page '8F1'

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

6A1. CNVaids: JCL/script Test/Debug Aids

Job-Flow reports

The 'JobFlow' reports are your guide to testing & debugging. They show you the programs & datafiles used in each step of each JCL/script. I recommend you print these out before you start your testing & debugging.

The JObFlow reports extract the essential info about each datafile in each step. The file info from the COBOL program is inserted onto the matching info from the JCL. The following items are shown for each file in each step.

  1. JCL Job Step# & Program name
  2. JCL DDname (matching COBOL external name)
  3. COBOL Organization & Access Methods
  4. COBOL Open mode - Input, Output, Extend, Input-Output
  5. COBOL Record-size
  6. COBOL Copybook name (if any)
  7. JCL DSNname (physical filename)

    JobFlow sample report

 jclfil53 ** JCL Report with COBOL Files info ** 20050305 page#0002
 stp# progname.cbl  DDname  OAM open recsz copybook    data-file-name
 ================================================================================

 #001 sort         sortin1                             ar/sales.items
                   sortout                             $DW/##srtext
                   sysin                               tmp/${JOBID}_${JSTEP}_${PROGID}

 #001 uvsort       fili1=                              $SORTIN1,typ=RSF,rcs=64,
                   filo1=                              $SORTOUT,typ=RSF,rcs=64,\
                   keys=                               (30,6,c,a,0,6,c,a)

 #002 car200.cbl   saledtl  SS  I  00064  saledtl.cpy  $DW/##srtext
                   custmas  IR  I  00256  custmas.cpy  ar/customer.master.indexed
                   salelst  L   O  00120  sdline.cpy   ar/sales.list
                   sysout                              $SYOT/${JOBID}_${JSTEP}_${PROGID}

JCL/script 'jar200.ksh' is a 2 step job with a SORT & a COBOL program with 4 data files. See jar200.ksh listed at MVSJCL.htm#1D2.

The JobFlow reports are listed by 'uvlp12L' which allow for 120 characters wide on 8 1/2 x 11 Landscape. We have removed the JCL/script name from the left & scrunched up to fit this documentation.

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

6A2. XREFjobs.doc - COBOL files & JCL JobFlow reports

Op. Instrns to generate JobFlow Reports

Script 'jobflow5A' generates ALL jobflow reports. You must have run 'cobfiles5A' to load an Indexed file for lookup by jobflow5A to include COBOL file information on the jobflow report. You would not print ALL job flow reports because of high volume & subject to change as you test/debug.

I recommend you use 'jobflow51' to generate & print the jobflow report for any 1 JCL/script. Regen & reprint any time you make significant changes to during testing & debugging.

Note
  • You must run 'cobfiles5A' (page '5C1') before jobflow5A or jobflow51
  • cobfiles5A generates indexed files of COBOL info used by jobflow5A/51

jobflow5A - must run 1st before jobflow51


 #1. jobflow5A cbls jcl3      <-- generate All JobFlow Reports
     ===================

 #2. uvlpd12L jobflow         <-- Do *NOT* print ALL JobFlow reports
     ================             (120 chars wide 8 1/2 x 11 Landscape)

You probably do NOT want to print all jobflow reports, since the reports would be very long & many could go out of date before you use them. It is better to print the individual jobflow report just before you intend to start test/debug for each JCL/script.

You can re-generate the report for any 1 JCL/script using script 'jobflow51' (regenerate when ever you substantially modify the JCL/script).

jobflow51 - generate jobflow report for 1 JCL/script


 #1. jobflow51 jcls/jar200.ksh   <-- generate JobFlow report for 1 job only
     =========================

 #2. uvlp12L jobflow/jar200.io   <-- print jobflow report for 1 JCL only
     =========================

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

6B1. CNVaids: JCL/script Test/Debug Aids

joblog1,2,3 - capture logs via 'tee'

Console logging is highly recommended (especially for production) since it captures everything that happens on the screen, including operator commands & replies to prompts. See console logging in ADMjobs.htm#Part_6.

But until you get console logging activated, you could use the joblog scripts to capture the console log for 1 job at a time.

These scripts are better for the programmers, because they capture the log for just the job being tested, and it is immediately available for inspection.

The console logging system ADMjobs.htm#Part_6 is better for production where you want to capture all commands & outputs for the entire batch shift.

3 versions of joblog script

joblog1
  • writes the log file to $RUNLIBS/joblog/jobname.log
joblog2
  • writes the log file to $RUNDATA/joblog/jobname.log
joblog3
  • writes the log file to $HOME/joblog/jobname.log

example using joblog2


 #1. cdd                 <-- change to $TESTDATA superdir

 #2. joblog2 jar100.ksh  <-- use joblog2 to run script jar100.ksh
     ==================      & capture console log in joblog/jar100.log

 #3. uvlp12 joblog/jar100.log  <-- print the log
     ========================

These scripts capture the JCL/script screen displays into a file using the unix/linux 'tee' command. The log filename is created by dropping the '.ksh' extension from the jobname & then appending '.log'.

You can see 'joblog1' listed at ADMjobs.htm#6S1. You can see all scripts in /home/uvadm/sf/IBM/...

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

6C1. CNVaids: JCL/script Test/Debug Aids

setup 'testdata' in Your homedir ?

If you have multiple programmers, you could setup testdata superdirs in homedirs of various programmers to prevent update conflicts.

Please see the profiles described on page '1A1' to understand this tip.

 /p1
 :-----testdata            <-- RUNDATA=$TESTDATA=/p1/testdata
 :     :-----ar                - top-node subdirs for datafiles
 :     :-----gl                - OR all datafiles in 1 subdir (mstr below)
 :     :-----py
 :     :-----joblog            - joblog2 script stores .log files here
 :     :-----jobtmp            - job temporary files
 :     :-----mstr              - master files
 :     :-----rpts              - reports
 :     :-----sysout            - COBOL DISPLAY upon SYSLST reports
 :     :-----tape              - tape files reassigned to disc by JCL converter
 :     :-----tmp               - misc temp files & sort work files
 :     :-----wrk               - work files (inter-step)

Here is how 'userx' might setup his own testdata superdir, copy all data files, & modify his profile to use the private version of testdata.

  1. Login ---> /home/userx

 #2. mkdir testdata            <-- make private testdata superdir
     ==============

 #3. cp -r $TESTDATA testdata  <-- copy all files from shared testdata
     ========================

 #4. vi .bash_profile          <-- edit profile to modify $TESTDATA
     ================
     export TESTLIBS=$TESTLIBS
     export TESTDATA=$TESTDATA       <-- existing definitions in profile
     export CNVDATA=$CNVDATA
     export TESTLIBS=$TESTLIBS
     export TESTDATA=$HOME/testdata     <-- change ONLY TESTDATA def
     export CNVDATA=$CNVDATA

 #5a. exit              <-- logoff

 #5b. Login             <-- log back on to activate new TESTDATA definition

 #6a. echo $TESTDATA    <-- verify change effective

 #6b. cdd               <-- alias cdd should not take you to $HOME/testdata

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

6D1. CNVaids: JCL/script Test/Debug Aids

lastgenr - display last generation file

'lastgenr' is a handy script to tell you the latest generation of a file, without having to go look. You can run from anywhere, without keying long pathnames.

'lastgenr' changes to $RUNDATA, so you must enter the filename relative to $RUNDATA, which usually would include 1 level of directory. For these mvstest/demos, RUNDATA=/home/mvstest/testdata, and the 'dtree' is as follows: ('dtree' is a script provided with the Vancouver Utilities that you may find convenient for your own documentation).


 dtree /home/mvstest/testdata   <-- create 'dtree' report
 ============================
 /home/mvstest
 :-----testdata
 :     :-----ar
 :     :     :-----customer.master
 :     :-----gl
 :     :     :-----account.master_000001
 :     :     :-----account.master_000002
 :     :     :-----account.master_000003
Note
  • 'dtree' reports only directories (not files)
  • I have inserted the filenames into the dtree report

Sample Op Instrns - display latest gen file


 lastgenr gl/account.master_    <-- sample command for lastgenr
 ===========================

 031018:100923: gfile=gl/account.master_000003    <-- resulting display
 ===========================================

Rules for using lastgenr

  1. Must enter filename relative to $RUNDATA (usually 1 level of subdir)

  2. Must append an '_' underscore (convention for generation files)

    Alternate script 'lastgenf'

'lastgenf' is similar, except it does not change to $RUNDATA. This allows you to display latest generation of any file, not just those in $RUNDATA, but you must enter the full pathname or relative pathname from your location.

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

6E1. CNVaids: JCL/script Test/Debug Aids

getEtime - display 'job times' for last run of any JCL/script

'getEtime' is a script to display 'job times' for last run of any JCL/script that has been converted by the Vancouver Utility methods. It retrieves the data fields from the jobtimes file written by last run of the named JCL/script.

This script demonstrates how to retrieve data fields into environmental variables.

 # getEtime - get Elapsed time from jobtmp file & display
 #          - by Owen Townsend, Feb 26/06
 # Demos how to get data fields from a file into environmental variables
 #
 # JCL/scripts converted by Vancouver Utilities write elapsed time
 # into a file $RUNDATA/jobtmp/$JOBID2 in the following format:
 #
 # 060226:165203:JAR100: Begin=16:52:03 End=16:52:03 Elapsed=00:00:00
 # ==================================================================
 #
 #usage: getEtime JOBNAME
 #       ================
 #
 JTF=$RUNDATA/jobtmp/$1/jobtimes
 #
 if [[ ! -f $JTF ]]; then
    echo "usage: getEtime JOBNAME   <-- arg1 must be JOBID (in caps)"
    echo "       ================"
    echo "example: getEtime JAR100"
    echo "         ==============="
    exit 1; fi
 #
 # open file, read 4 data fields into 4 variables, & close file
 exec 3< $JTF                              # open file descriptor #3
 read -u3 jobstamp jobbgn jobend jobtime   # read fields into variables
 exec 3<&-                                 # close file
 echo "$jobstamp $jobbgn $jobend $jobtime" # display variables
 #
 #Note - above 4 lines could be replaced with just 'cat $JTF'
 # - but this script demos how to capture data file fields into env-vars
 # - to give you flexibility in how you use the data fields
 exit 0

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

Part_7. CNVaids.doc Vancouver Utility Conversion Aids

Data File Aids - Contents


7A1. uvhd - file browse/search utility for mainframe type files that do
  not have LineFeeds & may contain Packed/Binary data
- the all time favorite tool in Vancouver Utilities
- short demo here, fully documented in uvhd.htm.

7B1. uvhdcob - similar to uvhd, but also shows the COBOL copybook fieldnames
  beside the data contents. Excellent for verifying data
  conversions. You can see at a glance any mismatches between
  the actual data fields & the COBOL field definitions.
- short demo here, fully documented in uvhdcob.htm.

7B2. uvhdcob v - command to verify character, numeric,& packed data fields

7B4. uvhdc - script for easier use of uvhdcob, can run from anywhere
- without specifying long pathnames for the data file
- without having to specify or know the copybookname
- short demo here, fully documented in uvhdcob.htm.

7C1. uvcp - data file manipulation utility
- convert file types (text, fixed, variable, indexed, Micro Focus)
- example given to correct files FTP'd from mainframe
  (drop off CR/LF added by FTP to ASCII to match COBOL fixed length)

7D1. uvcpF2L - script using uvcp to convert Fixed length records w/o LineFeeds
- to text files with LineFeeds inserted after last nonblank
- makes it easier to use the 'uvcp' utility

7D2. uvcpL2F - script using uvcp to convert text files to Fixed length records
- use when you need to convert a text file for use in a mainframe
  type application that requires fixed length with no LineFeeds.

7E1. CMPjobs - Data File Comparisons for mainframe type files
- fixed length, variable length,& Indexed files
- originally for Y2K, now enhanced for mainframe conversions

7F1. listrec2 - list fixed length records in 100 byte segments with scale
- any unprintable characters will be translated to periods
- record length must be supplied since no LineFeeds present

7F2. listhex2 - list fixed length records in 100 byte segments with scale
- same as listrec2, but list records in vertical hexadecimal

7G1. gentest1 - Generate test data files
- based on COBOL copybooks

7H1. vtocr1 - create VTOC report for files converted from mainframe
- provides record counts, indexed keys, etc
  (information not displayed by the usual unix/linux tools)
- see sample report & operating instructions in MVSDATA.htm

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

Part 7. CNVaids.doc Vancouver Utility Conversion Aids

Data File Aids - Contents (continued)


7I1. uvsort - provides most SYNCSORT features at a much lower price
- up to 60 input files & 20 output files
- selects, deletes, reformats
- options to drop duplicate keys, select duplicate keys, etc
- unique option to start a new output file on key break

7J1. uvlist - to list text files (scripts, programs, etc)
- as a filter to remove control codes, multi-blanks, etc

7U1. uxcp - convert mainframe EBCDIC variable length (RDW format)
to ASCII variable length Indexed file for Micro Focus COBOL

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

7A1. CNVaids: Data File Aids

uvhd - display DATA files in Vertical Hexadecimal

Use 'uvhd' to investigate mainframe type files that do not have linefeeds & cannot be displayed or printed by the usual UNIX utilities (vi, lp, etc). 'uvhd' will display records consecutively if you keep pressing enter. You can jump to & display any record in the file by entering the record#. You can search for desired records via specified search patterns anywhere in the record of restricted to specified columns.


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

 #2. uvhd dat1/custmas1 r256  <-- run uvhd specifying filename & recsize
     =======================    - displays 1st record & waits for command
 r#       1           1         2         3         4         5         6
 b#       0 0123456789012345678901234567890123456789012345678901234567890123
          0 130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD          NANA
            3333332222454545444244545524542222233332445442544422222222224444
            130140000056527255E0DF4F230C44E0000181502F75E02F140000000000E1E1
         64 IMO          BC V9S1H1    604-754-5531                  ........
            4442222222222442535343222233323332333322222222222222222200000000
            9DF00000000002306931810000604D754D55310000000000000000000000C000
        128 .........W0....`........)X|..f3.....\.......................f...
            0000000005300016000000002570063100095000000000000000000000016000
            0C0000C0270C0540C0000C0098C0263C0444C0000C0000C0000C0000C0056C00
        192 ...............................f.....<........f.C
            0000008900000000880000000018000680001300000000694222222222222222
            00C0026C0000C0023C0000C0083C0056D0012C0000C0016D3000000000000000
 ar/customer.master fsz=8192 rsz=256 recs=32 current=1
 null=next,r#=rec,b#=byte,+/-recs,s=search,u=update,p=print,w=write
 ,q=quit,?=help -->

 #1. null entry   <-- display next consecutive record
     ==========

 #2. 9999         <-- display record #9999 (or goto EOF)

 #3. -1           <-- backup 1 to see last record
 See uvhd.htm in volume 2 of UVdoc for description of other commands
 - search, update, print, write (select records for test files).

The 'i' (immediate print) command is valuable to document data problems and assign to programmers for correction.


 i9f3          <-- iprint next 9 records, 3 records per form(page)
 ====

See much more at uvhd.htm

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

7B1. CNVaids: Data File Aids

uvhdcob - display data file fields with COBOL fieldnames

uvhdcob displays data file field contents beside the copybook fieldnames. The command repertoire is similar to the previously discussed 'uvhd' (browse,search,update,print,write,drop,check-sequence).

See complete documentation at uvhdcob.htm. Here is a brief demo including the 'v' verify command, which is very useful for conversions.

Before you can run uvhdcob for a particular file, you must have run 'cobmap1' to convert the copybook for that file to the corresponding 'cobmap'. Page '5D2' shows you how to do this quickly & easily for all copybooks.

uvhdcob - sample display


 #1. cd /home/uvadm   <-- change to uvadm for test files
     ==============

 #2. uvhdcob dat1/custmas1 cobol/maps/custmas1  <-- try this now
     =========================================
 file=testdata/ar/customer.master lastmod=20030926:0856
 record#=1 totalrecs=32 recsize=256 filesize=8192 fileptr=0
 cobmap=maps/custmas today=20031018:1117
 rec#       1 fieldname occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 ar-custno                    0   5 n  130140
 002 ar-delete                    6   9
 003 ar-name                     10  34    EVERGREEN MOTORS LTD.
 004 ar-adrs                     35  59    1815 BOWEN ROAD
 005 ar-city                     60  75    NANAIMO
 006 filler001                   76  76
 007 ar-prov                     77  78    BC
 008 filler002                   79  79
 009 ar-postal                   80  89    V9S1H1
 010 ar-phone                    90 101    250-754-5531
 011 ar-contact                 102 119    LARRY WRENCH
 012 ar-thisyr-sales       012  120 124pns 001234567C
 013 ar-lastyr-sales       012  180 184pns 001234567D
 014 filler003                  240 255    C 19950531
 rec#=1 of 32,null=next,r#=rec,s=search,u=update,p=print,i=iprint,w=write
 ,t=tally,c=chkseq,e=exit to uvhd,q=quit,?=help --> q

'v' verify data command

The 'v' command will verify character, numeric,& packed data fields. Verify searches the file for unprintable characters in pic x fields & invalid digits or signs in unpacked or packed numeric fields.

We have provided a doctored version of dat1/custmas1 to test/demo uvhdcob. dat1/cm1_testuvhdcob has been updated (using uvhdcob) to create errors in record#s 10 & 20.

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

7B2. uvhdcob 'verify' test/demo

test/demo verify command


 uvhdcob dat1/cm1_testuvhdcob cobol/maps/custmas1  <-- run on test/demo file
 ================================================
  - uvhdcob displays 1st record (not shown here) & prompts for command
 --> v  <-- search & Verify character,numeric,& packed fields

response to search/verify command

 rec#      10 fieldname occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 cm-num                       0   5 n  15468X      313534363858      <-BadN
 002 cm-delete                    6   9
 003 cm-name                     10  34    TAURUS RESOURCES
 004 cm-adrs                     35  59    1110 - 625 HOWE STREET
 005 cm-city                     60  75    VANCOUVER
 006 filler001                   76  76
 007 cm-prov                     77  78    B.          42EE              <-BadC
 008 filler002                   79  79
 009 cm-postal                   80  89    V6C2T6
 010 cm-phone                    90 101    604 685 8565
 011 cm-contact                 102 119    MEL RAHAL
 012 cm-thisyr-sales       012  120 124pns EE0123456C            <-- Bad Packed
 013 cm-lastyr-sales       012  180 184pns 000000000C
 014 filler003                  240 255    C 19980331
      v --> 10 recs verified, 4 ERRs found in rec# 10, 1st at byte# 0
      2 packed & 1 numeric bad signs/digits, 1 unprintables in char fields

--> vv <-- continue Verify

 rec#      20 fieldname occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 cm-num                       0   5 n  2343XX      323334335858      <-BadN
 002 cm-delete                    6   9
 003 cm-name                     10  34    TERRITORIAL REWIND
 004 cm-adrs                     35  59    BOX 1648
 005 cm-city                     60  75    WHITEHORSE
 006 filler001                   76  76
 007 cm-prov                     77  78    YK
 008 filler002                   79  79
 009 cm-postal                   80  89    Y1A...      593141EEEEEE      <-BadC
 010 cm-phone                    90 101    403-512-3948
 011 cm-contact                 102 119
 012 cm-thisyr-sales       012  120 124pns 000000000C
 013 cm-lastyr-sales       012  180 184pns 1E2E3E4E5E            <-- Bad Packed
 014 filler003                  240 255      20021130
      vv --> 10 recs verified, 10 ERRs found in rec# 20, 1st at byte# 0
      5 packed & 2 numeric bad signs/digits, 3 unprintables in char fields

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

7B3. uvhdcob 'verify' test/demo

Notes re uvhdcob Verify

  1. We created intentional errors in records #10 & #20 of dat1/cm1_testuvhdcob.

  2. Note flags on right hand side '<-BadN', '<-BadC', '<-- Bad Packed'

  3. cm-num '15468X' flagged because 'X' is non-numeric. Hex representation x'313534363858' is shown in case of unprintables.

  4. cm-prov 'B.' is shown in hex as x'42EE' (the '.' is actually x'EE').

  5. cm-thisyr-sales is shown as x'EE0123456C' (1st 2 digits x'EE' invalid).

  6. packed fields are always shown in hex (valid of invalid).

  7. uvhdcob shows only the 1st field of occurs. You could verify all occurs fields using 'genverify1' which generates a uvcoy job to verify all numeric & packed fields using the 'vnf' instruction.

creating BAD data

In case you are interested, here are the 'update' commands we used to create the BAD data for the 'verify' command test/demo. We will omit the uvhdcob displays.


 #1. uvhdcob dat1/cm1_testuvhdcob cobol/maps/custmas1 u <-- option 'u' for update
     ==================================================

 #2. --> 10              <-- goto record# 10

 #3a. --> u 5(1),'X'     <-- create non-numeric data in numeric field (cust#)
 #3b. --> u 78(1),x'EE'  <-- create unprintable data in character field (prov)
 #3b. --> u 120(1),x'EE' <-- create invalid digits in packed field (thisyr sales)

 #3. --> 20                      <-- goto record# 20

 #4a. --> u 5(2),'XX'            <-- create non-num data in numeric field (cust#)
 #4b. --> u 83(3),x'EEEEEE'      <-- create unprintables in char field (province)
 #4b. --> u 180(5),x'1E2E3E4E5E' <-- create BAD data in packed field (lastyr sls)

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

7B4. CNVaids: Data File Aids

uvhdc - script for easier use of uvhdcob

uvhdcob requires you to specify both the path to the data-file & the path to the 'cobmap'. This could be awkward since data & copybookmaps are usually in different file systems. The 'uvhdc' script is provided to solve this problem. See the setup required in uvhdcob.htm. Once we have the control file setup, you only need to specify your data file name (no path names & you can run from anywhere).


 uvhdc ar/customer.master   <-- script 'uvhdc' to run 'uvhdcob' from anywhere
 ========================     - without having to specify the copybook name

To appreciate the advantage, here is the equivalent 'uvhdcob', assuming you are in $RUNLIBS & running the test/demo system provided, where RUNLIBS=/home/mvstest/testlibs & RUNDATA=/home/mvstest/testdata.


 uvhdcob $RUNDATA/ar/customer.master maps/custmas
 ================================================

This will get even worse, when you setup your own conversion Testing & Production systems. For example assuming your RUNLIBS & RUNDATA in your profile are:


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

Then the uvhdcob command could be specified as follows:


 uvhdcob /p2/proddata/ar/customer.master /p2/prodlibs/maps/custmas
 =================================================================

Of course you would shorten it by using your RUNLIBS & RUNDATA symbols:


 uvhdcob $RUNDATA/ar/customer.master $RUNLIBS/maps/custmas
 =======================================================

But using the 'uvhdc' script is the shortest:


 uvhdc ar/customer.master
 ========================

See the complete setup required for 'uvhdc' in uvhdcob.htm#H1.

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

7C1. CNVaids: Data File Aids

using uvcp to convert 'text' to 'fixed'

You may need to convert text files to fixed if the data is input for a COBOL program expecting fixed length records (with no LineFeed terminators). Text records are terminated by LineFeeds LF=x'0A' or CarriageReturn+LineFeed CR+LF=x'0D0A'. Text records may vary in length since trailing blanks are usually omitted & the LineFeed inserted after the last nonblank. Text files on unix systems need only the LineFeed, but files from windows or mainframes may have both CR & LF. For our example we will show both.

sample text file dat1/products

 BBQ010   BAR-B-Q
 CHR015   LAWN CHAIR
 HAM010   CLAW HAMMER
 HAM020   BALL PEEN HAMMER

 uvhd dat1/products h2t   <-- uvhd with 'h2' option to see the LineFeeds
 ======================       (option 't' tells uvhd to end records on x'0A')
                  10        20        30        40        50        60
 r#    1 0123456789012345678901234567890123456789012345678901234567890123
       0 BBQ010   BAR-B-Q..  <-- LineFeed shows as '.' on character line
         445333222445242500  <-- note: zones & digits CR+LF=x'0D'+x'0A'
         221010000212D2D1DA
              - - - showing only 1st & 4th records to save space - - -
                  10        20        30        40        50        60
 r#    4 0123456789012345678901234567890123456789012345678901234567890123
      61 HAM020   BALL PEEN HAMMER..
         444333222444425444244444500
         81D02000021CC0055E081DD52DA

 uvcp "fili1=dat1/products,typ=LST,rcs=256,filo1=tmp/products,typ=RSF,rcs=80"
 ============================================================================
 - convert text file to fixed length 80 byte records with no CR/LF terminators

 uvhd tmp/products h2r80   <-- uvhd with option h2 for hex display
 =======================     - option r80 for fixed record-size
                  10        20        30        40        50        60
 r#    1 0123456789012345678901234567890123456789012345678901234567890123
       0 BBQ010   BAR-B-Q
         4453332224452425222222222222222222222222222222222222222222222222
         221010000212D2D1000000000000000000000000000000000000000000000000
      64
         2222222222222222
         0000000000000000
              - - - showing only 1st & 4th records to save space - - -
 r#    4 0123456789012345678901234567890123456789012345678901234567890123
     240 HAM020   BALL PEEN HAMMER
         4443332224444254442444445222222222222222222222222222222222222222
         81D02000021CC0055E081DD52000000000000000000000000000000000000000
      64
         2222222222222222
         0000000000000000

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

7C2. CNVaids: Data File Aids

Notes re uvcp on page above


 uvcp "fili1=dat1/products,typ=LST,rcs=256,filo1=tmp/products,typ=RSF,rcs=80"
 ============================================================================
 - convert text file to fixed length 80 byte records with no CR/LF terminators
  1. Text record 'typ=LST' (Line Sequential Terminated)

  2. Fixed record 'typ=RSF' (Record Sequential Fixed)

  3. For text files (typ=LST), allow extra length (rcs=256 in this example) to ensure the terminating LineFeed will be found within the area assigned (to avoid record splitting).

  4. Or could use 'typ=RST' (Record Sequential Terminated) puts a LineFeed into the last byte of a fixed record size. A good idea if the last byte is not part of a data field, allows you to use editor on fixed files.

    common problem when files FTP'd from mainframe

If you FTP files from the mainframe in text mode, FTP translates to ASCII and appends CR+LF on the end of each record, as shown below using our 'customers' demo file. These records were fixed length 102 bytes on the mainframe with no LineFeeds. Here are the 1st 2 records shown by uvhd using option 'h2' for vertical hexadecimal display & option 't' to tell uvhd to look for LineFeeds x'0A' to terminate records.


 uvhd dat1/customers h2t   <-- uvhd display in hex using LF terminators
 =======================
                      10        20        30        40        50        60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD          NANA
             3333332222454545444244545524542222233332445442544422222222224444
             130140000056527255E0DF4F230C44E0000181502F75E02F140000000000E1E1
          64 IMO          BC V9S1H1    604-754-5531..
             4442222222222442535343222233323332333300
             9DF00000000002306931810000604D754D5531DA
                      10        20        30        40        50        60
 r#        2 0123456789012345678901234567890123456789012345678901234567890123
         104 132588    GEECOE GENERATOR SERVICE UNIT 170 - 2851 SIMPSON  RICH
             3333332222444444244445454525455444254452333222333325445544225444
             13258800007553F5075E5214F20352693505E9401700D02851039D03FE002938
          64 MOND         BC V6X2R2    604-278-4488..
             4444222222222442535353222233323332333300
             DFE40000000002306682220000604D278D4488DA

The problem is that the COBOL program on unix expects fixed 102 byte records so we need to drop off the extra 2 bytes (CR+LF) appended by FTP.

Please see the solution (via uvcp) on the next page --->

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

7C3. CNVaids: Data File Aids

uvcp to drop CR/LF (convert text to fixed)


 uvcp "fili1=dat1/customers,typ=LST,rcs=256,filo1=tmp/customers,typ=RSF,rcs=102"
 ===============================================================================
 - drop off CR/LF (created by FTP) & force output recsize = 102

 uvhd tmp/customers h2r102   <-- uvhd with options h2=hex, r102=record-size
 ==========================
                      10        20        30        40        50        60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD          NANA
             3333332222454545444244545524542222233332445442544422222222224444
             130140000056527255E0DF4F230C44E0000181502F75E02F140000000000E1E1
          64 IMO          BC V9S1H1    604-754-5531
             44422222222224425353432222333233323333
             9DF00000000002306931810000604D754D5531
                      10        20        30        40        50        60
 r#        2 0123456789012345678901234567890123456789012345678901234567890123
         102 132588    GEECOE GENERATOR SERVICE UNIT 170 - 2851 SIMPSON  RICH
             3333332222444444244445454525455444254452333222333325445544225444
             13258800007553F5075E5214F20352693505E9401700D02851039D03FE002938
          64 MOND         BC V6X2R2    604-278-4488
             44442222222224425353532222333233323333
             DFE40000000002306682220000604D278D4488

Above we used uvcp to restore the record size to agree with the COBOL program.

Alternative - modify the COBOL program

We might consider changing the COBOL program to accept a text type file vs fixed length. Change ORGANIZATION in the SELECT clause as shown below:

     ORGANIZATION RECORD SEQUENTIAL
     ORGANIZATION LINE SEQUENTIAL
  1. You can only do this if there are NO packed or binary fields in the records.

  2. You would have to change the ORGANIZATION in all programs that read the file (see the cross reference reports in XREFjobs.htm)

  3. An advantage is that you could then view the file using the 'vi' editor

  4. A disadvantage is that processing would be somewhat slower, but this would be insignificant unless you had huge files.

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

7C4. CNVaids: Data File Aids

using 'uvcp' to convert 'fixed' to 'text'

Fixed length records without LineFeeds cannot be viewed or printed with the usual unix/linux utilities (vi,more,lp,etc). To these utilties, the file appears as 1 long line. Try the following:


 #0. cd /home/uvadm     <-- easy access to dat/... test/demo files
     ==============

 #1. vi dat1/sales1     <-- try vi on a file w/o LineFeeds
     ==============
     - the screen will be filled with data, but records are not distinct.
     - and 'vi' will display --> noEOL, 1 Line, 1280 Chars

 #2. uvhd dat1/sales1   <-- try uvhd
     ================
                      10        20        30        40        50        60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 130140    21 940802 IN111001  HAM001  00002{ 0000001 00000002{
             3333332222332333333244333333224443332233333723333333233333333722
             130140000021094080209E1110010081D0010000002B00000001000000002B00
          64 130140    21 940802 IN111001  SCR012  00002A 0001001 00002102A
             3333332222332333333244333333225453332233333423333333233333333422
             130140000021094080209E111001003320120000002100001001000002102100
         128 139923    35 950802 IN111002  CHR001  00002B 0002001 00004402B
             3333332222332333333244333333224453332233333423333333233333333422
             139923000035095080209E111002003820010000002200002001000004402200

 #3. uvcp "fili1=dat1/sales1,typ=RSF,rcs=64,filo1=tmp/sales1,typ=LSTt"
     =================================================================
     - use uvcp to convert file type from RSF (Record Seqntl Fixed)
     - to LSTt (Line Seqntl Terminated)
     - option 't' inserts the LF after the last nonblank

 #4. vi tmp/sales1        <-- use vi to view the converted file (typ=LST)
     =============
     130140    21 940802 IN111001  HAM001  00002{ 0000001 00000002{
     130140    21 940802 IN111001  SCR012  00002A 0001001 00002102A
     139923    35 950802 IN111002  CHR001  00002B 0002001 00004402B
Note
  • we are showing only the 1st 3 of 20 records
  • vi does not show the LineFeeds (use uvhd if you wish to see them)

See complete doc for uvcp at uvcp.htm

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

7D1. CNVaids: Data File Aids

scripts to make uvcp easier to use

uvcpF2L
  • script using uvcp to convert Fixed length records w/o LineFeeds
  • to text files with LineFeeds inserted after last nonblank
  • use when you want to view/print mainframe type files
  • that are used in applications migrated to unix/linux
uvcpL2F
  • script using uvcp to convert text type files to Fixed length records
  • use when you need to convert a text file for use in a mainframe
    type application that requires fixed length with no LineFeeds.

demo using uvcpF2L

We will repeat the previous page demo (#3), but using the 'uvcpF2L' script (instead of using the 'uvcp' utility directly).


 #1. uvcpF2L dat1/sales1 64
     ======================
     - convert file type from RSF (fixed no LFs) to LSTt (text with LFs)
     - record-size must be specified as arg2

 #2. vi tmp/sales1    <-- view the output (automatically stored in 'tmp' subdir)
     =============
     130140    21 940802 IN111001  HAM001  00002{ 0000001 00000002{
     130140    21 940802 IN111001  SCR012  00002A 0001001 00002102A
     139923    35 950802 IN111002  CHR001  00002B 0002001 00004402B
     139923    35 950802 IN111002  TAB013  00002C 0003001 00006902C

demo#2 - using custmas1 with packed fields

The 'custmas1' file records are 256 bytes with name & address in the 1st 120 bytes & 24 * 5 byte packed decimal fields in bytes 120-239. You could use uvcpF2L optional arg3 to clear the packed fields so you could view/print the name & address portion. See the uvhd view of custmas1 on page '2D1'.


 #1. uvcpF2L dat1/custmas1 256 'clr=120(136):0x20'
     =============================================

 #2. vi tmp/custmas1       <-- view output (always left in tmp subdir)
     ===============
 130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD          NANAIMO          BC V9S1H1    250-754-5531 LARRY WRENCH
 132588    GEECOE GENERATOR SERVICESUNIT 170 - 2851 SIMPSON  RICHMOND         BC V6X2R2    604-278-4488 HARRY LIGHT
 139923    JOHNSTONE BOILER & TANKS 1250 EAST PENDER STREET  VANCOUVER        BC V5L1W1    604-320-1845GEORGE BROWN

Only the 1st 3 records (of 32) are shown.

See scripts uvcpF2L & uvcpL2F listed at uvcp.htm#T6 & uvcp.htm#T7

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

7E1. CNVaids: Data File Aids

CMPjobs.doc - Data File Compare

These jobs will compare data files that may have packed/binary fields.

We will demonstrate uvcmp1 on the following 2 pages using the test files shown below:

test file#1 /home/uvadm/dat1/warmas1

 cust# prod#  description   purch-date  expire-date   price
           1         2         3         4         5         6         7
 01234567890123456789012345678901234567890123456789012345678901234567890
 12345 12345 sony television   950101 1-year 960101 000002911
 22222 00000 dish washer       960101 2-year 980101 000004922
 33333 11111 refrigerator      961231 3-year 991231 000006733
 33333 22222 air conditioner   970101 3-year 000101 000006744
 44444 00000 freezer           970101 4-year 010101 000009955
 55555 11111 clothes dryer     991231 5-year 041231 000055566
 66666 00000 micro wave        001231 6-year 061231 000066677
 88888 00000 HP computer       030101 3-year 070101 000129999

dat1/warmas1a - Alternate test file#2 with differences

 12345 12345 sony television   950101 1-year 960101 000002911
 22222 00000 dish CRASHER      960101 2-year 980101 000004922
 33333 11111 refrigerator      961215 4-year 001215 000005500
 33333 22222 air conditioner   970101 3-year 000101 000006744
 44444 00000 freezer           970101 4-year 010101 000009955
 55555 11111 clothes SHRINKER  990615 6-year 051201 000066699
 66666 00000 micro wave        001215 6-year 999999 000066677
 88888 00000 HP computer       030101 3-year 070101 000129999

Note that we have created some intentional mismatches in the 2nd file.

The operating instructions are shown on the following page --->

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

7E2. CNVaids: Data File Aids

uvcmp1 demo#1 - Operating Instructions


 uvcopy uvcmp1,fili1=dat1/warmas1,fili2=dat1/warmas1a,uop=r64
 ============================================================
 uop=q1a0b0c0d0e0f0g0h0p30r256s8t500000u3x2y0  - option defaults
       a#              - dsplcmnt to exclude field #1
       b#              - length   to exclude field #1
         c#            - dsplcmnt to exclude field #2
         d#            - length   to exclude field #2
           e#          - dsplcmnt to exclude field #3
           f#          - length   to exclude field #3
             g#        - dsplcmnt to exclude field #4
             h#        - length   to exclude field #4
               n0      - print column scale only at begin report
               n1      - print column scale for each record mismatch pair
                 p30   - line# to test overflow at begin record only
                  r256 - record size
                s8     - StopPrint count, after s# mismatched records
              t500000  - StopRead count, after s# mismats, else read to EOF
            u1         - stop print at last segment with mismatch
            u2         - inhibit printing all matching segments after 1st
          x#           - hex or char print (x1 char, x2 hex, x0 auto)
        y0             - do NOT translate, file already ASCII, default(y0)
        y1             - translate char lines to ASCII (for EBCDIC files)
 User OPtion (uop) defaults  = q1p30r256s8t500000u3x2y0r64
 -->null to accept or enter/override --> r64 <-- enter record-size
 ==================== EOF or StopPrint/StopRead count reached  ==============
 File1Total=8, File2Total=8, StopPrint=8, StopRead=500000
 File1Reads=8, TotalMisMatches=4, MisMatchesPrinted=4
 090218:093752:uvcmp1: EOF fili01 rds=8 size=512: dat1/warmas1
 090218:093752:uvcmp1: EOF fili02 rds=8 size=512: dat1/warmas1a
 090218:093752:uvcmp1: EOF fild03 size=4096: rptcmp
 090218:093752:uvcmp1: EOF filo03 wrts=53 size=3058: rptcmp/warmas1 hits=4
 EOJ, Output File written to: rptcmp/warmas1
 enter command: vi,cat,more,lp,uvlp12,null -->  vi  <-- enter vi to view rpt

See differences report listed on the next page --->

Note the response to the options prompt was 'r64', specifying the record sizes as 64 bytes. We specified the options twice here to emphasize their importance, once on the command line & again at the prompt (which would be redundant).

You could enter just 'uvcopy uvcmp1' & enter filenames & options at the prompts, but it is better to enter at least the filenames on the command line, so you can use the shell history if you need to repeat the command.


 uvcopy uvcmp1  <-- will prompt for filenames & options if not on command
 =============

For uvcmp1 (intended for 1 pair of files at a time) you could wait for the prompt to specify options, but for uvcmp2/uvcmp3 it is usually advantageous to specify options on the command line & include the 'q0' option to disable the prompts for multiple files in the directory.

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

7E3. CNVaids: Data File Aids

uvcmp1 demo#1 - sample report

 uvcmpFA1 uvcmp1 - compare 2 files, print mismatched records, '*' flag diffs
 2007/12/12_12:01:35 uop=q1p30r256s8t500000v2x0y0z1q1r64
 recsize  reccount   file-size  typ Report=rpts/warmas1.cmp
 1:   64         8           0  RSF  File1=dat1/warmas1
 2:   64         8           0  RSF  File2=dat1/warmas1a
                       1         2         3         4         5         6
 f#rec#byte# 0123456789012345678901234567890123456789012345678901234567890123
 ============================================================================
 1    2    0 22222 00000 dish washer       960101 2-year 980101 000004922   .
             3333323333326676276766722222223333332327667233333323333333332220
             22222000000049380713852000000096010102D951209801010000004922000A
                              *******
 2    2      22222 00000 dish CRASHER      960101 2-year 980101 000004922   .
             3333323333326676245454452222223333332327667233333323333333332220
             22222000000049380321385200000096010102D951209801010000004922000A
                              *******
 1    3    0 33333 11111 refrigerator      961231 3-year 991231 000006733   .
             3333323333327667666767672222223333332327667233333323333333332220
             3333301111102562975214F200000096123103D951209912310000006733000A
                                               ** *      **  **      ****
 2    3      33333 11111 refrigerator      961215 4-year 001215 000005500   .
             3333323333327667666767672222223333332327667233333323333333332220
             3333301111102562975214F200000096121504D951200012150000005500000A
                                               ** *      **  **      ****
 1    6    0 55555 11111 clothes dryer     991231 5-year 041231 000055566   .
             3333323333326667667267767222223333332327667233333323333333332220
             5555501111103CF48530429520000099123105D951200412310000055566000A
                                 ********    **** *       *  *      *****
 2    6      55555 11111 clothes SHRINKER  990615 6-year 051201 000066699   .
             3333323333326667667254544445223333332327667233333323333333332220
             5555501111103CF485303829EB520099061506D951200512010000066699000A
                                 ********    **** *       *  *      *****
 1    7    0 66666 00000 micro wave        001231 6-year 061231 000066677   .
             3333323333326667627676222222223333332327667233333323333333332220
             666660000000D932F071650000000000123106D951200612310000066677000A
                                               **        ******
 2    7      66666 00000 micro wave        001215 6-year 999999 000066677   .
             3333323333326667627676222222223333332327667233333323333333332220
             666660000000D932F071650000000000121506D951209999990000066677000A
                                               **        ******
 ======================= EOF or stop count reached ==========================
 Total=000008,read=000008,mismatches=000004,stop=000008,term=500000
Note
  • '*' mark differences between record pairs

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

7F1. CNVaids: Data File Aids

listrec2 - list fixed length records

'listrec2' will list fixed length records in 100 byte segments with scale. Replace any unprintable characters with periods ('.'s).

We will demo listrec2 & show the output report, using test/demo file: /home/uvadm/dat1/citytax1a - 128 byte records with packed field in 88-96.


 cd /home/uvadm        <-- change to the uvadm home directory
 ==============

 uvcopy listrec2,fili1=dat1/citytax1a,uop=r128m5  <-- execute listrec2
 ===============================================      input=dat1/citytax1a
 - option 'r128' = Recsize, option 'm5' = Max recs to list
 - we also entered options below at prompt, redundant since on command line

console log

 uop=q1r100m10s1 - option defaults
       r100      - record size default 100 bytes (max 5000)
       r512      - example for rcsz 512 (add 1 if indexed)
           m10   - list 10 records Max & end job
           m99   - probably would not want to list high numbers
                 - "rop=c99" would be same (Run OPtion vs User OPtion)
                 - "rop=b99" could be used to Bypass records
              s1 - space 1 (no space between records)
              s2 - space 2 (leave 1 blank line between records)
 User OPtion (uop) defaults  = q1r100m10s1r128m5
  null to accept or re-specify (1 or more) --> r128m5 <-- could enter options
 tmp/citytax1a.lst = default filo01 - null accept or reenter ?
 080107:213532:listrec2: EOF fili01 rds=5 size=1280: dat1/citytax1a
 080107:213532:listrec2: EOF filo01 wrts=14 size=926: tmp/citytax1a.lst
 EOJ, Output File written to: tmp/citytax1a.lst
 enter command: vi,cat,more,lp,uvlp12,null --> uvlp12 <-- enter uvlp12 to print

sample output report

 listrec2 - list (100 bytes/line) file=dat1/citytax1a 2008/01/07_21:35:31
           1         2         3         4         5         6         7         8         9        1
 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
 10130140  JOHN HENRY               1815 BOWEN ROAD          VANCOUVER           BCV9S1H1......W.....
 ....qq.000149061970530191809
 10139923  GEORGE BROWN             1250 EAST PENDER STREET  VANCOUVER           BCV5L1W1......W.....
 ....xRL00014626q980601190156
 10147615  BONNIE SMITH             44430 YALE ROAD WEST     VANCOUVER           BCV2P6J1.!9\..9b<...
 ....Q.L000037692950601201031
 10149304  TONY TATTERSAL           3350 S.W. MARINE DRIVE   VANCOUVER           BCV6N3Y9.PYL..v.....
 .....9.000192503930601201512
 10154688  MEL RAHAL                1110 - 625 HOWE STREET   VANCOUVER           BCV6C2T6......D.....
 ....%..000115479961126082351

See more at LISTjobs.htm#B2

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

7F2. CNVaids: Data File Aids

listhex2 - list fixed length records in hexadecimal

'listhex2' will list fixed length records in 100 byte segments with scale. Same as 'listrec2', but lists in vertical hexadecimal, showing 3 lines per 100 byte segment (characters, zones, digits).

We will demo listhex2 & show the output report, using test/demo file: /home/uvadm/dat1/citytax1a - 128 byte records with packed field in 88-96.


 cd /home/uvadm        <-- change to the uvadm home directory
 ==============

 uvcopy listhex2,fili1=dat1/citytax1a,uop=r128m2  <-- execute listhex2
 ===============================================      input=dat1/citytax1a
 - option 'r128' = Recsize, option 'm2' = Max recs to list
 - we also entered options below at prompt, redundant since on command line
 uop=q1r100m10 - option defaults
       r100    - record size default 100 bytes (max 5000)
       r512    - example for rcsz 512 (add 1 if indexed)
               - add 1 to recsize for Indexed/relative files
           m10 - list 10 records Max & end job
           m99 - probably would not want to list high numbers
               - "rop=c99" would be same (Run OPtion vs User OPtion)
               - "rop=b99" could be used to Bypass records
 User OPtion (uop) defaults  = q1r100m10r128m2
  null to accept or re-specify (1 or more) --> r128m2 <-- could enter options
 tmp/citytax1a.hex = default filo01 - null accept or reenter ?
 080107:211714:listhex2: EOF fili01 rds=2 size=1280: dat1/citytax1a
 080107:211714:listhex2: EOF filo01 wrts=17 size=985: tmp/citytax1a.hex
 EOJ, Output File written to: tmp/citytax1a.hex
 enter command: vi,cat,more,lp,uvlp12,null --> uvlp12 <-- enter uvlp12 to print

sample output report

           1         2         3         4         5         6         7         8         9        1
 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
 10130140  JOHN HENRY               1815 BOWEN ROAD          VANCOUVER           BCV9S1H1......W.....
 3333333322444424445522222222222222233332445442544422222222225444455452222222222244535343088800588000
 1013014000AF8E085E29000000000000000181502F75E02F14000000000061E3F56520000000000023693181029C0072C004
 ....qq.000149061970530191809
 8000770333333333333333333333
 7C0111C000149061970530191809
 10139923  GEORGE BROWN             1250 EAST PENDER STREET  VANCOUVER           BCV5L1W1......W.....
 3333333322444544245454222222222222233332445525444452555445225444455452222222222244534353088800588000
 101399230075F275022F7E0000000000000125005134005E45203425540061E3F5652000000000002365C171029C0072C004
 ....xRL00014626q980601190156
 8800754333333337333333333333
 7C0182C000146261980601190156

See more at LISTjobs.htm#B2

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

7G1. CNVaids: Data File Aids

gentest1 - generate test data files based on COBOL copybooks

'gentest1' will create uvcopy jobs to generate test data files based on COBOL copybooks. For type X fields, we insert 'A's in 1st field, 'B's in 2nd, etc. For type 9 fields (packed or numeric), we insert the current record#. Every 10th record, we insert the copybook fieldnames (in type X fields).

The generated uvcopy jobs are named after the copybooks and they call sub- routines to generate data for each field. Each picture field in the copybook generates a 'bal' to a subrtn, depending on field type (type X, packed, binary, signed/unsigned numeric). For example:


   bal  genx,'a00035b0025','address'    <-- sample call to subrtn
   =================================

This calls subrtn 'genx' for a type X field starting at byte 35 (option a00035) that is 25 bytes long (option b0025), whose fieldname is 'address'.

Here is a summary of the subrtns called & a description of the actions performed for the various field types:

genx
  • generates data in type X fields
  • inserts field-names in every 10th record
  • else generates 'A's in 1st field, 'B's in 2nd, 'C's in 3rd
  • inserts current record# in bytes 5-10 of fields longer than 15 bytes
gen9
  • generates data in numeric unpacked unsigned fields
  • inserts current record# in entire field, if field longer than 5 bytes
  • else, generates '1's in 1st field, '2's in 2nd, '3's in 3rd
gens
  • generates data in numeric Signed fields
  • inserts current record# in entire field
  • makes all fields in every 3rd record negative
genp
  • generates data in packed fields
  • inserts current record# in entire field
  • makes all fields in every 3rd record negative
genb
  • generates data in binary fields
  • inserts current record# in entire field
  • makes all fields in every 3rd record negative

Calling subrtns keeps the generated uvcopy jobs short since most of the field processing code is in these sub-routines. The subrtn module is called via the following code, which you can see at the end of the sample job listed on the next page.

@pf2=gentest1.sub <-- code to include subfunctions in uvcopy jobs

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

7G2. CNVaids: Data File Aids

gentest1 - sample input

 cobmap1  start-end bytes for cobol record fields    200408220851  pg# 0001
 cpys/citytax1                  citytax1           RCSZ=00128  bgn  end  lth typ
 * citytax1 copybook, from signscan1 + edit meaningful names
  01  citytax1.
      10 folio                 pic  x(00010).                 0000 0009  010
      10 name                  pic  x(00025).                 0010 0034  025
      10 address               pic  x(00025).                 0035 0059  025
      10 city                  pic  x(00020).                 0060 0079  020
      10 province              pic  x(00002).                 0080 0081  002
      10 zip                   pic  x(00006).                 0082 0087  006
      10 post-date             pic s9(00007) comp-3.          0088 0091  004pns 7
      10 land-value            pic s9(00009) comp-3.          0092 0096  005pns 9
      10 improv-value          pic s9(00009) comp-3.          0097 0101  005pns 9
      10 face-value            pic s9(00009) comp-3.          0102 0106  005pns 9
      10 maint-tax             pic s9(00007)v99.              0107 0115  009 ns 9
      10 purchase-date         pic  x(00006).                 0116 0121  006
      10 filler001             pic  x(00006).                 0122 0127  006
 *RCSZ=00128                                                       0128

sample output

 opr='JOBNAME citytax1 - generated by cobmap1 & gentest1'
 opr='uop=c100   - option "c" default record output count = 100'
 opr='           - may change at prompt (ex: enter "c2000" for 2000 records)'
 uop=q1c100      # option defaults
 was=a9000b9000
 filo1=?tmp/citytax1,rcs=00128,typ=RSF
 @run
        opn    all
        bal    initj                 inits for job (setup A-Z 0-9 patterns)
 # begin loop to generate fields & output each record
 loop   bal    initr                 inits for record (counts records,etc)
        clr    b0(00128),' '         init output area to all blanks
 #      ---                          <-- insert R/T tests if redef records
        bal    genx,'a00000b0010','folio'
        bal    genx,'a00010b0025','name'
        bal    genx,'a00035b0025','address'
        bal    genx,'a00060b0020','city'
        bal    genx,'a00080b0002','province'
        bal    genx,'a00082b0006','zip'
        bal    genp,'a00088b0004','post-date'
        bal    genp,'a00092b0005','land-value'
        bal    genp,'a00097b0005','improv-value'
        bal    genp,'a00102b0005','face-value'
        bal    gens,'a00107b0009','maint-tax'
        bal    genx,'a00116b0006','purchase-date'
        bal    genx,'a00122b0006','filler001'
 #
 put1   put    filo1,b0              output current record
        cmn    $ca1,$uopbc           reached output Count ?
        skp<   loop
 eof    cls    all
        eoj
 @pf2=gentest1.sub

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

7G3. CNVaids: Data File Aids

Op-Instrns for citytax1 demo file


 1. uvcopy cobmap1,fili1=cpys/citytax1,filo1=maps/citytax1
    ======================================================
           - convert the COBOL copybook into a 'cobmap' (record layout)

 2. uvcopy gentest1,fili1=maps/citytax1,filo1=pfg1/citytax1
    =======================================================
           - generate the uvcopy job from the cobmap

 3. uvcopy pfg1/citytax1,filo1=tmp/citytax1  <-- execute the generated job
    =======================================

 3a. uvcopy pfg1/citytax1    <-- same (output file defaults as shown above)
     ====================

console displays for option changes

uop=c100
  • option "c" default record output count = 100
  • may change at prompt (ex: enter "c2000" for 2000 records)

User OPtion (uop) defaults = q1c100 null to accept or re-specify (1 or more) --> c500 <-- may change default

 tmp/citytax1 = default filo01 - null accept or reenter -->   <-- null accept
 citytax1:040823:105849: EOF filo01 0 rds, 100 wrts, 12800 size; tmp/citytax1

 4. uvhd filename=tmp/citytax1 r128          <-- examine the output
    ===============================

Please see the 'uvhd' output display shown on the next page --->

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

7G4. CNVaids: Data File Aids

Here is the 'uvhd' command repeated from the previous page, but with option 's7' added to space out the display to make it easier to read.


 4. uvhd filename=tmp/citytax1 r128s7          <-- examine the output
    =================================

output from citytax1 demo file

                      10        20        30        40        50        60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 folio     name                     address                  city
             6666622222666622222222222222222222266676772222222222222222226677
             6FC9F00000E1D500000000000000000000014425330000000000000000003949
          64                 przip   ...................000000001purchafiller
             2222222222222222777672220001000010000100001333333333777666666667
             000000000000000002A90000000C0000C0000C0000C00000000105238169CC52
                      10        20        30        40        50        60
 r#        2 0123456789012345678901234567890123456789012345678901234567890123
         128 AAAAAAAAAABBBBB000002BBBBBBBBBBBBBBCCCCC000002CCCCCCCCCCCCCCDDDD
             4444444444444443333334444444444444444444333333444444444444444444
             1111111111222220000022222222222222233333000002333333333333334444
          64 D000002DDDDDDDDDEEFFFFFF...,....,....,....,000000002GGGGGGHHHHHH
             4333333444444444444444440002000020000200002333333333444444444444
             400000244444444455666666000C0000C0000C0000C000000002777777888888
                      10        20        30        40        50        60
 r#        3 0123456789012345678901234567890123456789012345678901234567890123
         256 AAAAAAAAAABBBBB000003BBBBBBBBBBBBBBCCCCC000003CCCCCCCCCCCCCCDDDD
             4444444444444443333334444444444444444444333333444444444444444444
             1111111111222220000032222222222222233333000003333333333333334444
          64 D000003DDDDDDDDDEEFFFFFF...=....=....=....=00000000sGGGGGGHHHHHH
             4333333444444444444444440003000030000300003333333337444444444444
             400000344444444455666666000D0000D0000D0000D000000003777777888888

Please relate this output to the copybook & the rules listed previously:

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

7G5. CNVaids: Data File Aids

'gentestA' script

The 'gentestA' script is provided to make it easier to run the gentest1 utility. The script includes both the cobmap1 & gentest1 uvcopy jobs, reducing the operating instructions to 1 line:


 gentestA citytax1      - generates uvcopy job --> pfg1/citytax1
 =================

 uvcopy pfg1/citytax1,filo1=tmp/citytax1  <-- execute the generated job
 =======================================

Op-Instns for all files in directory


 #1. uvcopyx cobmap1 cpys maps uop=q0i7p0  <-- create cobmaps for all copybooks
     ====================================

 #2. uvcopyx gentest1 maps pfg1 uop=q0i7   <-- create data gen jobs for all maps
     ===================================

 #3. uvcopyX 'pfg1/*'                      <-- execute all data generate jobs
     ================

You might want to generate all test data generation jobs as shown in #1 & #2 above, but it is unlikely you would want to execute all at once because they would be generated in the 'tmp' subdir & all default to 100 records.

uvcopy code for gentest1

The uvcopy code for gentest1 & gentest1.sub is not shown here or on the web site documentation, but if you have Vancouver Utilities installed, you may find the code as follows:

 /home/uvadm/pf/IBM/gentest1  - uvcopy code to generate the uvcopy jobs
                                to generate the test data files from copybooks
 /home/uvadm/pf/IBM/gentest1.sub - uvcopy code for the sub-routines called
                                   by the generated uvcopy jobs

Note that the generated jobs would be in your sub-directories. If you had followed the recommended setup procedures (setting up userid 'cnvdata'), this would be:

/home/cnvdata/pfg1/xxxxxx

Each of the generated jobs loads the subrtns via the code found on the last line of each generated job, which is:

 @pf2=gentest1.sub          <-- loads the subrtn code

The subrtns will be loaded from /home/uvadm/pf/IBM/gentest1.sub. If you want to modify the subrtns, you should 1st copy to your own 'pf' directory & place your directory ahead of the 'uvadm' pf directory in the PFPATH variable that uvcopy uses to load uvcopy job code. Do not modify in the uvadm pf directory, because any later update install of Vancouver Utilities would overwrite your modified code.

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

7H1. CNVaids: Data File Aids

Data File VTOC Report


 #1.  login: ordr --> /p1/testlibs/ordr  (login: apay,arcv,ordr,etc)

 #2.  l $RUNDATA     relevant subdir --> /p2/proddata/ordr

 #3a. uvcopy vtocr1,fild1=${RUNDATA}/ordr,filo1=tmp/vtocrpt  <- defaults
      =====================================================

 #3b. uvcopy vtocr1     <-- same as above (defaults omitted)
      =============
      prompt indir       -->        <-- null for default
      prompt reportfile  -->        <-- null for default
      prompt vi/uvlp/etc --> uvlp12 <-- print at 12 cpi on default printer
        or                                                ($UVLPDEST)
 #4. uvlp12 tmp/vtocrpt -dlaser1     - print report on desired printer
     ===========================
 vtocr1    Directory:  /p2/proddata/ordr
 2000/06/02_10:58:48                           options: q1a1r0s1k2
 file#   file-size   rcsz  records   dels kloc klen  last-modify   filename
    1  298,058,233   450+  660,883            0 16  20000602 08:59 ipalacct
                                             16  6n
    2           64    63+        1            0 23  20000602 08:59 ipaladjw
    3      598,336    31+   18,698            0  9  20000602 08:59 ipaldcal
    4        4,480    31+      140            0  4  20000602 08:59 ipaldtrm
                                              4  4n
    5        8,896    63+      139            0  3  20000602 08:59 ipallcal
    6    2,493,696   255+    9,741            0 16  20000602 08:59 ipallnme
    7        7,680   511+       15            0  4  20000602 08:59 ipalmisc
    8   68,171,008   255+  266,293            0  9  20000602 09:25 ipalname
                                              9  9n
                                             18 16n
    9   10,433,792   255+   40,757            0 12  20000602 09:28 ipalnveh
                                             12  8n
                                             20 19n
   10   11,332,728  3839     2,952                  20000602 09:29 ipalprnt
   11       14,592   127+      114            0  4  20000602 09:30 ipalrate
   12        9,472   255+       37            0  2  20000602 09:30 ipalreas
   13       43,008   255+      168            0  6  20000602 09:30 ipalrept
   14       12,032    63+      188            0 15  20000602 09:30 iordrchd
   15        6,336    63+       99            0 13  20000602 09:30 iordrmss
   16   94,807,040   255+  370,340            0 12  20000602 09:37 iordrveh
                                             12  8n
                                             20  9n
                                             29 19n
       661,590,417 Total 4,092,054      0

See more at VTOCjobs.htm

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

7I1. CNVaids: Data File Aids

uvsort

'uvsort' provides most SYNCSORT features at a much lower price.

  1. Input &/or Output files can be many different types - fixed length, sequential, variable length (RDW or IDXFORMAT), Indexed

  2. may select, delete, translate,& reformat records

  3. options to drop duplicate records - all or select 1st/last of a set

  4. may specify up to 20 input files & up to 60 output files.

  5. On input you may specify record selects/deletes/reformats that are applied to all records.

  6. On output you may specify record selects/deletes/reformats that are different for different output files.

  7. Number of input files can be unlimited using option 'f2' to input all files from a specified directory & optionally matching a specified prefix.

  8. For output files, you may specify option 'f1' on key1 (key1f1) to output multiple separate files for duplicate record key sets based on key1. This is a unique & powerful feature that can be used to write out separate files for each customer#, salesman#, state/province, etc. The output filenames are automatically created in the specified output directory, with an optional prefix, followed by the current key1 data value.

There are many more features described in uvsort.htm.

example - sort sequential & load Indexed


 uvsort "fili1=input,rcs=64,typ=RSF,filo1=output,typ=ISF,key1=0(6)"
 ==================================================================

There are many more examples shown in uvsort.htm.

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

7J1. CNVaids: Data File Aids

uvlist - Program Description

uvlist will list ascii text files (on stdout by default) but with the main intention of piping to a laser printer. Several scripts are provided. For example, this documentation is printed with 'uvlp12D', which prints at 12 cpi, DUPLEX, with margins to allow for 3 hole punched paper.

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

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

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


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

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

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

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

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

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

uvlp12 script

You can see 'uvlp12' (& other scripts) listed begining at uvlist.htm#E1, But here is just the 1 essential line extracted from the script.


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

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

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

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

7J2. CNVaids: uvlist utility

option 'y' for column scale headings

Option 'y' prints a column scale in the page headings. This is a BIG help to determine the layout of mainframe records when no COBOL copybook is available.

For example, we will use option 'y80' to print an 80 byte column scale for test/demo file dat1/customers. We will also specify option 'e1' to End printing after 1 page (but in fact dat1/customers is only 8 lines).


 uvlp12 dat1/customers e1y80
 ===========================

sample uvlist with option 'y80'

 /home/uvadm/dat1/customers now=081102:0911 uvadm pg#  1
          1         2         3         4         5         6         7         8
 12345678901234567890123456789012345678901234567890123456789012345678901234567890
 130140 EVERGREEN MOTORS LTD.  1815 BOWEN ROAD        NANAIMO          BC V9S1H1
 139923 JOHNSTONE BOILER       1250 EAST PENDER ST.   VANCOUVER        BC V5L1W1
 150825 RIGGERS INDUSTRIAL     960 - 6TH AVENUE       HOPE             BC V2P6J1
 201120 ALLTYPE RENTAL LTD.    BOX 1819               DRAYTON VALLEY   AL T0E0M0
 308685 FOOTHILLS ELECTRIC     3932 - 3A ST. N.W.     CALGARY          AL T2E6R4
 315512 PARTS PLUS             BOX 510 MAIN ST.       THREE HILLS      AB T0M2A0
 400002 ACKLANDS LTD           945 -2ND AVE.          PRINCE GEORGE    BC V2L3A7
 406082 PRECAM RENTALS LTD.    10116-94TH AVE.        FORT ST. JOHN    BC V1G5G6

The scale makes it easy to determine field start & end bytes:

 cust# 01-06, name 08-29, address 31-52, city 54-69, province 71-72, zip 74-79.

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

7J3. CNVaids: uvlist utility

uvlist as a filter - compress blank lines & spaces

Sometimes you encounter a file with a lot of blank lines & blank spaces within lines that make the listing longer than it needs to be & makes it difficult to read because lines wrap to multiple lines even though the data would fit on 1 line - if we could just compress the multiple blank spaces.

For example, the output of 'utmpdump' (utility to display reboots & logins) has many blank spaces that wrap lines. Here is the command to capture the output.


 #1. utmpdump /var/run/utmp >/tmp/utmpdump1
     ======================================

sample output of utmpdump

 [2] [00000] [~~  ] [reboot  ] [~           ] [                    ] [0.0.0.0        ] [Sun Sep 14 07:17:35 2008 PDT]
 [1] [20021] [~~  ] [runlevel] [~           ] [                    ] [0.0.0.0        ] [Sun Sep 14 07:17:35 2008 PDT]
 [7] [03935] [1   ] [root    ] [tty1        ] [                    ] [0.0.0.0        ] [Sun Sep 14 07:29:25 2008 PDT]
 [7] [03939] [2   ] [uvadm   ] [tty2        ] [                    ] [0.0.0.0        ] [Sun Sep 14 07:29:31 2008 PDT]
 [7] [03940] [3   ] [uvbak   ] [tty3        ] [                    ] [0.0.0.0        ] [Sun Sep 14 07:29:37 2008 PDT]
 [7] [03951] [4   ] [uvext   ] [tty4        ] [                    ] [0.0.0.0        ] [Sun Sep 14 09:22:32 2008 PDT]

We can make the listing easier to read by using uvlist as follows:


 #2. uvlist /tmp/utmpdump1 c9d1i1hp0 >/tmp/utmpdump2
     ===============================================
     - option 'c9' reduces multi spaces within lines to 1 space
     - option 'd1' reduces multi blank lines to 1 blank line
     - options 'i1hp0' always when using uvlist as a filter
       (to inhibit laser control codes, uvlist page headings,& FormFeeds)

 #3a. vi /tmp/utmpdump2       <-- display compressed report with 'vi'
      =================

 #3b. uvlp12 /tmp/utmpdump2   <-- OR list with 'uvlp12', etc
      =====================

sample output of uvlist

 [2] [00000] [~~ ] [reboot ] [~ ] [ ] [0.0.0.0 ] [Sun Sep 14 07:17:35 2008 PDT]
 [1] [20021] [~~ ] [runlevel] [~ ] [ ] [0.0.0.0 ] [Sun Sep 14 07:17:35 2008 PDT]
 [7] [03935] [1 ] [root ] [tty1 ] [ ] [0.0.0.0 ] [Sun Sep 14 07:29:25 2008 PDT]
 [7] [03939] [2 ] [uvadm ] [tty2 ] [ ] [0.0.0.0 ] [Sun Sep 14 07:29:31 2008 PDT]
 [7] [03940] [3 ] [uvbak ] [tty3 ] [ ] [0.0.0.0 ] [Sun Sep 14 07:29:37 2008 PDT]
 [7] [03951] [4 ] [uvext ] [tty4 ] [ ] [0.0.0.0 ] [Sun Sep 14 09:22:32 2008 PDT]
Note
  • utmpdump does not create blank lines, I inserted to demo option 'd1'
  • see more on utmpdump at ADMjobs.htm#8J4.

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

7U1. CNVaids: Data File Aids

uxcp - complex Data File Conversions

We have already illustrated 'uvcp' on page '7C1'. 'uxcp' is a similar utility with the addition of the Micro Focus COBOL file handler to allow access to 'variable length indexed files'.

For mainframe conversions, you may need to transfer/convert variable length files from the mainframe to Unix/Linux. If the files have packed/binary fields, you will need to use the procedures documented in MVSDATA.htm which translate char fields, but preserve packed/binary fields, based on the COBOL copybooks.

Here in CNVaids.doc, we will show you how you can convert mainframe files without packed/binary fields, using a 1 line command to 'uxcp'. Variable length files should be unloaded from the mainframe file system to 'RDW' files for FTP to Unix/Linux.

mainframe file in RDW format for FTP

desired Output file on Unix/Linux

uxcp command to convert file


 uxcp "fili1=dir1/filex,typ=RDW,rcs=500,filo1=dir2/filex,typ=IDXf8v\
 ===================================================================
 ,tra=0(500),isk1=0(10)"
 =======================

See much more in uxcp.htm

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

Part_8. CNVaids.doc Vancouver Utility Conversion Aids

uvcopy - pre-programmed jobs useful in conversions


8A1. uvcopy - introduction to uvcopy (most powerful Vancouver utility)
- how uvcopy can help you solve data file problems

8B1. acum1 - pre-programmed job to accumulate any 1 field in any datafile
- might be for a hash total to prove file validity after conversions
  or to get a 2nd opinion when COBOL reports look suspicious
- prompts for file-name, file-type, field dsplcmnt, length,& type,
- option to crossfoot a number of consecutive same-size fields.

8C1. cmrpt1 - customer master sales report for test file dat1/custmas1
  (used to demo both acum1 above & selectf1 below)
- report presented here, so you can verify your results
  if you run 'acum1' or 'selectf1'.

8D1. selectf1 - select records depending on field value <=> 2 specified values.
- prompts for field displacement, length, type, number, & values.
- 2 values allows you to select a range of values in any 1 field.
- option to crossfoot multi contiguous same size fields for test.

8E1. scan5d - pre-programmed job to scan all files in a directory, searching
  for exception files. You specify exception conditons in a control
  file of patterns & minimum/maximum counts.
- example given to find COBOL programs with more than 1
  'PROCEDURE DIVISION' or with any (> 0) 'EXEC SQL's

8F1. splitjclproc1 - split subdir of mixed JCLs & PROCs to separate subdirs
- used to separate emailed zip files of mixed JCLs & PROCs
- JCL conversion requires JCLs & PROCs in separate subdirs
- demos uvcopy ability to read directories & process files

8G1. splitcblcpy1 - split mixed directories of COBOL programs & copybooks
to separate subdirs required by COBOL conversion & compile

8H1. grepx1 - extract filenames from grep output, sort,& data reduce
  to 1 line for multiple occurrences in same file
- option to insert 'vi' prior to each filename in output file
- saves typing when you need to investigate & possibly change
- example given for mannframe COBOL covnersion
  (may need to change 'accept from date' for unix COBOL)

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

8A1. CNVaids.doc Vancouver Utility Conversion Aids

uvcopy - powerful data manipulation

'uvcopy' has almost unlimited power to perform whatever kind of data manipulation you may need to perform. Here in CNVaids.doc we will present a few examples & refer you to many other examples thruout the Vancouver Utility documentation.

There are 2 ways that uvcopy can help you solve data file problems:

  1. You can write a new customized uvcopy job to solve your specific problem. See uvcopy documentation at uvcopy1.htm, uvcopy2.htm & uvcopy3.htm. Also see many sample jobs in uvcopy4.htm thru uvcopy7.htm. You might start with uvtrain.htm#J0 & refer to uvcopy3.htm for instruction documentation.

  2. You may find a pre-programmed job to solve your current problem, and save you from having to write the uvcopy instructions.

There are many examples of pre-programmed uvcopy jobs thruout the JCL, COBOL, & DATA conversion manuals. These may be complex. You can find many simpler but useful pre-programmed jobs in UVjobs1.htm. Here are 3 examples:

  1. tolower - convert any file to lower case

  2. tabfix1 - convert tabs to a specific number of spaces

  3. table2 - create table summaries of counts & amounts based on a specified argument & 1 or 2 quantity/amount fields.

Here in Part_8 of CNVaids.doc, we will illustrate some of the more powerful pre-programmed jobs that might be useful during conversions.

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

8B1. uvcopy Pre-Programmed jobs for Data Files

acum1 - accumulate any 1 field in a datafile

'acum1' is a pre-programmed 'uvcopy job' to accumulate any 1 field in any 1 file for any use desired (might be for a hash total to prove file validity after conversions, or to get a 2nd opinion when COBOL reports look suspicious).

'acum1' will prompt for file-name, file-type, field dsplcmnt, length,& type, with an option to crossfoot a specified number of consecutive same-size fields.

We will demonstrate using test file /home/uvadm/dat1/custmas1, a customer master file with monthly sales fields for this-year & last-year. Here is the uvhd display of the 1st record:


 uvhd dat1/custmas1 r256s3   <-- run uvhd to display test file in hexadecimal
 =========================     - option 'r256' record size
                               - option 's3' space betwn 64 byte segments
                      10        20        30        40        50        60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD          NANA
             3333332222454545444244545524542222233332445442544422222222224444
             130140000056527255E0DF4F230C44E0000181502F75E02F140000000000E1E1
          64 IMO          BC V9S1H1    250-754-5531 LARRY WRENCH     ..4V|...
             4442222222222442535343222233323332333324455525544442222201357000
             9DF00000000002306931810000250D754D55310C12290725E38000000246C000
         128 .........W0....`........)X}..f3.....\.................4V}...f...
             0000000005300016000000002570063100095000000000000000013570016000
             0C0000C0270D0540C0000C0098D0263C0444C0000C0000C0000C0246D0056C00
         192 .E|...V}.......................f.....<........f.C 19950531
             0470005700000000880000000018000680001300000000694233333333222222
             35C0046D0000C0023C0000C0083C0056D0012C0000C0016D3019950531000000
Note
  • 12 x 5 byte THIS-year packed fields from byte 120 to 179
  • 12 x 5 byte LAST-year packed fields from byte 180 to 239

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

8B2. uvcopy Pre-Programmed jobs for Data Files

acum1 - operating instructions

You could enter just 'uvcopy acum1' (#1 below) & you would be prompted for file-name, file-type, field start, length,cross-foot, type,& record-size.

Or you could enter the file-name &/or all options (#2 & #3 below). Once you understand the options, it is agood idea to enter them on the command line, which allows you to repeat the command easily from your shell history.


 #1. uvcopy acum1    <-- will prompt for filename, filetype,& all options
     ============        (field start, length, crossft, type, recsize)

 #2. uvcopy acum1,fili1=dat1/custmas1
     ================================
     - example options for dat1/custmas1 (relate uop=... to options below)

 #3. uvcopy acum1,fili1=dat1/custmas1,uop=a120b5c12d2e2f0r256
     ========================================================
     - example options for dat1/custmas1 (see options described below)
     - output report will be written to tmp/dat1_custmas1_acum1

console log (option prompts)

 acum1 - acum any field for hash total, etc
 file type options: LST(text), RSF(fixed,default), RDWz4, RDWz2, ISF, IDXf8
 uop=a0b0c1d0e0f0r0  - default options
     a0              - field dsplcmnt (zero relative)
       b0            - field length (must specify)
         c1          - cross-foot number of fields
         c12         - example for 12 months sales
            d0       - field type numeric unpacked
            d1       - field type binary
            d2       - field type packed
              e0     - edit 0 decimals
              e2     - edit 2 decimals
                f0   - ASCII file
                f1   - EBCDIC file
                  r0 - recsize if typ=RSF
 090220:195505:acum1: uvcopy ver=20090212 pf=/home/uvadm/pf/util/acum1
 uvcopy DISAM ext=dat LNX L64  license=20090212V site=UV_Software
 User OPtion (uop) defaults  = q1a0b0c1d0e0f0r0
 -->null to accept or enter/override -->
 field length uop=b1-b15 must be specified, job cancelled

sample report from acum1

      ====================================================================
      acum1: dsplcmnt 120, length 5, occurs 12, recsize 256: dat1/custmas1
      field total-->          99,697.93  records=          32
      ====================================================================

See the 'acum1' uvcopy job listed at UVjobs1.htm#T3

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

8C1. uvcopy Pre-Programmed jobs for Data Files

customer master sales report

This report is presented here, so you can verify yor results with the preceding 'acum1' job & the following 'selectf1' job. You can run it as follows:


 uvcopy cmrpt1,fili1-dat1/custmas1   <-- run the customer master sales report
 =================================

 cust#     customer-name              telephone    this-year <sales> last-year
 ==============================================================================
 130140    EVERGREEN MOTORS LTD.      250-754-5531   21335.56    12152.55-
 132588    GEECOE GENERATOR SERVICES  604-278-4488     434.98      640.04
 139923    JOHNSTONE BOILER & TANKS   604-320-1845      73.98      453.20
 142175    LILLY ELECTRIC (1973) LTD  604-534-9787   10761.58         .00
 145264  D MAGRATH SUPPLIES LTD.      250-843-2987        .00         .00
 147615  X O'CONNER R.V. CENTRE       604-858-4161    4478.00     8610.30
 149304    POINT GREY GOLF & COUNTRY  604-732-5572     734.37         .00
 150825    RIGGERS INDUSTRIAL         604-858-4729      75.70      173.25
 152355    SHAW, JOHN                 604-291-6261     424.48         .00
 154688    TAURUS RESOURCES           604 685 8565   18338.09      766.96
 157352  D WHYTE, W.                  604-980-5434        .00         .00
 173320  X ZENITH TRANSPORT           604-520-3979    1420.00         .00
 201120    ALLTYPE RENTAL LTD.        403-246-5274     228.01     1765.10
 204700    CASE POWER EQUIPMENT       403-538-1743    1318.41      427.54
 208060    E&L TRUCKING               403-231-7312      17.39-    1534.06
 211140  D FORD NEW HOLLAND           403-312-2760        .00         .00
 223240  X NICHOLSON CHEVROLET LTD.   403-467-4257    6148.45     3246.38
 224700    OTTO MOBILES WESTERN LTD.  403-467-3197   13959.90    24673.59
 231550    SPARROW ELECTRIC CO. LTD.  403-742-6139    5725.00     1742.59
 234300    TERRITORIAL REWIND         403-512-3948    4901.21         .00
 237286    WEBER, TOM                 403-529-7425    1000.00-     849.88
 301120  D ALBERTA GAS CHEMICALS LTD  403-952-2475        .00         .00
 306959  X 356582 ALBERTA LTD.           -   -         138.98      412.97
 308685    FOOTHILLS ELECTRIC         403-296-4856     270.33       43.41
 313720    MONITREX ENGINEERING LTD                   2256.02     2427.49
 315512    PARTS PLUS                 403-385-7134     340.52         .00
 318833    TOP NOTCH CONSTRUCTION     403-385-2965     485.25      390.89
 400002    ACKLANDS LTD               250-705-2583    1737.25     3198.49
 401210    COAST RANGE CONSTRUCTION   604 681 2626    4966.28         .00
 402875    HULL, DON & SONS LTD.      250-836-2964      44.50     1196.72
 403887  D MILNER, LARRY              250-351-9472      66.01     4432.47
 406082    PRECAM RENTALS LTD:        250-637-6351      52.46      608.06
 cmrpt1  2009/02/21_07:37:05  summary table by territory dat1/custmas1
 tbl#001 pg#001     -argument-            -acum#1-    %        -acum#2-    %
 line#  count    %  territory         thisyr sales         lastyr sales
    1       12  37  1                    58,076.74   58        1,508.80-   3-
    2        9  28  2                    31,263.59   31       34,239.14   75
    3        6  18  3                     3,491.10    3        3,274.76    7
    4        5  15  4                     6,866.50    6        9,435.74   20
            32*100   *TOTAL*             99,697.93 *100       45,440.84 *100

See the 'cmrpt1' uvcopy job listed at UVjobs1.htm#U2

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

8D1. uvcopy Pre-Programmed jobs for Data Files

selectf1 - select records depending on field value

'selectf1' is a uvcopy pre-programmed job to select records from any file depending on the value in any specified field <=> 2 specified values. Two specified values allows you to select a range of values in any 1 field. There is an option to crossfoot multi contiguous same size fields for the test value.

Here is a sample command to select sales records with this-year sales over $50.00 OR less than -50.00. Please see the preceding customer sales report on page 'U1' to verify the selections made here. Also see the record layout on page 'T1'.


 uvcopy selectf1,fili1=dat1/custmas1,uop=a120b5c12f0,arg1='>5000',arg2='|<-5000'
 ===============================================================================

console log - options prompt

 uop=a0b0c1d0e0f0r0  - default options
     a0              - field dsplcmnt (zero relative)
       b0            - field length (must specify)
         c1          - cross-foot number of fields
         c12         - example for 12 months sales
            d0       - field type numeric unpacked
            d1       - field type binary
            d2       - field type packed
                f0   - ASCII file
                f1   - EBCDIC file
                  r0 - recsize if typ=RSF
 uop=a120b5c12d2f0   - EX: field dsp 120, lth 5, packed(c2), ASCII(f0)
 arg1='>500',arg2='|<-500' <-- select recs > 5.00 OR <-5.00 in 120(5p)
 arg1='=0',arg2='_'        <-- select records with thisyr sales zero
           arg2='&/|'        - else 1st byte must be &/| AND/OR
           arg2='&/|</=/>'          2nd byte must be <=>
 note - conditions &| <=> values must be in SINGLE quotes (not doubles)
      - if entered on command line (not if entered at the prompt)
 User OPtion (uop) defaults  = q1a0b0c1d0f0r0a120b5c12d2r256
 -->null to accept or enter/override -->  <-- enter null (accept cmnd line optns)
 dat1/custmas1 = default fili01 - null accept or reenter ?
 RSF = typ default fili01 - null accept or enter new typ ?
 tmp/dat1_custmas1_sel = default filo01 - null accept or reenter ?
 RSF = typ default filo01 - null accept or enter new typ ?
 15 records selected via >50000 & |<-50000
 090221:153134:selectf1: EOF fili01 rds=32 size=8192: dat1/custmas1
 090221:153134:selectf1: EOF filo01 wrts=15 size=3840: tmp/dat1_custmas1_sel

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

8D2. selectf1 - select records depending on field value

notes re command line options


 uvcopy selectf1,fili1=dat1/custmas1,uop=a120b5c12f0,arg1='>5000',arg2='|<-5000'
 ===============================================================================
  1. Options a&b 'a120b5' specify the field start byte & length.

  2. Option c 'c12' specifies any crossfooting for multi same size fields (12 for 12 months sales fields).

  3. Option 'd2' specifies packed, option 'f0' for ASCII (vs f1 for EBCDIC).

  4. arg1='>5000' specifies the value at 120(5p) must be > $50.00.

  5. arg2='|<-5000' specifies OR the value must be < -50.00

  6. arg2='&<10000' could specify AND value must be < $100.00

See the 'selectf1' uvcopy job listed at UVjobs1.htm#V3

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

8E1. uvcopy Pre-Programmed jobs

scan5d - search directory for exception files

'scan5d' is a pre-programmed uvcopy job that will scan all files in a directory, searching for exception files. You specify the exception conditons in a control file of patterns & min/max pattern counts.

For our example, we will scan a directory of COBOL programs, searching for patterns & counts that will identify what we consider to be exceptions. We expect most programs to have 1 'IDENTIFICATION DIVISION', 1 'PROCEDURE DIVISION', etc. More than 1 of these would indicate 1 file with multiple programs, which is very unusual & would be problem for out COBOL conversions.

We will also specify as 'LINKAGE SECTION' & 'EXEC SQL' as exceptions, by sepcifying 0 for min/max counts.

The default options report only the exception files, but we have specified user option 'a1' to report all files, since our directory contained only 14 programs. Without option 'a1' we would report only 3 programs as indicated by the '*' in the report below:

sample exception report

 Job: scan5d  Dir: cbl0  Table: ctl/cobolxcptn.tbl
 Date: 2009/11/04_12:56:54  Uops: q1a0c0a1c2
 ======================================= min41-48  max51-58
  identification division~~~~~~~~~~~~~~~~00000001~~00000001~~~~~~~~~~~~~~~~~~~~~~
  input-output section~~~~~~~~~~~~~~~~~~~00000001~~00000001~~~~~~~~~~~~~~~~~~~~~~
  working-storage section~~~~~~~~~~~~~~~~00000001~~00000001~~~~~~~~~~~~~~~~~~~~~~
  procedure division~~~~~~~~~~~~~~~~~~~~~00000001~~00000001~~~~~~~~~~~~~~~~~~~~~~
  linkage section~~~~~~~~~~~~~~~~~~~~~~~~00000000~~00000000~~~~~~~~~~~~~~~~~~~~~~
  exec sql~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~00000000~~00000000~~~~~~~~~~~~~~~~~~~~~~
 ================================================================================
 0001 0030   CAR101.cbl                  1,1,1,1,0,0,
 0002 0062 * sqlora2.cbl                 1,1,1,1,0,9,
 0003 0019   CAR300.cbl                  1,1,1,1,0,0,
 0004 0045   CAR150.cbl                  1,1,1,1,0,0,
 0005 0045   CAR130.cbl                  1,1,1,1,0,0,
 0006 0063 * sqlora1.cbl                 1,1,1,1,0,8,
 0007 0052   TESTUNIX1.cbl               1,1,1,1,0,0,
 0008 0046   CGL100.cbl                  1,1,1,1,0,0,
 0009 0041   CAR100.cbl                  1,1,1,1,0,0,
 0010 0047 * CAR120.cbl                  1,1,1,1,1,0,
 0011 0045   CAR140.cbl                  1,1,1,1,0,0,
 0012 0052   CAR200.cbl                  1,1,1,1,0,0,
 0013 0052   CGL200.cbl                  1,1,1,1,0,0,
 0014 0037   CPY100.cbl                  1,1,1,1,0,0,
 ================================================================================
 Total files=14, Lines=636, Counts=14,14,14,14,1,17,

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

8E2. scan5d - search directory for exception files

Op. Instrns. for scan5d

Here is how we created the exception file that was read by 'scan5d' to create the COBOL exception report shown above.

We used the demo COBOL programs supplied in /home/uvadm/mvstest/testlibs/cbl0/. We setup userid 'mvstest' as documented in MVSJCL.htm or MVSCOBOL.htm, & cpoied testlibs/* over there. You could copy testlibs/* to your homedir.


 #1. Login mvstest (or yourself if you copied testlibs/* to your homedir)

 #2. cdl --> $TESTLIBS  (alias cdl='cd $TESTLIBS')

 #3. vi ctl/cobolxcptn.tbl     <-- create exception control file
     =====================
 # cobolxcptn.tbl - sample search table for uvcopy job 'scan5d'
 # - scan COBOL programs for exceptions <> expected pattern counts
 # - report programs with < 1 or > 1 of each of following DIVISIONs & SECTIONs
 # - report programs with any LINKAGE section or any 'EXEC SQL's
 #   --- pattern col 01-40 ---           min41-48  max51-58
  identification division~~~~~~~~~~~~~~~~00000001~~00000001~~~~~~~~~~~~~~~~~~~~~~
  input-output section~~~~~~~~~~~~~~~~~~~00000001~~00000001~~~~~~~~~~~~~~~~~~~~~~
  working-storage section~~~~~~~~~~~~~~~~00000001~~00000001~~~~~~~~~~~~~~~~~~~~~~
  procedure division~~~~~~~~~~~~~~~~~~~~~00000001~~00000001~~~~~~~~~~~~~~~~~~~~~~
  linkage section~~~~~~~~~~~~~~~~~~~~~~~~00000000~~00000000~~~~~~~~~~~~~~~~~~~~~~
  exec sql~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~00000000~~00000000~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note
  • the '#' comment lines are of course optional
  • It is a good idea to code the name of the file & a brief description

 #4. uvcopy scan5d,fild1=cbl0,fili2=ctl/cobolxcptn.tbl,filo3=tmp/cbl0.rpt
     ====================================================================
     - create COBOL exception report (shown on prior page)

 #5a. vi tmp/cbl0.rpt        <-- view exception report
      ===============

 #5b. uvlp12 tmp/cbl0.rpt    <-- print exception report
      ===================      - see listing on prior page

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

8E3. scan5d - search directory for exception files

scan JCL for certain programs

Another example might be to analyze JCLs to determine if certain programs are being executed. I used the following table on the mvstest demo JCLs:


 #3. vi ctl/JCLxcptn.tbl     <-- create control file to analyze JCL
     ===================         for desired program EXECutions
 # JCLxcptn.tbl - determine frequency of following program executions in JCLs
 #   --- pattern col 01-40 ---           min41-48  max51-58
  EXEC PGM=IKJEFT01~~~~~~~~~~~~~~~~~~~~~~00000000  00000000
  EXEC PGM=FTP~~~~~~~~~~~~~~~~~~~~~~~~~~~00000000  00000000
  EXEC PGM=MAIL~~~~~~~~~~~~~~~~~~~~~~~~~~00000000  00000000
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 #4. uvcopy scan5d,fild1=jcl0,fili2=ctl/JCLxcptn.tbl,filo3=tmp/jcl0.rpt
     ====================================================================

 #5. cat tmp/JCLxcptn.tbl    <-- display report
     ====================
 Job: scan5d  Dir: jcl0  Table: ctl/JCLxcptn.tbl
 Date: 2009/11/03_05:38:36  Uops: q1a0c0
 ======================================= min41-48  max51-58
  EXEC PGM=IKJEFT01~~~~~~~~~~~~~~~~~~~~~~00000000  00000000
  EXEC PGM=FTP~~~~~~~~~~~~~~~~~~~~~~~~~~~00000000  00000000
  EXEC PGM=MAIL~~~~~~~~~~~~~~~~~~~~~~~~~~00000000  00000000
 ================================================================================
 0015 0007 * IKJEFT01.jcl                1,0,0,
 0023 0013 * FTPGET1.jcl                 0,1,0,
 0026 0011 * FTPDEMO1.jcl                0,1,0,
 0031 0007 * MAILDEMO.jcl                0,0,1,
 0032 0010 * FTPDEMO2.jcl                0,1,0,
 0040 0009 * FTPPUT1.jcl                 0,1,0,
 ================================================================================
 Total files=54, Lines=691, Counts=1,4,1,

Try it yourself

Create your own exception table to analyze whatver problem you can think of. Using the pre-programmed jobs is easy, all you have to do is edit a simple text file. The programming job has been done for you.

In case you wish to see the coding for the 'scan5d' pre-programmed job, it is listed on the following pages. This is 1 the more powerful & complex examples and do not let it scare you. uvcopy is in fact easy to learn if you start with the simpler exercises at http://www.uvsoftware.ca/uvtrain.htm#Part_4.

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

8E4. scan5d - search directory for exception files

scan5d - search directory for exception files

 # scan5d - uvcopy Parameter File from UVSI stored in: /home/uvadm/pf/util/
 # scan5d - scan a directory searching for matches to a table of patterns
 #        - table entries have min & max counts for each pattern
 #        - report files with actual counts < min or > max
 #
 #note - this job reports only the filenames
 #     - see scanjobs.doc for other jobs (such as scan2d) to report the
 #       text lines containing the matches
 #
 #usage: uvcopy scan5d,fild1=indir,fili2=table,filo3=report
 #       ==================================================
 #
 #demo: uvcopy scan5d,fild1=cbls,fili2=ctl/cobolxcptn.tbl,filo3=scan5d.rpt
 #      ==================================================================
 #
 #                  ** sample pattern table & report **
 #
 # Job: scan5d  Dir: cbl0  Table: ctl/cobolxcptn.tbl
 # Date: 2009/11/04_12:38:26  Uops: q1a0c0c2
 # ======================================= min41-48  max51-58
 #  identification division~~~~~~~~~~~~~~~~00000001~~00000001~~~~~~~~~~~~~~~~~~~~
 #  input-output section~~~~~~~~~~~~~~~~~~~00000001~~00000001~~~~~~~~~~~~~~~~~~~~
 #  working-storage section~~~~~~~~~~~~~~~~00000001~~00000001~~~~~~~~~~~~~~~~~~~~
 #  procedure division~~~~~~~~~~~~~~~~~~~~~00000001~~00000001~~~~~~~~~~~~~~~~~~~~
 #  linkage section~~~~~~~~~~~~~~~~~~~~~~~~00000000~~00000000~~~~~~~~~~~~~~~~~~~~
 #  exec sql~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~00000000~~00000000~~~~~~~~~~~~~~~~~~~~
 # ==============================================================================
 # 0002 0062 * sqlora2.cbl                 1,1,1,1,0,9,
 # 0006 0063 * sqlora1.cbl                 1,1,1,1,0,8,
 # 0010 0047 * CAR120.cbl                  1,1,1,1,1,0,
 # ==============================================================================
 # Total files=14, Lines=636, Counts=14,14,14,14,1,17,
 #
 opr='$jobname - report files in subdir with min/max pattern count exceptions'
 opr='uop=q1a0c0   - option defaults'
 opr='      a1     - report all files regardless of min/max criteria'
 opr='             - may want to see pattern conts for all files'
 opr='        c1   - inhibit scan of script comments (# col 1)'
 opr='        c2   - inhibit scan of cobol comment lines (* col 7)'
 uop=q1a0c0
 rop=r3  #run option to prompt at EOJ for report disposition (vi,cat,more,etc)
 was=a800000m8000   # increase sizes of areas 'a' & 'm'
 # a - each file tabled, then searched  (max 8000 lines of max 100 bytes each)
 # m - pattern/min/max count file table (max 80 lines of max 100 bytes each)
 fild1=?cbl0,typ=DIR,rcs=80
 fili1=xxxxxxx,typ=LST,rcs=512
 fili2=?ctl/cobolxcptn.tbl,typ=LST,rcs=100
 filo3=tmp/$fild1.rpt,typ=LSTt,rcs=128
 # load report header lines into are h for later dump to report file
 lodv1=h0(100)
 Job: $jobname  Dir: dir?  Table: tbl?
 Date: $datetime  Uops: uops?
 ======================================= min41-48  max51-58
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 # - report table will be dumped to report file
 #

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

 @run
 # store instrn optns depending on user optn c1/c2 (see 'rtbo1' at man18 below)
 # - rtbc1/rtbc2 drop # col1 (script cmt) or * col7 (COBOL cmt)
        tsb    o3(1),x'01'              drop # col 1 ?
        skp!   1
        mvc    $iopo1(2),'c1'
        tsb    o3(1),x'02'              drop # col 1 ?
        skp!   1
        mvc    $iopo1(2),'c2'
 #
        opn    fild1                    open directory
        opn    fili2                    open table file of match patterns
        opn    filo3                    open output file for report
 #
 # insert info into report header lines (table h) & write to report file
        repf1  h0(80),'dir?',$fild1
        repf1  h0(80),'tbl?',$fili2
        repf1  h100(80),'uops?',$uops
        wtbe   filo3,h0(100),h0(100)
 #
 # read pattern match file into a memory table & dump to begin report file
        rtbc1  fili2,m0(100),m0(100)    store table of pattern matches
        wtbe   filo3,m0(100),m0(100)    dump to bgin report
        clr    b0(80),'='
        putb   filo3,b0(80)             write separator line to report file
        rtsk1  m0(100),m60(20),'0','0'  clear file totals & grand totals
 #
 #--------------------------------------------------------------------------
 # begin outer loop to read directory for next filename
 # - bypass any sub-directories (get fild1 sets cc < for subdirs)
 man10  get    fild1,d0(80)             get next record (filename) in directory
        skp>   man90
        skp<   man10
        add    $ca1,1                   increment file counter
        mvn    $ca2,0                   clear line cntr for current file
 #
 # create filename by concatenating: dirname + '/' + filename
        clr    f0(80),x'00'
        mvu    f0(80),$fild1,x'00'      move dirname until null reached
        cat    f0(80),$slash            append '/' (or '\' if MSDOS)
        cata8  f0(80),d0(80)            append filename (optn a8 null terms)
        mvc    $fili1,f0                store pathname for open
        opn    fili1
 man18  rtbo1t1 fili1,a0(100),a0(100)   read entire file into table in area 'a'
 # o1 (see $iopsi1 above) = c1/c2 drop # col1 or * col7 + t1=trnslt lower
        mvn    $ca2,$ci1                store line count for later report
        add    $ca3,$ca2                acum total lines all files
 #
 # clear actual counts in pattern table (cols 61-68)
        rtsk1  m0(100),m60(8),'0','0'
 #

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

 # begin loop thru pattern table, searching & counting each pattern
 man20  mvn    $rm,0                 init table rgstr (entry pointer)
 man22  stsg2n999999 a0(100),a0(100),mm0(40)
        add    mm60(8),$ci1          acum matches current pattern, current file
        add    mm70(8),$ci1          acum matches current pattern, all files
        add    $rm,100               up to next entry in pattern table
        cmc    mm0(1),'~'            end pattern table ?
        skp!   man22
 #
 # end pattern table for current file
 # - determine if this file to be reported
 # - depending on min/max spcfd vs actual counted
 man30  mvn    $rm,0                 init table rgstr (entry pointer)
        mvc    f900(1),'*'           presume exception report vs all files optn
 man32  cmn    mm60(8),mm40(8)       actual < min ?
        skp<   man40
        cmn    mm60(8),mm50(8)       actual < max ?
        skp>   man40
        add    $rm,100               up to next entry in pattern table
        cmc    mm0(1),'~'            end pattern table ?
        skp!   man32
 #
 # reached end pattern table with no exceptions
 # - bypass reporting, go close file,& return to get next
 man38  tsb    o1(1),x'01'           report all files ?
        skp!   man60
        mvc    f900(1),' '           clear exception flag
 #
 # report current file
 # file# lines filename  counts(1,2,3,etc)
 # - 1st format counts in work area n (1,2,3,etc)
 man40  mvn    $rm,0                 init table rgstr (entry pointer)
        clr    n0(80),' '            blank work area
 #
 # begin loop to concat each actual count in pattern table
 man42  edta1  g0(8),mm60(8),'z9'    edit current actual count
        cat    g0(8),','             append comma
        cat    n0(80),g0(8)          append count, to collection w/a
        add    $rm,100               up to next entry in pattern table
        cmc    mm0(1),'~'            end pattern table ?
        skp!   man42
 #
 # print stats line for current file
 man50  clr    b0(100),' '           clear line area
        mvn    b0(4),$ca1            file#
        mvn    b5(4),$ca2            lines (from rtb $ci1)
        mvc    b10(1),f900           exception flag * (or blank)
        mvc    b12(30),d0            filename
        mvc    b40(80),n0            counts
        put    filo3,b0              write current file stats to report
 #
 # common point for end current file (reported or not)
 # - close file & return to get next filename from directory
 man60  cls    fili1
        skp    man10
 #

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

 #-------------------------------------------------------------------------
 # write stats msg to report file
 # convert counts to numeric & insert into stats line
 man90  clr    b0(80),'='
        putb   filo3,b0(80)          write separator line before totals
        clr    b0(100),' '           clear print area
        mvfv1  b0(40),'Total files=$ca1, Lines=$ca3, Counts='
        clr    n0(80),' '            clear w/a to concat total counts
        mvn    $rm,0                 init table rgstr (entry pointer)
 #
 # begin loop to concat each total count in pattern table
 man82  edta1  g0(8),mm70(8),'z9'    edit current total count
        cat    g0(8),','             append comma
        cat    n0(80),g0(8)          append count, to collection w/a
        add    $rm,100               up to next entry in pattern table
        cmc    mm0(1),'~'            end pattern table ?
        skp!   man82
        cat    b0(100),n0(80)        concat counts to total files & lines
        put    filo3,b0              print totals
 #
 # close files,& prompt oprtr for report disposition
        cls    all
        eoj
 #Note: option 'rop=r3' causes prompt for file display/view/print

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

8F1. uvcopy pre-programmed jobs to aid JCL conversions

splitjclproc1 - split mixed JCLs & PROCs to separate subdirs

 # splitjclproc1 - split PROCs from JCLs
 #               - by Owen Townsend, May 17/2007
 #               - 1st used for Cyrus Montakab, Software Mining
 #                 (emailed zip file of mixed JCLs & PROCs)
 #
 # uvcopy splitjclproc1,fili1=jclproc0/xxx,filo2=jcl0/xxx,fild3=proc0
 # ==================================================================
 # - 1 file at a time
 #
 # uvcopyxd3 splitjclproc1 jclproc0 jcl0 proc0 uop=q0i7
 # ====================================================
 # - use script uvcopyxd3 to process all files in directory
 #
 #                   ** logic **
 #
 # - input files stored in subdir jclproc0/...
 # - this job will copy jclproc0/... files to jcl0
 #   searching for ' PROC ' on // but not //* line
 # - if found, write reaminder of the file to the 3rd directory
 #   using the NAME from //NAME PROC ... line
 #
 fili1=?infile,typ=LST,rcs=256
 filo2=?outfile,typ=LSTtw2,rcs=256
 fild3=?outdir/procname,typ=DIR,rcs=256
 filo3=xxx,typ=LSTtw2,rcs=256
 @run
         opn    fili1
         opn    filo2
 #

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

 # begin loop to copy input file to jcl output until ' PROC ' found or EOF
 man20   get    fili1,a0               get input from jclproc file
         skp>   man90                  (cc set > at EOF)
         scn    a0(20),' PROC '        PROC ID ?
         skp=   man30
 man26   put    filo2,a0               no - copy to JCL output
         skp    man20                  repeat copy JCL loop
 #
 # PROC found - ensure // but not //*, else continue copy to JCL
 man30   cmc    a0(3),'//*'            PROC on //*comments ?
         skp=   man26
         cmc    a0(2),'//'             valid PROC must have // ?
         skp!   man26
 #
 # create PROC filename from 3rddir/PROCNAME
 man32   clr    c0(300),x'00'          clear a work area
         mvu    c0(20),a2,' '          copy //NAME tilending blank
         mvc    c100(100),$fild3       setup 3rddir
         cata8  c100(100),'/'          + a '/' sep
         cata8  c100(100),c0(20)       + PROCNAME
         mvc    $filo3,c100            store dir/procname
         opne1  filo3                  open PROC output file
         skp=   man40
         msg    'ERR opening PROC output file - should not happen'
         msgw   '- enter to continue copying jclproc input to JCL output
         skp    man26                  continue copying to JCL output
 #
 # copy remainder of input file to the PROC output file
 man40   put    filo3,a0               put to PROC file
         get    fili1,a0               get next input
         skp>   man90                  (cc set > at EOF)
         skp    man40                  repeat loop to copy PROC lines
 #
 # EOF - close files & end job
 man90   cls    all                    close all files
         eoj                           end job

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

8G1. uvcopy pre-programmed jobs to aid JCL conversions

splitcblcpy1 - split mixed COBOL programs & copybooks

 # splitcblcpy1 - split library of mainframe modules
 #           - move COBOL programs & copybooks to separate subdirs
 #             (leave others behind)
 #           - by Owen Townsend, Dec 2009
 # conversions & compiles require COBOL programs & copybooks in separate subdirs
 #
 # uvcopy splitcblcpy1,fild1=indir,fild2=cbls,fild3=cpys
 # ===================================================
 # - reads indir of mixed cbls/cpys to get next filename & opens current file
 # - for each file, scan for 'IDENTIFICATION DIVISION' or ' PIC '
 # - creates 'mv' to move file to cbl/ or cpy/ subdir & executes via 'sys' cmd
 #
 was=b4000000   # allow area 'b' table 40,000 lines of 100 bytes
 fild1=?indir,typ=DIR,rcs=80   # input subdir - mixed cbls & cpys
 fili1=xxxx,typ=LST,rcs=256    # - current file read from input subdir
 fild2=?cbl,typ=DIR,rcs=80     # output subdir for cbls
 fild3=?cpy,typ=DIR,rcs=80     # output subdir for cpys
 #
 # load templates to move cbls to subdir#2 & cpys to subdir#3
 lod=h0(100)
 mv fild1/cblxx fild2/
 mv fild1/cpyxx fild3/
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 # fild1,fild2,fild3 replaced by actual names by 3 'rtsf1' instrns below
 # at man30/man40, template moved to outarea & cblxx/cpyxx replaced by actual
 @run
       opn    fild1                    open input directory
       opn    fild2                    open output dir for cbls
       opn    fild3                    open output dir for cpys
 #
 # at init, insert actual cbls/cpys subdir names in templates
       rtsf1  h0(100),h0(100),'fild1',$fild1
       rtsf1  h0(100),h0(100),'fild2',$fild2
       rtsf1  h0(100),h0(100),'fild3',$fild3
 #
 # begin loop to read input directory for next filename
 man10 get    fild1,a0(80)             get next record (filename) in directory
       skp<   man10                    bypass any subdirs
       skp>   man90                    at EOF go close files & EOJ
 #
 # create dir/file & open current file to get 1st line & test cbls/cpys
       mvc    f0(80),$fild1            directory name
       cata8  f0(80),'/'               append '/'
       cata8  f0(80),a0(30)            append filename
       mvc    $fili1,f0                store filename before open
       opn    fili1                    open file to get stats
       add    $ca0,1                   count input files
 #

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

 # read current file into memory table (to scan all lines for patterns)
 man20 rtb    fili1,b0(100),b0(100)    read entire file into memory
       sts    b0(100),b0(100),'IDENTIFICATION DIVISION'
       skp=   man30
       sts    b0(100),b0(100),'ID DIVISION'
       skp=   man30
       sts    b0(100),b0(100),'PROGRAM-ID'
       skp=   man30
       sts    b0(100),b0(100),'program-id'
       skp=   man30
       sts    b0(100),b0(100),' PIC '
       skp=   man40
       sts    b0(100),b0(100),' pic '
       skp=   man40
       sts    b0(100),b0(100),' PICTURE '
       skp=   man40
       add    $ca1,1                   count non cbls/cpys
       skp    man50
 #
 # move current file to cbls/... subdir
 man30 mvc    c0(100),h0               template to move file to cbls/...
       repf4  c0(100),'cblxx',a0(30)   insert actual filename
       cata8  c0(100),' '              null terminate
       sys    c0(100)                  execute 'mv' for cbls
 #    =====
       add    $ca2,1                   count cbls
       skp    man50                    go close & return for next
 #
 # move current file to cpy/... subdir
 man40 mvc    c0(100),h100             template to move file to cpy/...
       repf4  c0(100),'cpyxx',a0(30)  insert actual filename
       cata8  c0(100),' '              null terminate
       sys    c0(100)                  execute 'mv' for cpys
 #    =====
       add    $ca3,1                   count cpys
       skp    man50                    go close & return for next
 #
 # common point to close current file & return to get next filename
 man50 cls    fili1
       skp    man10
 #
 # EOD - close all dirs/files & end job
 man90 cls    all
       msgv1  '$ca0 total files, $ca2 cbls, $ca3 cpys, $ca1 neither'
       eoj

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

8H1. uvcopy pre-programmed jobs to aid JCL conversions

grepx1 - extract filenames from grep output

 # grepx1 - uvcopy Parameter File from UVSI stored in: /home/uvadm/pf/util/
 # grepx1 - extract filenames from grep output, sort,& data reduce
 #          to 1 line for multiple occurrences in same file
 #        - option to insert 'vi' prior to each filename in output file
 #          OR use editor to insert desired command (vi, cp, mv, rm, etc)
 #
 #Example - mainframe COBOL programs may need changes to 'accept from date'
 #        - mainframe JCL could change date, but unix COBOL always gets sysdate
 #        - see problem discussed at http://www.uvsoftware.ca/vsecobol.htm#3A1
 #
 #    accept run-date from date.      <-- mainframe code
 #    move rundate-mdy6 to run-date.  <-- may need to change some to this
 #
 # 1. grep 'from date' cbls/* >tmp/grepx1a
 #    ====================================
 #    - select lines from all files containing 'from date', output as follows:
 #
 #    cbls/car100.cbl:38:        accept run-date from date.
 #    cbls/car150.cbl:44:        accept run-date from date.
 #    cbls/cpy100.cbl:35:        accept run-date from date.
 #
 # 2. uvcopy grepx1,fili1=tmp/grepx1a,filo1=tmp/grepx1b,uop=c1d1
 #    ==========================================================
 #    - run this job to insert 'vi' prior to each filename & clear remainder
 #    - output as follows:
 #
 #    vi cbls/car100.cbl
 #    vi cbls/car150.cbl
 #    vi cbls/cpy100.cbl
 #
 # 3. vi tmp/grepx1b   <-- could edit to modify (for commands other than 'vi')
 #    ==============
 #
 # 4. ksh tmp/grepx1b  <-- OR execute the output script of 'vi' comamnds
 #    ===============    - may inspect each file in turn & modify if required
 # 4a. /from date      <-- search for 'from date' in current file
 # 4b.  ......           - might need to modify (see Example above)
 # 4c. :wq               - write & quit (script proceeeds to next 'vi file'
 #
 opr='$jobname - extract filenames from grep output, sort,& data reduce'
 opr='uop=q1c1d1 - option defaults'
 opr='      c1   - insert "vi " prior to each filename output'
 opr='        d1 - leave directory path prefix on filenames'
 opr='        d0 - remove directory path prefix from filenames'
 uop=q1c1d1
 fili1=?tmp/grepx1a,rcs=256,typ=LST
 filo1=?tmp/grepx1b,rcs=256,typ=LSTt

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

 @run
 # open the files & open the sort (define rcsz & sort-key)
        opn     all                    open files
        sxo     80,'0(40)'             open the sort rcs=80, key=40
 # begin loop to read the grep file & reformat/write until EOF
 # - retain only the filename (blank out from the ':' separator)
 #   & put records to the sort (internal sort in uvcopy)
 man20  get     fili1,a1(256)           get next record
        skp>    man30                  (cc set > at EOF)
        scn     a1(80),':'             scan to the ':' separator
        clr     ax1(160),' '           clear from ':' to EOL
        mvn     $rx,0                  clear rgstr x in case no strip option
        cmn     $uopbd,0               strip directory prefix ?
        skp!    1
        scnr    a0(80),'/'             scan from right to any '/'
        sxp     ax1(80)                put to the sort
        skp     man20                  return to get next grep record
 #
 # sort the file of reformatted grep records
 #-----------------------------------------------------------------
 man30  sxs                            sort reformatted grep records
 #-----------------------------------------------------------------
 # read the sorted records & data reduce to 1 line per unique filename
        sxg     b0(80)                 get 1st rec from sort
        skp>    man90                  (should not happen ??)
 #
 # begin loop to write 1 output record for each group of recs for same filename
 man40  mvc     c0(80),b0              store record for ctl brk tests
        tsb     o3(1),x'01'            option to insert vi command ?
        skp!    man46
        ins     c0(80),'vi '
 man46  put     filo1,c0(80)           write out 1st record of each group
 #
 # begin loop to bypass any duplicate recs for same filename
 man50  sxg     b0(80)                 get next record
        skp>    man90                  (cc > at EOF)
        cmc     b0(40),c0              same filename as previous ?
        skp=    man50                  yes - bypass/get next
        skp     man40                  no  - return to write out
 #
 # End of sorted records - close report file & end job
 man90  cls     all
        eoj

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

Part_9. CNVaids.doc Vancouver Utility Conversion Aids

Tips for users new to Unix/Linux - Contents


9A1. 'vi' editor tutorial for users new to unix/linux
- the essential commands to get you started

9B1. Work in your working directory & address files thru subdirs
- working directories should have subdirs only
- all files are in subdirs (see cleandir1 script '9C1'

9B2. setup a 'tmp/' subdir in your working directories
- to keep your working directory clean (no files, subdirs only)

9B3. File Naming Conventions
 Append a digit (1,2,3,etc) on the end of filenames (customer1,sales1,etc)
- makes filenames 'unique' & easy to find with vi, grep, find, etc.
- makes it easy to create names for related files (customer2,sales2,etc)
 Misspell filenames Intentionally for same reason as appending a digit.
- for example: 'tmp' vs 'temp', 'wrk' vs 'work', etc.
 Common prefixes to identify related files
- for example prefix 'uv' makes it easy to find Vancouver Utilities
  (uvcopy,uvsort,uvlist,uvqrpg,uvhd,etc)

9C1. script 'cleandir1' to move any files in working directory to a subdir

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

9A1. CNVaids: Tips for new users to Unix/Linux

'vi' tutorial

'vi' 2 modes of operation - COMMAND or INSERT

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

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

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

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

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

starting 'vi' to edit a file


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

CURSOR MOVEMENT

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

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

9A2. CNVaids: Tips for new users to Unix/Linux

INSERT text (ESCAPE to end insert)

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

DELETE commands

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

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

COPY lines (YANK & PUT)

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

MOVE lines (DELETE & PUT)

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

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

9A3. CNVaids: Tips for new users to Unix/Linux

search commands

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

substitution commands

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

Global command - to delete, etc

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

miscellaneous commands

u
  • undo the last change command
U
  • Undo all changes to the current line (since cursor move to it)
 .  - repeat the previous change command
J
  • Join line below cursor onto current line
 :r file2 - read a file into the workspace
            (following the line with the cursor)

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

9A4. CNVaids: Tips for new users to Unix/Linux

mark command

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

WRITE & QUIT

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

:wq - write & quit

ZZ
  • write & quit (same as :wq)

:q! - quit without writing

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

vim Reference


 http://linuxgazette.net/152/srinivasan.html
 =============================================

This is an excellent tutorial on 'vim', which is an enhanced version of 'vi', used on most Linux systems.

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

9B1. CNVaids: Tips for new users to Unix/Linux

tip#1 - stay in your 'working directory'

Your working directory should contain only subdirectories, and all files should reside within sub-directories. In the following example, your working directory should be 'testlibs'

 /p1
 :-----testlibs         <-- working directory
 :     :-----cbl0         - COBOL source from mainframe
 :     :-----cbls         - COBOL converted for Micro Focus
 :     :-----cblx         - compile output (.int .idy .cbl .err)
 :     :-----cpys         - COBOL copybooks
 :     :-----jcl0         - JCL from mainframe
 :     :-----jcls         - JCL converted to Unix/Linux scripts

You should work 1 level above your files & address your files through a sub- directory. In the example above, you would edit your programs as follows:

 cd /p1/testlibs        <-- change to working directory
 cdl                    <-- alias 'cdl' changes to $RUNLIBS (defined in profile)

 vi cbls/apay100.cbl    <-- address program thru subdir
 ===================

advantages of working above subdirs

  1. Helps maintain a clean well organized workplace - Since all files are in subdirs, you can probably list all your subdirs on 1 screen, which reminds you of your subdir organization.

  2. Protects your files, even the infamous 'rm *' would do no harm at the working directory level, since all files are in subdirs.

  3. Garbage files (accidentally created) are highlighted & can be easily removed or moved to their proper subdir. When you list your subdirs, any files (non-subdirs) will stick out like a sore thumb.

  4. Subdirs allow you to maintain the same filename for data & programs in the various stages of conversion, or archiving, etc.

  5. Many operations require addressing multiple files in multiple subdirs and it is then best to work 1 level above the subdirs. For example:

    mfcbl1 car100.cbl        <-- compile 1 COBOL program
    =================          - script assumes program is in subdir 'cbls'

    cnvMF41 cbl0/CAR100.cbl  <-- convert program from cbl0->cbl1->cbl2->cbls
    =======================    - script assumes cbl1,cbl2,cbls are below you

    jcl2ksh41 jcl0/JAR100.jcl  <-- convert JCL from jcl0->jcl1->jcl2->jcl3->jcls
    ========================= - script assumes jcl1,jcl2,jcl3,jcls are below you

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

9B1a. Tips for new users to Unix/Linux

example - editing & compiling programs

Normally you will only edit 1 program at a time because you will usually then compile the program & the compile script must run above the subdirs because it needs to reference source, copybooks,& compiled libraries.

It makes no sense to change into the subdir, edit 1 program,& then change back to compile the program. That would use 4 commands vs only 2 commands when you work above the subdirs.

working IN subdirs - WRONG


 #1. cd cbls                 <-- change into subdir
     =======

 #2. vi car100.cbl           <-- edit program (specify just filename)
     =============               (but overall less efficient)

 #3. cd ..                   <-- change back out (to compile program)
     =====

 #4. mfcbl1 car100.cbl       <-- compile program
     =================

working above subdirs - RIGHT


 #1. vi cbls/car100.cbl      <-- edit program (specify subdir/filename)
     ==================          (but overall more efficient)

 #2. mfcbl1 car100.cbl       <-- compile program
     =================

When you move onto the next program, your keystrokes are minimized by using your shell history & changing only the program name.


 #3. vi cbls/car200.cbl      <-- edit 2nd program
     ==================
 #4. mfcbl1 car200.cbl       <-- compile 2nd program
     =================

Exception to the Rule

When you have extensive editing to do on multiple files in the same subdir, of course you would change into the directory, do the edits,& change back.

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

9B2. CNVaids: Tips for new users to Unix/Linux

tip#2 - setup 'tmp' sub-dir in your working directory

I recommend setting up a 'tmp' subdirectory in your various working directories, and use it for any temporary files, rather than clutter up your working directory (keep your working directory clean, subdirs only).

examples of using 'tmp' subdir

  1. Use 'tmp' whenever you want to redirect output to a temporary file so that you can then use the editor to explore the output. For example we might use 'grep' to find all programs using upsi as follows:

 #1a. grep 'UPSI' cbls/* >tmp/upsi    <-- extract lines with UPSI

 #1b. vi tmp/upsi                     <-- review results with editor

 #1c. uvlp12 tmp/upsi                 <-- print results
  1. Editing parts of programs & JCL/scripts into other programs/scripts For example, to copy a paragraph from 1 apay100.cbl to apay200.cbl:

 #2a. vi cbls/apay100.cbl       - edit program apay100.cbl
        ma                     - mark start of desired paragraph (mark 'a')
        mb                     - mark end of desired paragraph   (mark 'b')
        :'a,'b w tmp/chkdigit  - write paragraph out to tmp subdir
                                 (from mark 'a' to mark 'b')
        :q                     - quit edit apay100

 #2b. vi cbls/apay200.cbl       - edit program apay200.cbl
        --                     - move to desired point
        :r tmp/chkdigit        - read paragraph into apay200.cbl
        :wq                    - write/quit apay200

Don't confuse our 'tmp' subdir with /tmp which is a system wide directory.

 /tmp                      - system temporary directory
 /home/joe/tmp             - Joe's temporary directory
 /p1/testlibs/tmp          - temp subdir for apay libraries

You would clean out your 'tmp' subdir at least once a day, or you could setup a 'crontab' to do this automatically.

If multiple programmers working in shared directory (such as /home/testlibs) & desire their own tmp subdir, I suggest they append their initials (tmpaa, tmpbb, etc). Cron job can still clean out via 'rm tmp*/*'.

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

9B3. CNVaids: Tips for new users to Unix/Linux

File Naming Conventions

It is a good idea to append a digit (1,2,3,etc) on the end of filenames. For example: 'customer1', 'sales1', etc. This provides several long lasting advantages thru out the life of our applications:

  1. It makes our file & table names 'unique' & avoids confusion with other similar names.

  2. We can reliably use 'grep' & 'find' to search for all instances of a desired file/table name in all our directories.

  3. We can use 'vi' to '/' search for all instances of a desired file/table name when editing our scripts & programs.

  4. It makes it easy to create names for related files/tables. 'customer2' or 'sales2' might be a variant, save, or backup copy. Or we might use 'customer1a', 'sales1a', etc.

    Misspell filenames Intentionally

It is a good idea to intentionally misspell filenames for the same reasons as explained above (appending a digit (1,2,3) on the end of filenames). Misspelling also makes them unique & easy to find with vi,grep,find,etc. For example 'tmp' vs 'temp', 'wrk' vs 'work', etc.

common prefixes to identify related files

Common prefixes make it easy to find related files with 1 command. For example if I wanted to find all instances where my utilities are called in the scripts directory: ('uv' is common to uvcopy,uvsort,uvlist,uvqrpg,uvhd,etc).


 grep 'uv' scripts/*
 ===================

 grep 'uv' sf/*/*  (uvadm scripts are sf/adm/* sf/demo/* sf/util/* sf/IBM/*)
 ================

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

9C1. CNVaids: Tips for new users to Unix/Linux

cleandir1 - move files from workdir to subdir

To cleanup an existing working directory with a lot of mixed files & subdirs, you should find the 'cleandir1' script handy. You can then setup various subdirs & move the files to the apporpriate subdir.


 #1. cd workdir??
     ============

 #2. mkdir cleanup090812    <-- make subdir to receive files
     ===================

 #3. mv cleanup090812/... subdirxx  <-- move desired files to desired subdirs
     =============================
 # cleandir1 - cleanup current directory by moving files to subdir
 #           - by Owen Townsend, UV Software, Aug 12/2009
 #           - we recommend no files in working directory
 #           - all files should be stored in appropriate subdirs
 #
 d=$1
 if [[ ! -d "$d" ]]; then
    echo "usage: cleandir1 subdir  <-- arg1 must be a directory"
    echo "       ================"
    echo "       cleandir1 cleanup090812 <-- example"
    echo "       ======================="
    exit 99; fi
 #
 x=0
 for f in *
   { if [[ -f $f ]]; then
        echo "moving $f to $d"
        mv $f $d
        ((x=x+1))
     fi
   }
 echo "$x files moved to $d"
 exit 0

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 

4F2 .exts: tblexts2 - summarize .exts in all files in a tree

2F2 A0b0c0d3e1f2j1: results AFTER options a0b0c0d3e1f2j1 + c0d3e1
2F2 A0b0c0d3e1f2j1: results AFTER options a0b0c0d3e1f2j1 + c2d3e1
2F1 A0b80c0d0e0f2j1: results AFTER default options a0b80c0d0e0f2j1
8B1 Accumulate: acum1 - accumulate any 1 field in a datafile
8B1 Acum1: - accumulate any 1 field in a datafile
8B2 Acum1: - operating instructions
8B2 Acum1: sample report from acum1
1L1 Admjobs.doc: 1K1. Unix/Linux aids documented in ADMjobs.doc
1L1 Admjobs.doc: Vital Unix/Linux aids documented in ADMjobs.doc
5E1 Advantages: of this animation method
9B1 Advantages: of working above subdirs
1L1 Aids: 1K1. Unix/Linux aids documented in ADMjobs.doc
1L1 Aids: Vital Unix/Linux aids documented in ADMjobs.doc
1B1 Aliases: Recommended Aliases in profiles
1B1 Aliases: cd aliases to RUNDATA, RUNLIBS,& CNVDATA
1B2 Aliases: for 'mvstest' RUNDATA & RUNLIBS
1G1 Alldiff: diff & alldiff - marvelous utilities
1G2 Alldiff: script
5E1 Animating: Animating MicroFocus COBOL on Unix/Linux
5E1 Animation: ANIMATION operating instructions
5E1 Animation: advantages of this animation method
1K1 Ascii: dd example #2 - translate EBCDIC to ASCII
3A1 Available: Cross-Ref Reports Available

1J1 Backups: Vancouver Utility Backups & crontabs
7B3 Bad: creating BAD data
7G1 Based: gentest1 - generate test data files based on COBOL copybooks
2E1 Binary: verifytext - scan files in subdir for binary data
7J3 Blank: uvlist as a filter - compress blank lines & spaces

2F2 C0d3e1: results AFTER options a0b0c0d3e1f2j1 + c0d3e1
2F2 C2d3e1: results AFTER options a0b0c0d3e1f2j1 + c2d3e1
4F1 Calc: tblexts1 to calc compile failure %
3C2 Called-program: xcobcall2 - crossref all Programs calling any 1 Called-Program
3C2 Called-programs: xcobcall1 - list of all Called-Programs in each Program
3C2 Calling: xcobcall2 - crossref all Programs calling any 1 Called-Program
6B1 Capture: joblog1,2,3 - capture logs via 'tee'
8E3 Certain: scan JCL for certain programs
1F1 Cfl: - Count Files & Lines in a directory
7G3 Citytax1: Op-Instrns for citytax1 demo file
7G4 Citytax1: output from citytax1 demo file
9C1 Cleandir1: - move files from workdir to subdir
2D1 Cleanup: - source code maintenance utility
2D2 Cleanup: demo - for COBOL programs
2D2 Cleanup: demo - sample INPUT
2D2 Cleanup: demo - sample OUTPUT
7E1 Cmpjobs.doc: CMPjobs.doc - Data File Compare
1B1 Cnvdata: cd aliases to RUNDATA, RUNLIBS,& CNVDATA
5C1 Cobfil51: vs cobfiles5A
5C1 Cobfiles5a: cobfil51 vs cobfiles5A
5C1 Cobfiles5a: cobfiles5A - recommended alternative
5D1 Cobmap: Output cobmap - maps/custmas
5D2 Cobmap: generating 'cobmap's for ALL copybooks in directory
5D1 Cobmap1: 'cobmap1' - generate record layouts from COBOL copybooks
5D1 Cobmap1: Operating Instructions
2D2 Cobol: cleanup demo - for COBOL programs
3A1 Cobol: Cross References for COBOL & JCL/scripts
3C1 Cobol: COBOL Cross-Ref Sample Reports
4B3 Cobol: statcbl11 - COBOL stat report samples
4D3 Cobol: table3d - table summary for text files (JCL,COBOL,etc)
5A1 Cobol: COBOL Cross-References
5B2 Cobol: statcbl11 - COBOL stat report samples
5C1 Cobol: COBOL Files Report
5C2 Cobol: sample COBOL files report
5D1 Cobol: 'cobmap1' - generate record layouts from COBOL copybooks
5E1 Cobol: Animating MicroFocus COBOL on Unix/Linux
5F1 Cobol: Micro Focus COBOL - File Status Codes
5F2 Cobol: Micro Focus COBOL - Run-time Error Codes
5F3 Cobol: Micro Focus COBOL - Run-time Error Messages
7B1 Cobol: uvhdcob - display data file fields with COBOL fieldnames
7C3 Cobol: Alternative - modify the COBOL program
7G1 Cobol: gentest1 - generate test data files based on COBOL copybooks
8G1 Cobol: splitcblcpy1 - split mixed COBOL programs & copybooks
4D2 Coding: statlogin1 - uvcopy coding
7J2 Column: option 'y' for column scale headings
2B1 Command: listall - sample command & output
7B1 Command: 'v' verify data command
7B2 Command: response to search/verify command
7B2 Command: test/demo verify command
7U1 Command: uxcp command to convert file
8D2 Command: notes re command line options
9A1 Command: 'vi' 2 modes of operation - COMMAND or INSERT
9A3 Command: Global command - to delete, etc
9A4 Command: mark command
9A2 Commands: DELETE commands
9A3 Commands: miscellaneous commands
9A3 Commands: search commands
9A3 Commands: substitution commands
7C2 Common: problem when files FTP'd from mainframe
9B3 Common: prefixes to identify related files
7E1 Compare: CMPjobs.doc - Data File Compare
4F1 Compile: tblexts1 to calc compile failure %
9B1 Compiling: example - editing & compiling programs
7J3 Compress: uvlist as a filter - compress blank lines & spaces
4D2 Console: table2 demo - console display
7F1 Console: log
7G3 Console: displays for option changes
8B2 Console: log (option prompts)
8D1 Console: log - options prompt
2C1 Control: spreadA - list files 4-up for doc & control
2C2 Control: spreadA - list files 4-up for doc & control
9B3 Conventions: File Naming Conventions
9A2 Copy: COPY lines (YANK & PUT)
3C1 Copybook: xcobcopy2 - crossref all PROGRAMS using any 1 COPYBOOK
3C1 Copybooks: xcobcopy1 - list all COPYBOOKS in any 1 PROGRAM
5D1 Copybooks: 'cobmap1' - generate record layouts from COBOL copybooks
5D2 Copybooks: generating 'cobmap's for ALL copybooks in directory
7G1 Copybooks: gentest1 - generate test data files based on COBOL copybooks
8G1 Copybooks: splitcblcpy1 - split mixed COBOL programs & copybooks
1F1 Count: cfl - Count Files & Lines in a directory
1F2 Counts: statdir1 - report file counts & KB used in a Parent dir
4F1 Counts: tblexts1 - table summary counts by file extensions
1J1 Crontabs: Vancouver Utility Backups & crontabs
3A1 Cross: Cross References for COBOL & JCL/scripts
3A1 Cross-ref: Cross-Ref Reports Available
3B2 Cross-ref: Op. Instrns. - Cross-Ref 1 at a time
3C1 Cross-ref: COBOL Cross-Ref Sample Reports
3C3 Cross-ref: xcobfile2 - cross-ref programs using each filename
3A1 Cross-references: more Cross-References
5A1 Cross-references: COBOL Cross-References
3B1 Cross-refs: generating ALL Cross-Refs reports
3C1 Crossref: xcobcopy2 - crossref all PROGRAMS using any 1 COPYBOOK
3C2 Crossref: xcobcall2 - crossref all Programs calling any 1 Called-Program
3C4 Crossref: xcobsql2 crossref all Programs using any 1 SQL Include
3D2 Crossref: xkshfile2 - crossref all ksh SCRIPTs using any 1 DATAFILE
3E2 Crossref: xkshprog2 - crossref all ksh SCRIPTS executing any 1 PROGRAM
3F1 Crossref: 3F2. xkshproc2 - crossref ksh SCRIPTS executing any 1 PROC
3G1 Crossref: 3G2. xkshparm2 - crossref ksh SCRIPTS executing any 1 PARM
9A1 Cursor: CURSOR MOVEMENT
5D1 Custmas: Output cobmap - maps/custmas
7D1 Custmas1: demo#2 - using custmas1 with packed fields
8C1 Customer: master sales report

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 

7C1 Dat1: sample text file dat1/products
7E1 Dat1: dat1/warmas1a - Alternate test file#2 with differences
7E1 Dat1: test file#1 /home/uvadm/dat1/warmas1
1K1 Data: dd - Unix/Linux Data utility
2E1 Data: verifytext - scan files in subdir for binary data
7A1 Data: uvhd - display DATA files in Vertical Hexadecimal
7B1 Data: 'v' verify data command
7B1 Data: uvhdcob - display data file fields with COBOL fieldnames
7B3 Data: creating BAD data
7E1 Data: CMPjobs.doc - Data File Compare
7G1 Data: gentest1 - generate test data files based on COBOL copybooks
7H1 Data: Data File VTOC Report
7U1 Data: uxcp - complex Data File Conversions
8A1 Data: uvcopy - powerful data manipulation
3D2 Datafile: xkshfile2 - crossref all ksh SCRIPTs using any 1 DATAFILE
8B1 Datafile: acum1 - accumulate any 1 field in a datafile
3D1 Datafiles: xkshfile1 - list all DATAFILES used in any 1 ksh SCRIPT
1K1 Dd2ascii: script 'dd2ascii' to translate all files in subdir
2F1 Default: results AFTER default options a0b80c0d0e0f2j1
9A2 Delete: DELETE commands
9A2 Delete: MOVE lines (DELETE & PUT)
9A3 Delete: Global command - to delete, etc
2D2 Demo: cleanup demo - for COBOL programs
2D2 Demo: cleanup demo - sample INPUT
2D2 Demo: cleanup demo - sample OUTPUT
4D1 Demo: input file - 1st 3 of 20 records
4D2 Demo: table2 demo - console display
7B2 Demo: test/demo verify command
7D1 Demo: using uvcpF2L
7D1 Demo: demo#2 - using custmas1 with packed fields
7E2 Demo: uvcmp1 demo#1 - Operating Instructions
7E3 Demo: uvcmp1 demo#1 - sample report
7G3 Demo: Op-Instrns for citytax1 demo file
7G4 Demo: output from citytax1 demo file
8D1 Depending: selectf1 - select records depending on field value
7J1 Description: uvlist - Program Description
7U1 Desired: Output file on Unix/Linux
1G1 Diff: & alldiff - marvelous utilities
7E1 Differences: dat1/warmas1a - Alternate test file#2 with differences
1F2 Dir: statdir1 - report file counts & KB used in a Parent dir
1D1 Directory: dtree - draw directory tree
1F1 Directory: cfl - Count Files & Lines in a directory
2A2 Directory: Listing ALL files in a directory
2A2 Directory: list 1st page only of all files in directory
2B1 Directory: listall - List All (small) Files in Directory
5D2 Directory: generating 'cobmap's for ALL copybooks in directory
7G5 Directory: Op-Instns for all files in directory
8E1 Directory: scan5d - search directory for exception files
8E4 Directory: scan5d - search directory for exception files
9B1 Directory: tip#1 - stay in your 'working directory'
9B2 Directory: tip#2 - setup 'tmp' sub-dir in your working directory
1E1 Display: llr - display all files in multilevel subdirs
4D2 Display: table2 demo - console display
6D1 Display: Sample Op Instrns - display latest gen file
6D1 Display: lastgenr - display last generation file
6E1 Display: getEtime - display 'job times' for last run of any JCL/script
7A1 Display: uvhd - display DATA files in Vertical Hexadecimal
7B1 Display: uvhdcob - display data file fields with COBOL fieldnames
7B1 Display: uvhdcob - sample display
7G3 Displays: console displays for option changes
2C1 Doc: spreadA - list files 4-up for doc & control
2C2 Doc: spreadA - list files 4-up for doc & control
1L1 Documented: 1K1. Unix/Linux aids documented in ADMjobs.doc
1L1 Documented: Vital Unix/Linux aids documented in ADMjobs.doc
1I1 Dos2unix: & unix2dos
1D1 Draw: dtree - draw directory tree
2F1 Drop: example - grep for EXEC & drop duplicates from result
7C3 Drop: uvcp to drop CR/LF (convert text to fixed)
1D1 Dtree: - draw directory tree
2F1 Duplicates: example - grep for EXEC & drop duplicates from result

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 

7B4 Easier: uvhdc - script for easier use of uvhdcob
7D1 Easier: scripts to make uvcp easier to use
1K1 Ebcdic: dd example #2 - translate EBCDIC to ASCII
9A1 Edit: starting 'vi' to edit a file
9B1 Editing: example - editing & compiling programs
1A1 Env: 'profiles' provided in /home/uvadm/env
5F2 Error: Micro Focus COBOL - Run-time Error Codes
5F3 Error: Micro Focus COBOL - Run-time Error Messages
9A2 Escape: INSERT text (ESCAPE to end insert)
1H1 Example: - grep for EXEC in all JCL
1K1 Example: dd example #1 - create a smaller test file
1K1 Example: dd example #2 - translate EBCDIC to ASCII
2F1 Example: - grep for EXEC & drop duplicates from result
6B1 Example: using joblog2
7I1 Example: - sort sequential & load Indexed
9B1 Example: - editing & compiling programs
1I1 Examples:
9B2 Examples: of using 'tmp' subdir
8E1 Exception: sample exception report
8E1 Exception: scan5d - search directory for exception files
8E4 Exception: scan5d - search directory for exception files
9B1 Exception: Exception to the Rule
1H1 Exec: example - grep for EXEC in all JCL
2F1 Exec: example - grep for EXEC & drop duplicates from result
3E1 Executed: xkshprog1 - list all PROGRAMs executed in any 1 ksh SCRIPT
3F1 Executed: xkshproc1 - list all PROCs executed in any 1 ksh SCRIPT
3E2 Executing: xkshprog2 - crossref all ksh SCRIPTS executing any 1 PROGRAM
3F1 Executing: 3F2. xkshproc2 - crossref ksh SCRIPTS executing any 1 PROC
3G1 Executing: 3G2. xkshparm2 - crossref ksh SCRIPTS executing any 1 PARM
4F1 Extensions: tblexts1 - table summary counts by file extensions
8H1 Extract: grepx1 - extract filenames from grep output

4F1 Failure: tblexts1 to calc compile failure %
4D2 Field: table2 - OPTIONS (for Fixed Field files)
8B1 Field: acum1 - accumulate any 1 field in a datafile
8D1 Field: selectf1 - select records depending on field value
7B1 Fieldnames: uvhdcob - display data file fields with COBOL fieldnames
4D1 Fields: table2 - Table Summaries for Fixed Length Fields
7B1 Fields: uvhdcob - display data file fields with COBOL fieldnames
7D1 Fields: demo#2 - using custmas1 with packed fields
3C3 Filename: xcobfile2 - cross-ref programs using each filename
8H1 Filenames: grepx1 - extract filenames from grep output
9B3 Filenames: Misspell filenames Intentionally
7J3 Filter: uvlist as a filter - compress blank lines & spaces
4D1 Fixed: table2 - Table Summaries for Fixed Length Fields
4D2 Fixed: table2 - OPTIONS (for Fixed Field files)
7C1 Fixed: using uvcp to convert 'text' to 'fixed'
7C3 Fixed: uvcp to drop CR/LF (convert text to fixed)
7C4 Fixed: using 'uvcp' to convert 'fixed' to 'text'
7F1 Fixed: listrec2 - list fixed length records
7F2 Fixed: listhex2 - list fixed length records in hexadecimal
5F1 Focus: Micro Focus COBOL - File Status Codes
5F2 Focus: Micro Focus COBOL - Run-time Error Codes
5F3 Focus: Micro Focus COBOL - Run-time Error Messages
7U1 Format: mainframe file in RDW format for FTP
7C2 Ftp: common problem when files FTP'd from mainframe
7U1 Ftp: mainframe file in RDW format for FTP

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 

6D1 Gen: Sample Op Instrns - display latest gen file
5D1 Generate: 'cobmap1' - generate record layouts from COBOL copybooks
6A2 Generate: Op. Instrns to generate JobFlow Reports
6A2 Generate: jobflow51 - generate jobflow report for 1 JCL/script
7G1 Generate: gentest1 - generate test data files based on COBOL copybooks
3B1 Generating: ALL Cross-Refs reports
5D2 Generating: 'cobmap's for ALL copybooks in directory
6D1 Generation: lastgenr - display last generation file
7G1 Gentest1: - generate test data files based on COBOL copybooks
7G2 Gentest1: - sample input
7G5 Gentest1: uvcopy code for gentest1
7G5 Gentesta: 'gentestA' script
6E1 Getetime: getEtime - display 'job times' for last run of any JCL/script
9A3 Global: Global command - to delete, etc
1H1 Grep: example - grep for EXEC in all JCL
1H1 Grep: - search for patterns in files
1H1 Grep: results
2F1 Grep: example - grep for EXEC & drop duplicates from result
2F1 Grep: grepsum1 - summarize grep search results
2G1 Grep: scan/replace jobs more powerful than grep & sed
8H1 Grep: grepx1 - extract filenames from grep output
2F1 Grepsum1: - summarize grep search results
2F2 Grepsum1: modify grepsum1 options to improve results
8H1 Grepx1: - extract filenames from grep output

7J2 Headings: option 'y' for column scale headings
7A1 Hexadecimal: uvhd - display DATA files in Vertical Hexadecimal
7F2 Hexadecimal: listhex2 - list fixed length records in hexadecimal
4D3 Hlqs: sample report - summary of HLQs in all JCL
1A1 Home: 'profiles' provided in /home/uvadm/env
7E1 Home: test file#1 /home/uvadm/dat1/warmas1
6C1 Homedir: setup 'testdata' in Your homedir ?

9B3 Identify: common prefixes to identify related files
2F2 Improve: modify grepsum1 options to improve results
3C4 Include: xcobsql2 crossref all Programs using any 1 SQL Include
3C4 Includes: xcobsql1 list all SQL Includes in any 1 Program
7I1 Indexed: example - sort sequential & load Indexed
9A1 Insert: 'vi' 2 modes of operation - COMMAND or INSERT
9A2 Insert: INSERT text (ESCAPE to end insert)
9A2 Insert: INSERT text (ESCAPE to end insert)
4D3 Instrns: Op. Instrns to create top-node summary table
6A2 Instrns: Op. Instrns to generate JobFlow Reports
6D1 Instrns: Sample Op Instrns - display latest gen file
3B2 Instrns.: Op. Instrns. - Cross-Ref 1 at a time
8E2 Instrns.: Op. Instrns. for scan5d
2C1 Instructions: spreadA - Operating Instructions
2E1 Instructions: verifytext - Operating Instructions
2G1 Instructions: Operating Instructions
3B1 Instructions: Operating Instructions
4A1 Instructions: statallmvs1/statallvse1 - Operating Instructions
4D1 Instructions: Operating Instructions
4F1 Instructions: Operating Instructions
5B1 Instructions: statallmvs1/statallvse1 - Operating Instructions
5D1 Instructions: cobmap1 Operating Instructions
5E1 Instructions: ANIMATION operating instructions
7E2 Instructions: uvcmp1 demo#1 - Operating Instructions
8B2 Instructions: acum1 - operating instructions
9B3 Intentionally: Misspell filenames Intentionally

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 

6A1 Job-flow: Job-Flow reports
6A1 Jobflow: JobFlow sample report
6A2 Jobflow: Op. Instrns to generate JobFlow Reports
6A2 Jobflow: jobflow51 - generate jobflow report for 1 JCL/script
6A2 Jobflow51: - generate jobflow report for 1 JCL/script
6A2 Jobflow51: jobflow5A - must run 1st before jobflow51
6A2 Jobflow5a: jobflow5A - must run 1st before jobflow51
6B1 Joblog: 3 versions of joblog script
6B1 Joblog1: joblog1,2,3 - capture logs via 'tee'
6B1 Joblog2: example using joblog2

3D1 Ksh: xkshfile1 - list all DATAFILES used in any 1 ksh SCRIPT
3D2 Ksh: xkshfile2 - crossref all ksh SCRIPTs using any 1 DATAFILE
3E1 Ksh: xkshprog1 - list all PROGRAMs executed in any 1 ksh SCRIPT
3E2 Ksh: xkshprog2 - crossref all ksh SCRIPTS executing any 1 PROGRAM
3F1 Ksh: 3F2. xkshproc2 - crossref ksh SCRIPTS executing any 1 PROC
3F1 Ksh: xkshproc1 - list all PROCs executed in any 1 ksh SCRIPT
3G1 Ksh: 3G2. xkshparm2 - crossref ksh SCRIPTS executing any 1 PARM
3G1 Ksh: xkshparm1 - list all SYSIN/PARMs referenced in any 1 ksh SCRIPT

2A1 Laser: 'uvlp__' scripts for Laser printers
6D1 Lastgenf: Alternate script 'lastgenf'
6D1 Lastgenr: Rules for using lastgenr
6D1 Lastgenr: - display last generation file
5D1 Layouts: 'cobmap1' - generate record layouts from COBOL copybooks
8D2 Line: notes re command line options
1K1 Linux: dd - Unix/Linux Data utility
1L1 Linux: 1K1. Unix/Linux aids documented in ADMjobs.doc
1L1 Linux: Vital Unix/Linux aids documented in ADMjobs.doc
2A2 Linux: uvlp13LD - print Mainframe reports on Unix/Linux
5E1 Linux: Animating MicroFocus COBOL on Unix/Linux
7U1 Linux: desired Output file on Unix/Linux
2A2 List: 1st page only of all files in directory
2B1 List: listall - List All (small) Files in Directory
2C1 List: spreadA - list files 4-up for doc & control
2C2 List: spreadA - list files 4-up for doc & control
3C1 List: xcobcopy1 - list all COPYBOOKS in any 1 PROGRAM
3C2 List: xcobcall1 - list of all Called-Programs in each Program
3C4 List: xcobsql1 list all SQL Includes in any 1 Program
3D1 List: xkshfile1 - list all DATAFILES used in any 1 ksh SCRIPT
3E1 List: xkshprog1 - list all PROGRAMs executed in any 1 ksh SCRIPT
3F1 List: xkshproc1 - list all PROCs executed in any 1 ksh SCRIPT
3G1 List: xkshparm1 - list all SYSIN/PARMs referenced in any 1 ksh SCRIPT
7F1 List: listrec2 - list fixed length records
7F2 List: listhex2 - list fixed length records in hexadecimal
2B1 Listall: - List All (small) Files in Directory
2B1 Listall: - sample command & output
7F2 Listhex2: - list fixed length records in hexadecimal
2A2 Listing: Listing ALL files in a directory
7F1 Listrec2: - list fixed length records
1E1 Llr: - display all files in multilevel subdirs
1E1 Llr: sample llr of TESTDATA after running 1 job
7I1 Load: example - sort sequential & load Indexed
4C1 Log: sample input /var/log/messages
7F1 Log: console log
8B2 Log: console log (option prompts)
8D1 Log: console log - options prompt
4C1 Logins: statlogin1 - table summary user logins by month & userid
6B1 Logs: joblog1,2,3 - capture logs via 'tee'

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 

2A2 Mainframe: uvlp13LD - print Mainframe reports on Unix/Linux
4B1 Mainframe: statmvsjcl1 - mainframe JCL stat report samples
7C2 Mainframe: common problem when files FTP'd from mainframe
7U1 Mainframe: file in RDW format for FTP
2D1 Maintenance: cleanup - source code maintenance utility
8A1 Manipulation: uvcopy - powerful data manipulation
5D1 Maps: Output cobmap - maps/custmas
9A4 Mark: command
1G1 Marvelous: diff & alldiff - marvelous utilities
8C1 Master: customer master sales report
4C1 Messages: sample input /var/log/messages
5F3 Messages: Micro Focus COBOL - Run-time Error Messages
5E1 Method: advantages of this animation method
5F1 Micro: Micro Focus COBOL - File Status Codes
5F2 Micro: Micro Focus COBOL - Run-time Error Codes
5F3 Micro: Micro Focus COBOL - Run-time Error Messages
5E1 Microfocus: Animating MicroFocus COBOL on Unix/Linux
9A3 Miscellaneous: commands
9B3 Misspell: Misspell filenames Intentionally
8F1 Mixed: splitjclproc1 - split mixed JCLs & PROCs to separate subdirs
8G1 Mixed: splitcblcpy1 - split mixed COBOL programs & copybooks
9A1 Modes: 'vi' 2 modes of operation - COMMAND or INSERT
2F2 Modify: grepsum1 options to improve results
7C3 Modify: Alternative - modify the COBOL program
4C1 Month: statlogin1 - table summary user logins by month & userid
9A2 Move: MOVE lines (DELETE & PUT)
9C1 Move: cleandir1 - move files from workdir to subdir
9A1 Movement: CURSOR MOVEMENT
1E1 Multilevel: llr - display all files in multilevel subdirs
6A2 Must: jobflow5A - must run 1st before jobflow51
1B2 Mvstest: aliases for 'mvstest' RUNDATA & RUNLIBS

9B3 Naming: File Naming Conventions

7G5 Op-instns: Op-Instns for all files in directory
7G3 Op-instrns: Op-Instrns for citytax1 demo file
3B2 Op.: Op. Instrns. - Cross-Ref 1 at a time
4D3 Op.: Op. Instrns to create top-node summary table
6A2 Op.: Op. Instrns to generate JobFlow Reports
8E2 Op.: Op. Instrns. for scan5d
2C1 Operating: spreadA - Operating Instructions
2E1 Operating: verifytext - Operating Instructions
2G1 Operating: Operating Instructions
3B1 Operating: Operating Instructions
4A1 Operating: statallmvs1/statallvse1 - Operating Instructions
4D1 Operating: Operating Instructions
4F1 Operating: Operating Instructions
5B1 Operating: statallmvs1/statallvse1 - Operating Instructions
5D1 Operating: cobmap1 Operating Instructions
5E1 Operating: ANIMATION operating instructions
7E2 Operating: uvcmp1 demo#1 - Operating Instructions
8B2 Operating: acum1 - operating instructions
9A1 Operation: 'vi' 2 modes of operation - COMMAND or INSERT
7G3 Option: console displays for option changes
7J2 Option: 'y' for column scale headings
7J2 Option: sample uvlist with option 'y80'
8B2 Option: console log (option prompts)
2F1 Options: results AFTER default options a0b80c0d0e0f2j1
2F2 Options: modify grepsum1 options to improve results
2F2 Options: results AFTER options a0b0c0d3e1f2j1 + c0d3e1
2F2 Options: results AFTER options a0b0c0d3e1f2j1 + c2d3e1
4D2 Options: table2 - OPTIONS (for Fixed Field files)
8D1 Options: console log - options prompt
8D2 Options: notes re command line 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 

7D1 Packed: demo#2 - using custmas1 with packed fields
2A2 Page: list 1st page only of all files in directory
7C2 Page: Notes re uvcp on page above
1F2 Parent: statdir1 - report file counts & KB used in a Parent dir
3G1 Parm: 3G2. xkshparm2 - crossref ksh SCRIPTS executing any 1 PARM
3G1 Parms: xkshparm1 - list all SYSIN/PARMs referenced in any 1 ksh SCRIPT
1H1 Patterns: grep - search for patterns in files
9B3 Prefixes: common prefixes to identify related files
2A2 Print: uvlp13LD - print Mainframe reports on Unix/Linux
2A1 Printers: 'uvlp__' scripts for Laser printers
2G1 Problem: sample problem for scan1d
7C2 Problem: common problem when files FTP'd from mainframe
3F1 Proc: 3F2. xkshproc2 - crossref ksh SCRIPTS executing any 1 PROC
3F1 Procs: xkshproc1 - list all PROCs executed in any 1 ksh SCRIPT
8F1 Procs: splitjclproc1 - split mixed JCLs & PROCs to separate subdirs
7C1 Products: sample text file dat1/products
1A1 Profiles: 'profiles' provided in /home/uvadm/env
1B1 Profiles: Recommended Aliases in profiles
3C1 Program: xcobcopy1 - list all COPYBOOKS in any 1 PROGRAM
3C2 Program: xcobcall1 - list of all Called-Programs in each Program
3C4 Program: xcobsql1 list all SQL Includes in any 1 Program
3E2 Program: xkshprog2 - crossref all ksh SCRIPTS executing any 1 PROGRAM
7C3 Program: Alternative - modify the COBOL program
7J1 Program: uvlist - Program Description
2D2 Programs: cleanup demo - for COBOL programs
3C1 Programs: xcobcopy2 - crossref all PROGRAMS using any 1 COPYBOOK
3C2 Programs: xcobcall2 - crossref all Programs calling any 1 Called-Program
3C3 Programs: xcobfile2 - cross-ref programs using each filename
3C4 Programs: xcobsql2 crossref all Programs using any 1 SQL Include
3E1 Programs: xkshprog1 - list all PROGRAMs executed in any 1 ksh SCRIPT
8E3 Programs: scan JCL for certain programs
8G1 Programs: splitcblcpy1 - split mixed COBOL programs & copybooks
9B1 Programs: example - editing & compiling programs
8D1 Prompt: console log - options prompt
8B2 Prompts: console log (option prompts)
1A1 Provided: 'profiles' provided in /home/uvadm/env

9A4 Quit: WRITE & QUIT

7U1 Rdw: mainframe file in RDW format for FTP
1B1 Recommended: Recommended Aliases in profiles
5C1 Recommended: cobfiles5A - recommended alternative
5D1 Record: 'cobmap1' - generate record layouts from COBOL copybooks
4E1 Record-size: summary
4D1 Records: demo input file - 1st 3 of 20 records
7F1 Records: listrec2 - list fixed length records
7F2 Records: listhex2 - list fixed length records in hexadecimal
8D1 Records: selectf1 - select records depending on field value
9A4 Reference: vim Reference
3G1 Referenced: xkshparm1 - list all SYSIN/PARMs referenced in any 1 ksh SCRIPT
3A1 References: Cross References for COBOL & JCL/scripts
9B3 Related: common prefixes to identify related files
1C1 Rename: File Rename scripts
2G1 Replace: scan/replace jobs more powerful than grep & sed
7B2 Response: to search/verify command
2F1 Result: example - grep for EXEC & drop duplicates from result
1H1 Results: grep results
2F1 Results: grepsum1 - summarize grep search results
2F1 Results: AFTER default options a0b80c0d0e0f2j1
2F2 Results: modify grepsum1 options to improve results
2F2 Results: AFTER options a0b0c0d3e1f2j1 + c0d3e1
2F2 Results: AFTER options a0b0c0d3e1f2j1 + c2d3e1
9B1 Right: working above subdirs - RIGHT
9B1 Rule: Exception to the Rule
6D1 Rules: Rules for using lastgenr
6A2 Run: jobflow5A - must run 1st before jobflow51
6E1 Run: getEtime - display 'job times' for last run of any JCL/script
5F2 Run-time: Micro Focus COBOL - Run-time Error Codes
5F3 Run-time: Micro Focus COBOL - Run-time Error Messages
1B1 Rundata: cd aliases to RUNDATA, RUNLIBS,& CNVDATA
1B2 Rundata: aliases for 'mvstest' RUNDATA & RUNLIBS
1B1 Runlibs: cd aliases to RUNDATA, RUNLIBS,& CNVDATA
1B2 Runlibs: aliases for 'mvstest' RUNDATA & RUNLIBS
1E1 Running: sample llr of TESTDATA after running 1 job

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 

8C1 Sales: customer master sales report
1E1 Sample: llr of TESTDATA after running 1 job
1F2 Sample: statdir1 - sample report
2B1 Sample: listall - sample command & output
2C1 Sample: spreadA - sample report
2D2 Sample: cleanup demo - sample INPUT
2D2 Sample: cleanup demo - sample OUTPUT
2E1 Sample: verifytext - sample report
2G1 Sample: problem for scan1d
2G2 Sample: report
3B2 Sample: report
3C1 Sample: COBOL Cross-Ref Sample Reports
4C1 Sample: input /var/log/messages
4C1 Sample: output report
4D1 Sample: output report
4D3 Sample: report - summary of HLQs in all JCL
4F1 Sample: report
5C2 Sample: COBOL files report
6A1 Sample: JobFlow sample report
6D1 Sample: Sample Op Instrns - display latest gen file
7B1 Sample: uvhdcob - sample display
7C1 Sample: text file dat1/products
7E3 Sample: uvcmp1 demo#1 - sample report
7F1 Sample: output report
7F2 Sample: output report
7G2 Sample: gentest1 - sample input
7G2 Sample: output
7J2 Sample: uvlist with option 'y80'
7J3 Sample: output of utmpdump
7J3 Sample: output of uvlist
8B2 Sample: report from acum1
8E1 Sample: exception report
4B1 Samples: statmvsjcl1 - mainframe JCL stat report samples
4B3 Samples: statcbl11 - COBOL stat report samples
5B2 Samples: statcbl11 - COBOL stat report samples
7J2 Scale: option 'y' for column scale headings
2E1 Scan: verifytext - scan files in subdir for binary data
2G1 Scan: scan/replace jobs more powerful than grep & sed
8E3 Scan: JCL for certain programs
2G1 Scan1d: sample problem for scan1d
8E1 Scan5d: - search directory for exception files
8E2 Scan5d: Op. Instrns. for scan5d
8E4 Scan5d: - search directory for exception files
1H1 Search: grep - search for patterns in files
2F1 Search: grepsum1 - summarize grep search results
7B2 Search: response to search/verify command
8E1 Search: scan5d - search directory for exception files
8E4 Search: scan5d - search directory for exception files
9A3 Search: commands
2G1 Sed: scan/replace jobs more powerful than grep & sed
8D1 Select: selectf1 - select records depending on field value
8D1 Selectf1: - select records depending on field value
8F1 Separate: splitjclproc1 - split mixed JCLs & PROCs to separate subdirs
7I1 Sequential: example - sort sequential & load Indexed
6C1 Setup: 'testdata' in Your homedir ?
9B2 Setup: tip#2 - setup 'tmp' sub-dir in your working directory
2B1 Small: listall - List All (small) Files in Directory
1K1 Smaller: dd example #1 - create a smaller test file
7I1 Sort: example - sort sequential & load Indexed
2D1 Source: cleanup - source code maintenance utility
7J3 Spaces: uvlist as a filter - compress blank lines & spaces
8F1 Split: splitjclproc1 - split mixed JCLs & PROCs to separate subdirs
8G1 Split: splitcblcpy1 - split mixed COBOL programs & copybooks
8G1 Splitcblcpy1: - split mixed COBOL programs & copybooks
8F1 Splitjclproc1: - split mixed JCLs & PROCs to separate subdirs
2C1 Spreada: spreadA - Operating Instructions
2C1 Spreada: spreadA - list files 4-up for doc & control
2C1 Spreada: spreadA - sample report
2C2 Spreada: spreadA - list files 4-up for doc & control
3C4 Sql: xcobsql1 list all SQL Includes in any 1 Program
3C4 Sql: xcobsql2 crossref all Programs using any 1 SQL Include
9A1 Starting: 'vi' to edit a file
4B1 Stat: statmvsjcl1 - mainframe JCL stat report samples
4B3 Stat: statcbl11 - COBOL stat report samples
5B2 Stat: statcbl11 - COBOL stat report samples
4A1 Statallmvs1: statallmvs1/statallvse1 - Operating Instructions
4A1 Statallmvs1: statallmvs1/statallvse1 - table stats from JCL/scripts
5B1 Statallmvs1: statallmvs1/statallvse1 - Operating Instructions
5B1 Statallmvs1: statallmvs1/statallvse1 - table stats from JCL/scripts
4A1 Statallvse1: statallmvs1/statallvse1 - Operating Instructions
4A1 Statallvse1: statallmvs1/statallvse1 - table stats from JCL/scripts
5B1 Statallvse1: statallmvs1/statallvse1 - Operating Instructions
5B1 Statallvse1: statallmvs1/statallvse1 - table stats from JCL/scripts
4B3 Statcbl11: - COBOL stat report samples
5B2 Statcbl11: - COBOL stat report samples
1F2 Statdir1: - report file counts & KB used in a Parent dir
1F2 Statdir1: - sample report
4B2 Statistics: statksh1 - converted JCL/script statistics
4B2 Statksh1: - converted JCL/script statistics
4C1 Statlogin1: - table summary user logins by month & userid
4D2 Statlogin1: - uvcopy coding
4B1 Statmvsjcl1: - mainframe JCL stat report samples
4A1 Stats: statallmvs1/statallvse1 - table stats from JCL/scripts
5B1 Stats: statallmvs1/statallvse1 - table stats from JCL/scripts
5F1 Status: Micro Focus COBOL - File Status Codes
9B1 Stay: tip#1 - stay in your 'working directory'
9B2 Sub-dir: tip#2 - setup 'tmp' sub-dir in your working directory
1K1 Subdir: script 'dd2ascii' to translate all files in subdir
2E1 Subdir: verifytext - scan files in subdir for binary data
9B2 Subdir: examples of using 'tmp' subdir
9C1 Subdir: cleandir1 - move files from workdir to subdir
1E1 Subdirs: llr - display all files in multilevel subdirs
8F1 Subdirs: splitjclproc1 - split mixed JCLs & PROCs to separate subdirs
9B1 Subdirs: advantages of working above subdirs
9B1 Subdirs: working IN subdirs - WRONG
9B1 Subdirs: working above subdirs - RIGHT
9A3 Substitution: commands
4D1 Summaries: table2 - Table Summaries for Fixed Length Fields
2F1 Summarize: grepsum1 - summarize grep search results
4F2 Summarize: tblexts2 - summarize .exts in all files in a tree
4C1 Summary: statlogin1 - table summary user logins by month & userid
4D3 Summary: Op. Instrns to create top-node summary table
4D3 Summary: sample report - summary of HLQs in all JCL
4D3 Summary: table3d - table summary for text files (JCL,COBOL,etc)
4E1 Summary: record-size summary
4F1 Summary: tblexts1 - table summary counts by file extensions
3G1 Sysin: xkshparm1 - list all SYSIN/PARMs referenced in any 1 ksh SCRIPT

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 

4A1 Table: statallmvs1/statallvse1 - table stats from JCL/scripts
4C1 Table: statlogin1 - table summary user logins by month & userid
4D1 Table: table2 - Table Summaries for Fixed Length Fields
4D3 Table: Op. Instrns to create top-node summary table
4D3 Table: table3d - table summary for text files (JCL,COBOL,etc)
4F1 Table: tblexts1 - table summary counts by file extensions
5B1 Table: statallmvs1/statallvse1 - table stats from JCL/scripts
4D1 Table2: - Table Summaries for Fixed Length Fields
4D2 Table2: - OPTIONS (for Fixed Field files)
4D2 Table2: demo - console display
4D3 Table3d: - table summary for text files (JCL,COBOL,etc)
4F1 Tblexts1: - table summary counts by file extensions
4F1 Tblexts1: to calc compile failure %
4F2 Tblexts2: - summarize .exts in all files in a tree
6B1 Tee: joblog1,2,3 - capture logs via 'tee'
1K1 Test: dd example #1 - create a smaller test file
7B2 Test: test/demo verify command
7E1 Test: dat1/warmas1a - Alternate test file#2 with differences
7E1 Test: file#1 /home/uvadm/dat1/warmas1
7G1 Test: gentest1 - generate test data files based on COBOL copybooks
1E1 Testdata: sample llr of TESTDATA after running 1 job
6C1 Testdata: setup 'testdata' in Your homedir ?
4D3 Text: table3d - table summary for text files (JCL,COBOL,etc)
7C1 Text: sample text file dat1/products
7C1 Text: using uvcp to convert 'text' to 'fixed'
7C3 Text: uvcp to drop CR/LF (convert text to fixed)
7C4 Text: using 'uvcp' to convert 'fixed' to 'text'
9A2 Text: INSERT text (ESCAPE to end insert)
6E1 Times: getEtime - display 'job times' for last run of any JCL/script
9B1 Tip: tip#1 - stay in your 'working directory'
9B2 Tip: tip#2 - setup 'tmp' sub-dir in your working directory
9B2 Tmp: examples of using 'tmp' subdir
9B2 Tmp: tip#2 - setup 'tmp' sub-dir in your working directory
4D3 Top-node: Op. Instrns to create top-node summary table
1K1 Translate: dd example #2 - translate EBCDIC to ASCII
1K1 Translate: script 'dd2ascii' to translate all files in subdir
1D1 Tree: dtree - draw directory tree
4F2 Tree: tblexts2 - summarize .exts in all files in a tree
8E3 Try: Try it yourself
9A1 Tutorial: 'vi' tutorial

1K1 Unix: dd - Unix/Linux Data utility
1L1 Unix: 1K1. Unix/Linux aids documented in ADMjobs.doc
1L1 Unix: Vital Unix/Linux aids documented in ADMjobs.doc
2A2 Unix: uvlp13LD - print Mainframe reports on Unix/Linux
5E1 Unix: Animating MicroFocus COBOL on Unix/Linux
7U1 Unix: desired Output file on Unix/Linux
1I1 Unix2dos: dos2unix & unix2dos
4C1 User: statlogin1 - table summary user logins by month & userid
4C1 Userid: statlogin1 - table summary user logins by month & userid
1G1 Utilities: diff & alldiff - marvelous utilities
1J1 Utility: Vancouver Utility Backups & crontabs
1K1 Utility: dd - Unix/Linux Data utility
2D1 Utility: cleanup - source code maintenance utility
7J3 Utmpdump: sample output of utmpdump
1A1 Uvadm: 'profiles' provided in /home/uvadm/env
7E1 Uvadm: test file#1 /home/uvadm/dat1/warmas1
7E2 Uvcmp1: demo#1 - Operating Instructions
7E3 Uvcmp1: demo#1 - sample report
4D2 Uvcopy: statlogin1 - uvcopy coding
7G5 Uvcopy: code for gentest1
8A1 Uvcopy: - powerful data manipulation
7C1 Uvcp: using uvcp to convert 'text' to 'fixed'
7C2 Uvcp: Notes re uvcp on page above
7C3 Uvcp: to drop CR/LF (convert text to fixed)
7C4 Uvcp: using 'uvcp' to convert 'fixed' to 'text'
7D1 Uvcp: scripts to make uvcp easier to use
7D1 Uvcpf2l: demo using uvcpF2L
7A1 Uvhd: - display DATA files in Vertical Hexadecimal
7B4 Uvhdc: - script for easier use of uvhdcob
7B1 Uvhdcob: - display data file fields with COBOL fieldnames
7B1 Uvhdcob: - sample display
7B3 Uvhdcob: Notes re uvhdcob Verify
7B4 Uvhdcob: uvhdc - script for easier use of uvhdcob
7J1 Uvlist: - Program Description
7J2 Uvlist: sample uvlist with option 'y80'
7J3 Uvlist: sample output of uvlist
7J3 Uvlist: as a filter - compress blank lines & spaces
7J1 Uvlp12: script
2A2 Uvlp13ld: uvlp13LD - print Mainframe reports on Unix/Linux
2A1 Uvlp__: 'uvlp__' scripts for Laser printers
7I1 Uvsort:
7U1 Uxcp: - complex Data File Conversions
7U1 Uxcp: command to convert file

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 

8D1 Value: selectf1 - select records depending on field value
1J1 Vancouver: Vancouver Utility Backups & crontabs
4C1 Var: sample input /var/log/messages
7B1 Verify: 'v' verify data command
7B2 Verify: response to search/verify command
7B2 Verify: test/demo verify command
7B3 Verify: Notes re uvhdcob Verify
2E1 Verifytext: - Operating Instructions
2E1 Verifytext: - sample report
2E1 Verifytext: - scan files in subdir for binary data
6B1 Versions: 3 versions of joblog script
7A1 Vertical: uvhd - display DATA files in Vertical Hexadecimal
9A4 Vim: Reference
1L1 Vital: Vital Unix/Linux aids documented in ADMjobs.doc
7H1 Vtoc: Data File VTOC Report

7E1 Warmas1: test file#1 /home/uvadm/dat1/warmas1
7E1 Warmas1a: dat1/warmas1a - Alternate test file#2 with differences
7C2 When: common problem when files FTP'd from mainframe
9C1 Workdir: cleandir1 - move files from workdir to subdir
9B1 Working: advantages of working above subdirs
9B1 Working: tip#1 - stay in your 'working directory'
9B1 Working: IN subdirs - WRONG
9B1 Working: above subdirs - RIGHT
9B2 Working: tip#2 - setup 'tmp' sub-dir in your working directory
9A4 Write: WRITE & QUIT
9B1 Wrong: working IN subdirs - WRONG

3C2 Xcobcall1: - list of all Called-Programs in each Program
3C2 Xcobcall2: - crossref all Programs calling any 1 Called-Program
3C1 Xcobcopy1: - list all COPYBOOKS in any 1 PROGRAM
3C1 Xcobcopy2: - crossref all PROGRAMS using any 1 COPYBOOK
3C3 Xcobfile2: - cross-ref programs using each filename
3C4 Xcobsql1: list all SQL Includes in any 1 Program
3C4 Xcobsql2: crossref all Programs using any 1 SQL Include
3D1 Xkshfile1: - list all DATAFILES used in any 1 ksh SCRIPT
3D2 Xkshfile2: - crossref all ksh SCRIPTs using any 1 DATAFILE
3G1 Xkshparm1: - list all SYSIN/PARMs referenced in any 1 ksh SCRIPT
3G1 Xkshparm2: 3G2. xkshparm2 - crossref ksh SCRIPTS executing any 1 PARM
3F1 Xkshproc1: - list all PROCs executed in any 1 ksh SCRIPT
3F1 Xkshproc2: 3F2. xkshproc2 - crossref ksh SCRIPTS executing any 1 PROC
3E1 Xkshprog1: - list all PROGRAMs executed in any 1 ksh SCRIPT
3E2 Xkshprog2: - crossref all ksh SCRIPTS executing any 1 PROGRAM

7J2 Y80: sample uvlist with option 'y80'
9A2 Yank: COPY lines (YANK & PUT)
8E3 Yourself: Try it yourself

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

ThisYear=000172   (J=0,F=102,M=70,A=0,M=0,J=0,J=0,A=0,S=0,O=0,N=0,D=0)
LastYear=000428   (J=0,F=0,M=0,A=0,M=0,J=0,J=0,A=0,S=0,O=55,N=173,D=200)