Part_1 Introduction & Overview
 Summary of Functions available.
- browse,search,update,acum,print,iprint,write,seqcheck,tally,verify,move
Pre-Requisites (preparation for use)
- generate cobmaps from copybooks & export RUNLIBS
 Illustration of 'cobmap' record-layout & 'uvhdcob' display
 Operation Instructions & command line options
Inter-Operation of uvhdcob & uvhd
- may 'e'xit to uvhd & 'q'uit back to uvhdcob

Part_2 - Help Screens (19 help screens)
- command line options
- commands & examples for:
- browse, search, update, acum, print, iprint, write, write options
- sequence check, tally(count), verify data, move fields

Part_3 Test/Demo uvhdcob with various file-types
- EBCDIC fixed length, ASCII fixed length, variable length Text,
  variable length RDW (Record Descriptor Word, recsize in binary prefix),
  Indexed files (fixed-length IDXFORMAT1 & variable length IDXFORMAT3/8)
- copybooks (record layouts) for the demo datafiles
  (vendormas, vendorpay, vendorpaymas, vendorpaymasa)
- listings of text version of demo Data-Files
  (vendormas2,vendorpay2,vendorpaymas2)
- must use uvhd or uvhdcob to display other file types
 Demo uvhdcob using various file types & vendormas copybook
- vendormas0,vendormas1,vendormas2,vendormas4,vendormas4,vendormas5,vendormas6
- suffix 0=EBCDIC-fixed,1=ASCII-fixed,2=Text,3=RDW,4=IDXf1,5=IDXf3v,6=IDXf8v
Multi-Record-Type files
- example for vendorpaymas (vendor names & vendor payments)

Part_4 Demo the 'Verify' command (using dat1/custmas1x with known bad data)
- verify searches the file for unprintable characters in pic x fields &
  invalid digits or signs in unpacked or packed numeric fields.
 Option 'j' to execute 1 command & exit
- perfect example 'j=v99p99x7' verify all records, write invalids to tmp
 Demo the 'Find' command to find records by record#
- for variable length record files (Text, RDW, IDXFORMAT3/8)
- N/R for Fixed length since we can calc offset & jump to any record#

Part_5 Scripts uvhdc1/uvhdc2 make it easier to use the 'uvhdcob' program
- requires only the data-file-name (no copybookname, no record-size,
- requires initial setup of a control file to relate data file names
  to the corresponding copybooks & filetype options
- requires $CTLMAPDIR or $RUNLIBS or $RUNDATA or $CNVDATA (in profile)
  to define superdir for the control-file & copybookmap
- uvhdc1 used for the Part_3 demos vendormas,vendorpay,vendorpaymas
- uvhdc2 relevant to mainframe conversion sites & filename conventions

Part_6 - Environmental Variables for uvhdcob
UVHDCOBROP - specify favorite options (such as 50 lines/screen)
UVHDCOBPRINT - specify immediate printing script (uvlp12 default)
uvhdcobdif2 - script to compare 2 data files using uvhdcob & diff

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

Part_1 uvhdcob - display data files with COBOL field names

Part 1 - Contents


1A1. Difference between uvhdcob & uvhd
- uvhd displays data only (in vertical hexadecimal)
- uvhdcob displays data beside COBOL copybook fieldnames
- sample uvhdcob display of customer master demo file

1A2. uvhdcob function summary

1B1. Preparation to use uvhdcob
- convert copybooks to 'cobmaps' (record layouts)
- 1 at a time or all copybooks in the directory
- cobmap file is the 2nd input to uvhdcob

1C1. sample 'cobmap' (record layout generated from copybook)
- shows field start/end/length/type on right-hand side
- see $UV/dat1/custmas1, $UV/mf/cpys/custmas1, $UV/mf/maps/custmas1

1C2. sample 'uvhdcob' display for 1st record of dat1/custmas1
- with COBOL copybook fieldnames beside data field contents
- with default option 'o1' (shows only 1st field of occurs)

1C3. sample 'uvhdcob' display for 1st record of dat1/custmas1
- with option 'o99' to show ALL occurrences of occurs fields

1C4. display with options 'o99' all occurs & 'i4' inhibit zero/blank fields
- use option 'i4' to show more info on fewer screens
- useful if you have large records with many zero/blank fields.

1C5. display with options 'o5' 5 occurs & 'i1' inhibit zero/blank occurs fields
- use option 'o#' to specify the number of 'item' occurs fields displayed.
- 'o5' will display just the 1st 5 of any item occurs fields.

1D1. demo uvhdcob with GROUP occurs options
- using demo data file dat1/custran1 & copybook mf/cpys/custran1
1D2.  'g1' option (default) shows 1st occurrence only
1D3.  'g99' to show all group occurs fields

1E1. demo uvhdcob with group & ITEM occurs options
- using demo data file dat1/custran2 & copybook mf/cpys/custran2
1E2.  'g1o1' options (default) shows 1st occurrences only
1E3.  'g99o99' to show all group occurs & all item occurs fields
1E4.  add option 'i4' (g99o99i4) to inhibit all zero/blank fields

1F1. demo uvhdcob 'OCCURS DEPENDING ON'
- using demo data file dat1/custran3 & copybook mf/cpys/custran3
- variable length RDW data file with occurs count at 118(2p)

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

Part 1 uvhdcob - display data files with COBOL field names

Part 1 - Contents (continued)


1G1. demo uvhdcob with multiple 'Occurs Depending On's ('ODO's)
uvhdcob dat1/custran4 mf/maps/custran4 z4g99o99i4

1H1. demo uvhdcob with 2 levels of 'group occurs'
uvhdcob dat1/custran6 mf/maps/custran6 r256g99o99i4

1I1. uvhdcob command line & options
TYPE control record for files with multi record types (redefined records)

1J1. Inter-Operation of uvhdcob & uvhd (complement each other)
 uvhdcob shows only 1st 36 bytes of pic x fields
- may use 'e' command to 'exit' uvhdcob & call uvhd
  which displays the entire record in vertical hexadecimal
  64 byte segments on 3 lines (characters, zones, digits)
- when you 'quit' uvhd, you are returned to uvhdcob on the same record

uvhdcob enhanced 2011

In 2011, 'occurs' processing was greatly enhanced. Previously only 'item occurs' was handled (occurs on same statement as 'picture'). uvhdcob now handles 'group occurs' (occurs on group name with no picture with multiple higher level# fields following).

  1. can handle group occurs to 2 levels only (a 3rd level might be added if significant csutomer requests).

  2. can handle "occurs depending on" & multiple consecutive ODOs, but not ODOs within ODOs which does not make sense.

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

1A1. uvhdcob - display data files with COBOL field names

What is the difference between 'uvhd' & 'uvhdcob' ?

uvhd

uvhdcob

uvhdcob - sample display

 uvhdcob datafile=dat1/custmas1
 20090222:0844 copybook=mf/maps/custmas1 options=
 record#=1 totalrecs=32 recsize=256 filesize=8192 fileptr=0
 rec#       1 fieldname occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 cm-num                       0   5 n  130140
 002 cm-delete                    6   9
 003 cm-name                     10  34    EVERGREEN MOTORS LTD.
 004 cm-adrs                     35  59    1815 BOWEN ROAD
 005 cm-city                     60  75    NANAIMO
 006 filler001                   76  76
 007 cm-prov                     77  78    BC
 008 filler002                   79  79
 009 cm-postal                   80  89    V9S1H1
 010 cm-phone                    90 101    250-754-5531
 011 cm-contact                 102 119     LARRY WRENCH
 012 cm-thisyr-sales       012  120 124pns 001234567C
 013 cm-lastyr-sales       012  180 184pns 001234567D
 014 filler003                  240 255    C 19950531
 rec#=1 rcount=32 rsize=256 fsize=8192 dat1/custmas1
 null=next,r#=rec,s=search,u=update,x=undo,p=print,i=iprint,w=write,t=tally
 ,v=verify,c=chkseq#,e=exit to uvhd,q=quit,?=help -->
  1. we show only the 1st field of occurs, such as cm-thisyr-sales - 12 x 5 byte packed fields

  2. packed fields shown in horizontal hex x'001234567C' - sign x'_C' in last byte positive, x'_D' negative

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

1A2. uvhdcob - display data files with COBOL field names

uvhdcob function summary

  1. Browse - display records consecutively - enter 'r#' (jump to record#) display records in Fixed-Length files - enter 'f#' (find record#) for Variable-Length files An Index of record#s & file-pointers is built on startup for Variable-Length files to quickly find records by record#

  2. Search - search by pattern, anywhere in the record (by default) or within specified column locations - may search on 1 or 2 fields with AND/OR relationships - match data =,>,< equal(default), greater than, less than - repeat previous search via 'ss' vs 's' + search args - search backward via 'sb' or 'ssb'

  3. Update - update the current record on display - specified columns replaced with specified data (char/hex) - option to rollback current record updates - option for multi-record updates with 1 qualifier field

  4. Acum - Accumulate fields from all records (current until EOF) or from records matching 1 or 2 specified patterns in spcfd bytes

  5. Print - write formatted records to tmp file for later lp,uvlp,etc - output file will be: tmp/filename.yymmddhhmmP - may specify a number of records from current position - may specify records matching 1 or 2 patterns & a max count - To actually print, you must quit uvhd & select the desired filename from the tmp directory.

  6. Iprint - write formatted records to a file for immediate printing via the 'uvlp12' command (see uvlist.doc). - may specify a number of records &/or records matching 1 or 2 specified patterns within specified columns.

  7. Write - write Unformatted records to a file: tmp/fname.yymmddhhmmW for subsequent use as test files, etc. - may specify number of records from current position or records matching 1 or 2 patterns within specified columns - select specified records from big files for small test files

  8. Check - check sequence of specified field - options for ascending, descending, duplicates

  9. Tally - count records from current position matching 1 or 2 specified patterns until EOF or within a max record count

  10. Exit - to uvhd, to display current record (without copybook names) - displays entire record (uvhdcob displays only 1st of occurs) - Quit on uvhd brings you back to uvhdcob

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

uvhdcob function summary (continued)

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

  2. Move - Move fields within records - probably reformatting to create a new file - be sure to copy/rename file to avoid dstruction of original - see help15 Example reformat Cust N&A records into Telephone list

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

1B1. uvhdcob Pre-Requisites (Preparation)

preparation to use uvhdcob

We will demo uvhdcob for supplied copybook directory /home/uvadm/mf/cpys Try this demo, then substitute your copybook directory for mf/cpys in whatever parent directory makes sense at your site.


 #1. cd /home/uvadm    <-- change to the uvadm home dir
     ==============

 #2. l cobol           <-- list subdirs in cobol directory
     =======
      /home/uvadm/cobol
      :-----cbls
      :-----cblst
      :-----cblx
      :-----cpys         <-- COBOL copybooks
      :-----ctl
      :-----maps         <-- copybooks converted to record layouts (cobmaps)

 #3. mkdir mf/maps    <-- you may need to make maps subdir for your site
     =============

 #4. uvcopyx cobmap1 mf/cpys mf/maps uop=q0i7p0
     ==========================================
     - generate cobmaps from copybooks

 #5. export RUNLIBS=/home/uvadm/cobol
     ================================

Exporting the cobol directory allows you to enter only the cobmap basename on the uvhdcob command line (add the export to your profile).


 #6a. uvhdcob dat1/custmas1 mf/maps/custmas1 - test with demo file & cobmap
      ======================================   (explicit cobmap path)

 #6b. uvhdcob dat1/custmas1 maps/custmas1   <-- retest using RUNLIBS option
      ===================================       for cobmap directory path
Note
  • in this example $RUNLIBS default saves only 'mf/'
  • but this would be a big help when the datafiles are not in the
    same superdir as the COBOL copybook maps
Note
  • also see the 'uvhdc1' on page '5K5' script which allows you to specify
    only the data file (the copybook map is looked up via an Indexed file)

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

1C1. cobmaps - COBOL record layouts created from copybooks

uvhdcob requires prior generation of 'cobmaps' from the COBOL copybooks. You could regenerate the cobmaps for uvadm as follows:


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

 #2.  uvcopyx cobmap1 mf/cpys mf/maps uop=q0i7p0
      ==========================================
      - generate cobmaps for all files in directory

 #2a. uvcopy cobmap1,fili1=mf/cpys/custmas1,filo1=mf/maps/custmas1
      ============================================================
      - could generate cobmap for just 1 copybook at a time
      - but better to generate all (as per #2) & command actually shorter

sample cobmap report

 cobmap1  start-end bytes for cobol record fields    199905101503  pg# 0001
 cpys/custmas1                                     RCSZ=0256  bgn-end lth typ
 * custmas1 - cobol copy book for custmas1 file (see uvtrain.
      10 cm-num           pic  9(6).                          000-0005 006 n  06
      10 cm-delete        pic  x(4).                          006-0009 004
      10 cm-name          pic  x(25).                         010-0034 025
      10 cm-adrs          pic  x(25).                         035-0059 025
      10 cm-city          pic  x(16).                         060-0075 016
      10 filler001        pic  x.                             076-0076 001
      10 cm-prov          pic  x(2).                          077-0078 002
      10 filler002        pic  x.                             079-0079 001
      10 cm-postal        pic  x(10).                         080-0089 010
      10 cm-phone         pic  x(12).                         090-0101 012
      10 cm-contact       pic  x(18).                         102-0119 018
      10 cm-thisyr-sales  pic  s9(7)v99 comp-3 occurs 12.     120-0124 005pns 09
      10 cm-lastyr-sales  pic  s9(7)v99 comp-3 occurs 12.     180-0184 005pns 09
      10 cm-thisyr-xft    pic  s9(7)v99 comp-3.               240-0244 005pns 09
      10 cm-lastyr-xft    pic  s9(7)v99 comp-3.               245-0249 005pns 09
      10 filler003        pic  x(6).                          250-0255 006
 *RCSZ=0256                                                       0256

Also note that the 'cobmaps' are very useful to COBOL shops for other reasons (when you need to know field locations for sorting, verifying data, etc).

You may find it convenient to print cobmaps for all copybooks, and mount in a 3 ring binder for easy reference. See documentation for the 'cobmap' utility in COBaids.doc .

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

1C2. cobmaps - COBOL record layouts created from copybooks

sample 'uvhdcob' display for demo file dat1/custmas1


 uvhdcob dat1/custmas1 mf/maps/custmas1
 ======================================
 rec#       1           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 cm-num                       0    5 n  130140
 002 cm-delete                    6    9
 003 cm-name                     10   34    EVERGREEN MOTORS LTD.
 004 cm-adrs                     35   59    1815 BOWEN ROAD
 005 cm-city                     60   75    NANAIMO
 006 filler001                   76   76
 007 cm-prov                     77   78    BC
 008 filler002                   79   79
 009 cm-postal                   80   89    V9S1H1
 010 cm-phone                    90  101    250-754-5531
 011 cm-contact                 102  119     LARRY WRENCH
 012 cm-thisyr-sales       012  120  124pns 001234567C
 013 cm-lastyr-sales       012  180  184pns 001234567D
 014 filler003                  240  255    C 19950531
 rec#=1 rcount=32 rsize=256 fsize=8192 fptr=0
 Enter command, or ?=Help, or null=NextRecord -->

notes re 'occurs' fields

  1. Note the occurs fields 'cm-thisyr-sales' & 'cm-lastyr-sales' - 12 x 5 byte packed fields for this year & last year sales.

  2. By default uvhdcob shows data only for the 1st field of an occurs.

  3. You may use option 'o99' on the command line or command 'o99' at the prompts to show data for all occurrences of occurs fields - see sample display below:

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

1C3. cobmaps - COBOL record layouts created from copybooks

sample with option 'o99' show all occurrences


 uvhdcob dat1/custmas1 mf/maps/custmas1 o99  <-- option o99 may be on cmd line
 ==========================================    - OR use command o99 at prompts

--> o99 <-- command 'o99' at prompt (same as option o99 on command line)

 now=20110815:1536 uvhdcob dat1/custmas1 o99
 version=20110815 copybook=mf/maps/custmas1
 rec#=1 rcount=32 rsize=256 fsize=8192 fptr=0
 rec#       1           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 cm-num                       0    5 n  130140
 002 cm-delete                    6    9
 003 cm-name                     10   34    EVERGREEN MOTORS LTD.
 004 cm-adrs                     35   59    1815 BOWEN ROAD
 005 cm-city                     60   75    NANAIMO
 006 filler001                   76   76
 007 cm-prov                     77   78    BC
 008 filler002                   79   79
 009 cm-postal                   80   89    V9S1H1
 010 cm-phone                    90  101    250-754-5531
 011 cm-contact                 102  119     LARRY WRENCH
 012 cm-thisyr-sales       001  120  124pns 001234567C
 012 cm-thisyr-sales       002  125  129pns 000000000C
 012 cm-thisyr-sales       003  130  134pns 000000000C
 012 cm-thisyr-sales       004  135  139pns 000257300D
 012 cm-thisyr-sales       005  140  144pns 000514600C
 012 cm-thisyr-sales       006  145  149pns 000000000C
 012 cm-thisyr-sales       007  150  154pns 000029587D
 --- continue to EOR -->
 012 cm-thisyr-sales       008  155  159pns 000266331C
 012 cm-thisyr-sales       009  160  164pns 000404945C
 012 cm-thisyr-sales       010  165  169pns 000000000C
 012 cm-thisyr-sales       011  170  174pns 000000000C
 012 cm-thisyr-sales       012  175  179pns 000000000C
 013 cm-lastyr-sales       001  180  184pns 001234567D
 013 cm-lastyr-sales       002  185  189pns 000000000C
 013 cm-lastyr-sales       003  190  194pns 000003457C
 013 cm-lastyr-sales       004  195  199pns 000004567D
 013 cm-lastyr-sales       005  200  204pns 000000000C
 013 cm-lastyr-sales       006  205  209pns 000002838C
 013 cm-lastyr-sales       007  210  214pns 000000000C
 013 cm-lastyr-sales       008  215  219pns 000008138C
 013 cm-lastyr-sales       009  220  224pns 000005668D
 013 cm-lastyr-sales       010  225  229pns 000001123C
 013 cm-lastyr-sales       011  230  234pns 000000000C
 013 cm-lastyr-sales       012  235  239pns 000001669D
 014 filler003                  240  255    C 19950531
 rec#=1 rcount=32 rsize=256 fsize=8192 fptr=0
 Enter command, or ?=Help, or null=NextRecord -->
Note
  • compare this display 1C3 to the previous page 1C2
  • this (with option o99) shows all 12 occurrences of thisyr & lastyr sales
  • page '1C2' (with default option o1) shows only the 1st occurrence

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

1C4. cobmaps - COBOL record layouts created from copybooks

options 'o99' all occurs & 'i4' inhibit 0/b fields

You can use option 'i4' to inhibit displaying zero/blank fields, and show more info on fewer screens. This is useful if you have large records with many zero/blank fields.


 uvhdcob dat1/custmas1 mf/maps/custmas1 o99i4 <-- option o99 all occurs &
 ============================================     i4 inhibit 0/b fields

--> o99i4 <-- command 'o99' at prompt (same as option o99i4 on command line)

 now=20110815:1537 uvhdcob dat1/custmas1 o99i4
 version=20110815 copybook=mf/maps/custmas1
 rec#=1 rcount=32 rsize=256 fsize=8192 fptr=0
 rec#       1           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 cm-num                       0    5 n  130140
 003 cm-name                     10   34    EVERGREEN MOTORS LTD.
 004 cm-adrs                     35   59    1815 BOWEN ROAD
 005 cm-city                     60   75    NANAIMO
 007 cm-prov                     77   78    BC
 009 cm-postal                   80   89    V9S1H1
 010 cm-phone                    90  101    250-754-5531
 011 cm-contact                 102  119     LARRY WRENCH
 012 cm-thisyr-sales       001  120  124pns 001234567C
 012 cm-thisyr-sales       004  135  139pns 000257300D
 012 cm-thisyr-sales       005  140  144pns 000514600C
 012 cm-thisyr-sales       007  150  154pns 000029587D
 012 cm-thisyr-sales       008  155  159pns 000266331C
 012 cm-thisyr-sales       009  160  164pns 000404945C
 013 cm-lastyr-sales       001  180  184pns 001234567D
 013 cm-lastyr-sales       003  190  194pns 000003457C
 013 cm-lastyr-sales       004  195  199pns 000004567D
 013 cm-lastyr-sales       006  205  209pns 000002838C
 --- continue to EOR -->
 013 cm-lastyr-sales       008  215  219pns 000008138C
 013 cm-lastyr-sales       009  220  224pns 000005668D
 013 cm-lastyr-sales       010  225  229pns 000001123C
 013 cm-lastyr-sales       012  235  239pns 000001669D
 014 filler003                  240  255    C 19950531
 rec#=1 rcount=32 rsize=256 fsize=8192 fptr=0
 Enter command, or ?=Help, or null=NextRecord -->
Note
  • compare this 'o99i4' display with the 'o99' display on the prior page.
    and note all zero/blank fields inhibited on this page.

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

1C5. cobmaps - COBOL record layouts created from copybooks

options 'o5' 5 occurs & 'i1' inhibit 0/b occurs fields

You can use option 'o#' to specify the number of 'item' occurs fields displayed. For example 'o5' will display just the 1st 5 of any item occurs fields. 'Item occurs' are fields where 'occurs' is coded on the 'pic' (vs group).

Option 'g#' may specify the number of 'group' occurs fields to be displayed. Defaults are g1 for 1st occurs of group & o1 for 1st occurs of item occurs.

You can combine options o# & g# with option 'i1' to inhibit displaying zero/blank 'item occurs' fields, option 'i2' to inhibit displaying zero/blank 'group occurs' fields, and 'i4' to inhibit displaying ALL zero/blank fields (regardless of occurs or not).


 uvhdcob dat1/custmas1 mf/maps/custmas1 o5i1 <-- option o5 for 5 occurs &
 ===========================================     i1 inhibit 0/b occurs fields

--> o5i1 <-- command 'o5i1' at prompt (same as option o5i1 on command line)

 now=20110815:1537 uvhdcob dat1/custmas1 o5i1
 version=20110815 copybook=mf/maps/custmas1
 rec#=1 rcount=32 rsize=256 fsize=8192 fptr=0
 rec#       1           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 cm-num                       0    5 n  130140
 002 cm-delete                    6    9
 003 cm-name                     10   34    EVERGREEN MOTORS LTD.
 004 cm-adrs                     35   59    1815 BOWEN ROAD
 005 cm-city                     60   75    NANAIMO
 006 filler001                   76   76
 007 cm-prov                     77   78    BC
 008 filler002                   79   79
 009 cm-postal                   80   89    V9S1H1
 010 cm-phone                    90  101    250-754-5531
 011 cm-contact                 102  119     LARRY WRENCH
 012 cm-thisyr-sales       001  120  124pns 001234567C
 012 cm-thisyr-sales       004  135  139pns 000257300D
 012 cm-thisyr-sales       005  140  144pns 000514600C
 013 cm-lastyr-sales       001  180  184pns 001234567D
 013 cm-lastyr-sales       003  190  194pns 000003457C
 013 cm-lastyr-sales       004  195  199pns 000004567D
 014 filler003                  240  255    C 19950531
 rec#=1 rcount=32 rsize=256 fsize=8192 fptr=0
 Enter command, or ?=Help, or null=NextRecord -->
Note
  • compare this 'o5i1' display with the 'o99i4' display on the prior page.
  • option 'o5' limits display to 1st 5 of each item occurs fields
  • option 'i1' inhibits displaying zero/blank item occurs fields
    (still displays non item occurs zero/blank fields)
  • would use option 'i2' to inhibit display of zero/blank group occurs

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

1D1. demo uvhdcob with GROUP OCCURS options

We will demo 'group occurs' options using the following files:

dat1/custran1
  • customer master with 5 group occurs transactions
mf/cpys/custran1
  • copybook for the above data file

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

 #2. uvcopy cobmap1,fili1=mf/cpys/custran1,filo1=mf/maps/custran1
     ============================================================
     - generate cobmap for 1 copybook at a time

 #2a. uvcopyx cobmap1 mf/cpys mf/maps uop=q0i7p0
      ==========================================
      - generate cobmaps for all files in directory
      - easier (shorter command) than for 1 at a time

custran1 - cobmap to demo group occurs

 cobmap1  start-end bytes for cobol record fields    201108161840  pg# 0001
 mf/cpys/custran1                               RCSZ=00256  bgn  end  lth typ
 * custran1 - copybook for customer master & transaction file
 *          - with group occurs to test uvhdcob occurs option
 * - also see custran2 with item occurs within group occurs
      10 cmt-num           pic  9(6).                         0000 0005  006 n  6
      10 cmt-delete        pic  x(4).                         0006 0009  004
      10 cmt-name          pic  x(25).                        0010 0034  025
      10 cmt-adrs          pic  x(25).                        0035 0059  025
      10 cmt-city          pic  x(16).                        0060 0075  016
      10 filler001         pic  x.                            0076 0076  001
      10 cmt-prov          pic  x(2).                         0077 0078  002
      10 filler002         pic  x.                            0079 0079  001
      10 cmt-postal        pic  x(10).                        0080 0089  010
      10 cmt-phone         pic  x(12).                        0090 0101  012
      10 cmt-contact       pic  x(18).                        0102 0119  018
 *BGNOCCURSM:c-p:00005*00010=00050:00120-00169:1:
      10 cmt-trans occurs 5.
         15 cmt-tran-type  pic  x.                            0120 0120  001
         15 cmt-tran-ref   pic  9(4).                         0121 0124  004 n  4
         15 cmt-tran-amt   pic  s9(7)v99 comp-3.              0125 0129  005pns 9
 *ENDOCCURSM:c-p:00005*00010=00050:00120-00169:1:
      10 filler003         pic  x(86).                        0170 0255  086
 *RCSZ=00256
Note
  • group occurs has 3 fields 1+4+5 = 10 bytes each
  • 5 groups * 10 bytes = 50 bytes total
Note
  • Aug2011 BGNOCCURSMIXED shortened to BGNOCCURSM to allow room for
  • 'occurs depending on' field start,length,type for uvhdcob

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

1D2. demo uvhdcob with GROUP OCCURS options

demo group occurs options default g1 (1st only)


 uvhdcob dat1/custran1 mf/maps/custran1
 ======================================
 now=20110817:1209 uvhdcob dat1/custran1
 version=20110817 copybook=mf/maps/custran1
 rec#=1 rcount=32 rsize=256 fsize=8192 fptr=0
 rec#       1           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 cmt-num                      0    5 n  130140
 002 cmt-delete                   6    9
 003 cmt-name                    10   34    EVERGREEN MOTORS LTD.
 004 cmt-adrs                    35   59    1815 BOWEN ROAD
 005 cmt-city                    60   75    NANAIMO
 006 filler001                   76   76
 007 cmt-prov                    77   78    BC
 008 filler002                   79   79
 009 cmt-postal                  80   89    V9S1H1
 010 cmt-phone                   90  101    250-754-5531
 011 cmt-contact                102  119     LARRY WRENCH
 013 cmt-tran-type         005  120  120    A
 014 cmt-tran-ref          005  121  124 n  0101
 015 cmt-tran-amt          005  125  129pns 001234567C
 017 filler003                  170  255
 rec#=1 rcount=32 rsize=256 fsize=8192 fptr=0
 Enter command, or ?=Help, or null=NextRecord -->

notes re 'group occurs' fields

  1. Please relate this uvhdcob with the cobmap shown on the previous page

  2. Group occurs option defaults to 'g1' (show 1st only)

  3. Note '005' indicates that there are 5 total group occurrences (4 not shown)

  4. See next page option 'g99' to show all group occurreces

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

1D3. demo uvhdcob with GROUP OCCURS options

demo group occurs option g99 (show all occurs)


 uvhdcob dat1/custran1 mf/maps/custran1 g99  <-- option g99 may be on cmd line
 ==========================================    - OR use command g99 at prompts

--> g99 <-- command 'g99' at prompt (same as option g99 on command line)

 now=20110817:1209 uvhdcob dat1/custran1 g99
 version=20110817 copybook=mf/maps/custran1
 rec#=1 rcount=32 rsize=256 fsize=8192 fptr=0
 rec#       1           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 cmt-num                      0    5 n  130140
 002 cmt-delete                   6    9
 003 cmt-name                    10   34    EVERGREEN MOTORS LTD.
 004 cmt-adrs                    35   59    1815 BOWEN ROAD
 005 cmt-city                    60   75    NANAIMO
 006 filler001                   76   76
 007 cmt-prov                    77   78    BC
 008 filler002                   79   79
 009 cmt-postal                  80   89    V9S1H1
 010 cmt-phone                   90  101    250-754-5531
 011 cmt-contact                102  119     LARRY WRENCH
 013 cmt-tran-type         001  120  120    A
 014 cmt-tran-ref          001  121  124 n  0101
 015 cmt-tran-amt          001  125  129pns 001234567C
 013 cmt-tran-type         002  130  130    B
 014 cmt-tran-ref          002  131  134 n  0102
 015 cmt-tran-amt          002  135  139pns 000514600C
 013 cmt-tran-type         003  140  140    C
 014 cmt-tran-ref          003  141  144 n  0103
 015 cmt-tran-amt          003  145  149pns 000404945C
 013 cmt-tran-type         004  150  150
 014 cmt-tran-ref          004  151  154 n  0000
 015 cmt-tran-amt          004  155  159pns 000000000C
 013 cmt-tran-type         005  160  160    E
 014 cmt-tran-ref          005  161  164 n  0105
 015 cmt-tran-amt          005  165  169pns 001234567D
 017 filler003                  170  255
 rec#=1 rcount=32 rsize=256 fsize=8192 fptr=0
 Enter command, or ?=Help, or null=NextRecord -->
Note
  • compare this display (g99 all occurs) with prior page (g1 1st only)

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

1E1. demo uvhdcob with GROUP & ITEM OCCURS options

We will demo 'group AND ITEM occurs' options using the following files:

dat1/custran2
  • customer master with 5 group occurs transactions
  • 3 fields in group, 1 with item occurs 4
mf/cpys/custran2
  • copybook for the above data file

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

 #2. uvcopy cobmap1,fili1=mf/cpys/custran2,filo1=mf/maps/custran2
     ============================================================
     - generate cobmap for 1 copybook at a time

 #2a. uvcopyx cobmap1 mf/cpys mf/maps uop=q0i7p0
      ==========================================
      - generate cobmaps for all files in directory
      - easier (shorter command) than for 1 at a time

custran2 - cobmap to demo GROUP & ITEM occurs

 cobmap1  start-end bytes for cobol record fields    201108161840  pg# 0001
 mf/cpys/custran2                               RCSZ=00256  bgn  end  lth typ
 * custran2 - copybook for customer master & transaction file
 *           - alt version with item occurs within group occu
      10 cmt-num           pic  9(6).                         0000 0005  006 n  6
      10 cmt-delete        pic  x(4).                         0006 0009  004
      10 cmt-name          pic  x(25).                        0010 0034  025
      10 cmt-adrs          pic  x(25).                        0035 0059  025
      10 cmt-city          pic  x(16).                        0060 0075  016
      10 filler001         pic  x.                            0076 0076  001
      10 cmt-prov          pic  x(2).                         0077 0078  002
      10 filler002         pic  x.                            0079 0079  001
      10 cmt-postal        pic  x(10).                        0080 0089  010
      10 cmt-phone         pic  x(12).                        0090 0101  012
      10 cmt-contact       pic  x(18).                        0102 0119  018
 *BGNOCCURSM:c-p:00005*00025=00125:00120-00244:1:
      10 cmt-trans occurs 5.
         15 cmt-tran-type  pic  x.                            0120 0120  001
         15 cmt-tran-ref   pic  9(4).                         0121 0124  004 n  4
         15 cmt-tran-amt   pic  s9(7)v99 comp-3 occurs 4.     0125 0129  005pns 9
 *ENDOCCURSM:c-p:00005*00025=00125:00120-00244:1:
      10 filler003         pic  x(11).                        0245 0255  011
 *RCSZ=00256
Note
  • group occurs 5 has 3 fields & 3rd field has item occurs 4
  • 1 + 4 + (4*5=20) = 25 bytes each group occurs
  • 5 groups * 25 bytes = 125 bytes total (from 120 to 244)

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

1E2. demo uvhdcob with GROUP & ITEM OCCURS options

demo group&item occurs options default g1o1 (1st only)


 uvhdcob dat1/custran2 mf/maps/custran2
 ======================================
 now=20110817:1215 uvhdcob dat1/custran2
 version=20110817 copybook=mf/maps/custran2
 rec#=1 rcount=32 rsize=256 fsize=8192 fptr=0
 rec#       1           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 cmt-num                      0    5 n  130140
 002 cmt-delete                   6    9
 003 cmt-name                    10   34    EVERGREEN MOTORS LTD.
 004 cmt-adrs                    35   59    1815 BOWEN ROAD
 005 cmt-city                    60   75    NANAIMO
 006 filler001                   76   76
 007 cmt-prov                    77   78    BC
 008 filler002                   79   79
 009 cmt-postal                  80   89    V9S1H1
 010 cmt-phone                   90  101    250-754-5531
 011 cmt-contact                102  119     LARRY WRENCH
 013 cmt-tran-type         005  120  120    A
 014 cmt-tran-ref          005  121  124 n  0101
 015 cmt-tran-amt          5/4  125  129pns 001234567C
 017 filler003                  245  255
 rec#=1 rcount=32 rsize=256 fsize=8192 fptr=0
 Enter command, or ?=Help, or null=NextRecord -->

notes group & item occurs

  1. Please relate this uvhdcob with the cobmap shown on the previous page

  2. Group occurs option defaults to 'g1' (show 1st only)

  3. Note '005' indicates that there are 5 total group occurrences (4 not shown)

  4. Note '5/4' indicates item occurs 4 within group occurs 5

  5. See next page option 'g99' to show all group occurreces

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

1E3. demo uvhdcob with GROUP & ITEM OCCURS options

demo group&item occurs options g99o99 (show all occurs)


 uvhdcob dat1/custran2 mf/maps/custran2 g99o99  <-- option g99o99 on cmd line
 =============================================
 now=20110817:1216 uvhdcob dat1/custran2 g99o99
 version=20110817 copybook=mf/maps/custran2
 rec#=1 rcount=32 rsize=256 fsize=8192 fptr=0
 rec#       1           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 cmt-num                      0    5 n  130140
 002 cmt-delete                   6    9
 003 cmt-name                    10   34    EVERGREEN MOTORS LTD.
 004 cmt-adrs                    35   59    1815 BOWEN ROAD
 005 cmt-city                    60   75    NANAIMO
 006 filler001                   76   76
 007 cmt-prov                    77   78    BC
 008 filler002                   79   79
 009 cmt-postal                  80   89    V9S1H1
 010 cmt-phone                   90  101    250-754-5531
 011 cmt-contact                102  119     LARRY WRENCH
 013 cmt-tran-type         001  120  120    A
 014 cmt-tran-ref          001  121  124 n  0101
 015 cmt-tran-amt          1/1  125  129pns 001234567C
 015 cmt-tran-amt          1/2  130  134pns 000000000C
 015 cmt-tran-amt          1/3  135  139pns 000000000C
 015 cmt-tran-amt          1/4  140  144pns 000257300D
 013 cmt-tran-type         002  145  145    B
 014 cmt-tran-ref          002  146  149 n  0102
 015 cmt-tran-amt          2/1  150  154pns 000514600C
 015 cmt-tran-amt          2/2  155  159pns 000000000C
 015 cmt-tran-amt          2/3  160  164pns 000029587D
 015 cmt-tran-amt          2/4  165  169pns 000266331C
 013 cmt-tran-type         003  170  170    C
 014 cmt-tran-ref          003  171  174 n  0103
 015 cmt-tran-amt          3/1  175  179pns 000404945C
 015 cmt-tran-amt          3/2  180  184pns 000000000C
 015 cmt-tran-amt          3/3  185  189pns 000000000C
 015 cmt-tran-amt          3/4  190  194pns 000000000C
 013 cmt-tran-type         004  195  195    D
 014 cmt-tran-ref          004  196  199 n  0104
 015 cmt-tran-amt          4/1  200  204pns 000000000C
 015 cmt-tran-amt          4/2  205  209pns 000000000C
 015 cmt-tran-amt          4/3  210  214pns 000003457C
 015 cmt-tran-amt          4/4  215  219pns 000004567D
 013 cmt-tran-type         005  220  220    E
 014 cmt-tran-ref          005  221  224 n  0105
 015 cmt-tran-amt          5/1  225  229pns 001234567D
 015 cmt-tran-amt          5/2  230  234pns 000002838C
 015 cmt-tran-amt          5/3  235  239pns 000000000C
 015 cmt-tran-amt          5/4  240  244pns 000008138C
 017 filler003                  245  255
 rec#=1 rcount=32 rsize=256 fsize=8192 fptr=0
 Enter command, or ?=Help, or null=NextRecord -->

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

1E4. demo uvhdcob with GROUP & ITEM OCCURS options

group&item options g99o99i4 (all occurs, inhibit 0/b)

May combine option 'i4' with group&item options to inhibit display zero/blank fields - useful if you have large records with many blank/zero occurs fields.


 uvhdcob dat1/custran2 mf/maps/custran2 g99o99i4 <-- option g99o99i4 on cmd
 ===============================================   - OR enter at prompts
 --> g99o99i4 <-- command 'g99o99i4' (same as options g99o99i4 on uvhdcob)
Note
  • Best to enter options 'g' & 'o' on the command line (vs at the prompts)
  • I notice some inconsistent results, yet to be debugged as of March 2016
 rec#       1           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 cmt-num                      0    5 n  130140
 003 cmt-name                    10   34    EVERGREEN MOTORS LTD.
 004 cmt-adrs                    35   59    1815 BOWEN ROAD
 005 cmt-city                    60   75    NANAIMO
 007 cmt-prov                    77   78    BC
 009 cmt-postal                  80   89    V9S1H1
 010 cmt-phone                   90  101    250-754-5531
 011 cmt-contact                102  119     LARRY WRENCH
 013 cmt-tran-type         001  120  120    A
 014 cmt-tran-ref          001  121  124 n  0101
 015 cmt-tran-amt          1/1  125  129pns 001234567C
 015 cmt-tran-amt          1/4  140  144pns 000257300D
 013 cmt-tran-type         002  145  145    B
 014 cmt-tran-ref          002  146  149 n  0102
 015 cmt-tran-amt          2/1  150  154pns 000514600C
 015 cmt-tran-amt          2/3  160  164pns 000029587D
 015 cmt-tran-amt          2/4  165  169pns 000266331C
 013 cmt-tran-type         003  170  170    C
 014 cmt-tran-ref          003  171  174 n  0103
 015 cmt-tran-amt          3/1  175  179pns 000404945C
 013 cmt-tran-type         004  195  195    D
 014 cmt-tran-ref          004  196  199 n  0104
 015 cmt-tran-amt          4/3  210  214pns 000003457C
 015 cmt-tran-amt          4/4  215  219pns 000004567D
 013 cmt-tran-type         005  220  220    E
 014 cmt-tran-ref          005  221  224 n  0105
 015 cmt-tran-amt          5/1  225  229pns 001234567D
 015 cmt-tran-amt          5/2  230  234pns 000002838C
 015 cmt-tran-amt          5/4  240  244pns 000008138C
 rec#=1 rcount=32 rsize=256 fsize=8192 fptr=0
 Enter command, or ?=Help, or null=NextRecord -->
Note
  • Compare this (with option i4) to the prior page (options g99o99 no i4)
  • option i4 inhibits all zero/blank field displays
  • try option 'i1' to inhibit ITEM occurs zero/blank fields (except 1st)
  • try option 'i2' to inhibit GROUP occurs zero/blank fields (except 1st)

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

1F1. demo uvhdcob with occurs DEPENDING ON

We will demo occurs 'DEPENDING ON' using the following files:

dat1/custran3
  • customer transactions occurs 0 to 5 depending on
mf/cpys/custran3
  • copybook for the above data file

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

 #2. uvcopy cobmap1,fili1=mf/cpys/custran3,filo1=mf/maps/custran3
     ============================================================
     - generate cobmap (1 copybook at a time, or use uvcopyx for all)

custran3 - cobmap to demo GROUP & ITEM occurs

 cobmap1  start-end bytes for cobol record fields    201108261300  pg# 0001
 mf/cpys/custran3                               RCSZ=00245  bgn  end  lth typ
 * custran3 - copybook for customer master & transaction file
 *          - variable length 0 to 4 sets of group occurs fie
 *          - to test uvhdcob occurs depending on
      10 cmt-num           pic  9(6).                         0000 0005  006 n  6
      10 cmt-delete        pic  x(4).                         0006 0009  004
      10 cmt-name          pic  x(25).                        0010 0034  025
      10 cmt-adrs          pic  x(25).                        0035 0059  025
      10 cmt-city          pic  x(16).                        0060 0075  016
      10 filler001         pic  x.                            0076 0076  001
      10 cmt-prov          pic  x(2).                         0077 0078  002
      10 filler002         pic  x.                            0079 0079  001
      10 cmt-postal        pic  x(10).                        0080 0089  010
      10 cmt-phone         pic  x(12).                        0090 0101  012
      10 cmt-contact       pic  x(16).                        0102 0117  016
      10 cmt-count         pic  s9(3) comp-3.                 0118 0119  002pns 3
 *BGNOCCURSM:c-p:00005*00025=00125:00120-00244:1:00118:02pns:
      10 cmt-trans occurs 0 to 5 depending on cmt-count.
         15 cmt-tran-type  pic  x.                            0120 0120  001
         15 cmt-tran-ref   pic  9(4).                         0121 0124  004 n  4
         15 cmt-tran-amt   pic  s9(7)v99 comp-3 occurs 4.     0125 0129  005pns 9
 * min lth 120 if no transctns, max 245 if all 5 transctns
 *ENDOCCURSM:c-p:00005*00025=00125:00120-00244:1:00118:02pns:
 *RCSZ=00245
  1. Note 'cmt-trans occurs 0 to 5 depending on cmt-count'. uvhdcob will retrieve the contents of cmt-count (from 2 byte packed field at byte 118) to control how many group occurs fields are displayed.

  2. Next page shows record #1 with all 5 occurrences (cmt-count = x'005C'), and record #4 with only 1 occurrence present (cmt-count = x'001C').

  3. Option 'z4' is specified since the dat1/custran3 file is RDW variable length which is usually used with 'occurs depending on' records.

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

1F2. demo uvhdcob with occurs DEPENDING ON

occurs depending on with options z4g99i4


 uvhdcob dat1/custran3 mf/maps/custran3 z4g99i4
 ==============================================
 rec#       1           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 cmt-num                      0    5 n  130140
 003 cmt-name                    10   34    EVERGREEN MOTORS LTD.
 004 cmt-adrs                    35   59    1815 BOWEN ROAD
 005 cmt-city                    60   75    NANAIMO
 007 cmt-prov                    77   78    BC
 009 cmt-postal                  80   89    V9S1H1
 010 cmt-phone                   90  101    250-754-5531
 011 cmt-contact                102  117     LARRY WRENCH
 012 cmt-count                  118  119pns 005C
 014 cmt-tran-type         001  120  120    A
 015 cmt-tran-ref          001  121  124 n  0101
 016 cmt-tran-amt          1/4  125  129pns 001234567C
 014 cmt-tran-type         002  145  145    B
 015 cmt-tran-ref          002  146  149 n  0102
 016 cmt-tran-amt          2/4  150  154pns 000514600C
 014 cmt-tran-type         003  170  170    C
 015 cmt-tran-ref          003  171  174 n  0103
 016 cmt-tran-amt          3/4  175  179pns 000404945C
 014 cmt-tran-type         004  195  195    D
 015 cmt-tran-ref          004  196  199 n  0104
 014 cmt-tran-type         005  220  220    E
 015 cmt-tran-ref          005  221  224 n  0105
 016 cmt-tran-amt          5/4  225  229pns 001234567D
 rec#       4           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 cmt-num                      0    5 n  142175
 003 cmt-name                    10   34    LILLY ELECTRIC (1973) LTD
 004 cmt-adrs                    35   59    16809 - 24TH AVENUE
 005 cmt-city                    60   75    HOPE
 007 cmt-prov                    77   78    BC
 009 cmt-postal                  80   89    V4B5E7
 010 cmt-phone                   90  101    604-534-9787
 011 cmt-contact                102  117     FRITZ BERNAUS
 012 cmt-count                  118  119pns 001C
 014 cmt-tran-type              120  120    A
 015 cmt-tran-ref               121  124 n  0401
  1. We used options 'z4g99i4' to minimize the display & get 2 records on 1 page.

  2. Omitting 'o99' (as per '1E3') defaults to 'o1', shows only 1st ITEM occurs. Specifying 'g99' shows all group occurs (for depending on). Specifying 'i4' omits any zero/blank fields to minimaize display. (see all fields displayed on page '1E3').

  3. See the actual data records on the next page (using uvhd vs uvhdcob).

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

1F3. demo uvhdcob with occurs DEPENDING ON

uvhd display of occurs depending on records

Here we will show you the actual data records (using uvhd vs uvhdcob), to illustrate the variable-length records & prove that the 'occurs depending on' field at byte 118(2p) does in fact control the length of each record.


 uvhd dat1/custran3 z4
 =====================
 rec#=1 rsize=249 fptr=0 fsize=6068 rcount=32
                      10        20        30        40        50        60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 ....130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD
             0F00333333222245454544424454552454222223333244544254442222222222
             0900130140000056527255E0DF4F230C44E0000181502F75E02F140000000000
          64 NANAIMO          BC V9S1H1    250-754-5531 LARRY WRENCH   .\A010
             4444444222222222244253534322223332333233332445552554444222054333
             E1E19DF00000000002306931810000250D754D55310C12290725E380000C1010
         128 1..4V|............W0.B0102...`........)X}..f3.C0103....\........
             3013570000000000005304333300160000000025700631433330009500000000
             10246C0000C0000C0270D201020540C0000C0098D0263C301030444C0000C000
         192 .......D0104.............E|...V}E0105..4V}...............
             000000043333000000000000047000574333301357000880000000018
             0C0000C401040000C0000C0035C0046D501050246D0023C0000C0083C
 rec#=4 rsize=149 fptr=697 fsize=6068 rcount=32
                      10        20        30        40        50        60
 r#        4 0123456789012345678901234567890123456789012345678901234567890123
         697 ....142175    LILLY ELECTRIC (1973) LTD16809 - 24TH AVENUE
             0900333333222244445244445544223333224543333322233542454454222222
             05001421750000C9CC905C53429308197390C44168090D024480165E55000000
          64 HOPE             BC V4B5E7    604-534-9787 FRITZ BERNAUS  ..A040
             4454222222222222244253434322223332333233332454552445445522014333
             8F0500000000000002306425570000604D534D978706294A0252E153000C1040
         128 1............v.......
             300000000000171800000
             10000C0000C0065C0000C
  1. Note the occurs depending on field near the end of displacement '64' lines just prior to 'A010' on 1st record & 'A040' on 4th record.

  2. cmt-count at 118(2p) is x'005C' for 1st record & x'001C' for 4th record (using horizontal hex vs the vertical hex displayed by uvhd).

  3. uvhd option 'z4' shows the RDW (variable length in binary 4 byte prefix). Record#1 x'00F9' = 15*16+9 = 249 & Record#4 x'0095' = 9*16+5 = 149.

  4. Since uvhd shows the 4 byte RDW prefix, the depending on field is shown at displacement 122 vs 118 as shown by uvhdcob on the pevious page.

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

1G1. demo uvhdcob with multiple "ODO"s

uvhdcob can handle multiple "occurs depending on". You can demo using datafile $UV/dat1/custran4 & copybook $UV/mf/maps/custran4 which has 2 'ODO's.


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

 #2. uvcopy cobmap1,fili1=mf/cpys/custran4,filo1=mf/maps/custran4
     ============================================================

custran4 - cobmap with 2 'ODO's

 cobmap1  start-end bytes for cobol record fields    201111031456  pg# 0001
 mf/cpys/custran4                               RCSZ=00370  bgn  end  lth typ
 * custran4 - copybook for customer master & transaction file
 * - variable length with 2 sets of group occurs fields
 * - to test uvhdcob with multiple 'occurs depending on'
      10 cmt-num           pic  9(6).                         0000 0005  006 n  6
      10 cmt-delete        pic  x(4).                         0006 0009  004
      10 cmt-name          pic  x(25).                        0010 0034  025
      10 cmt-adrs          pic  x(25).                        0035 0059  025
      10 cmt-city          pic  x(16).                        0060 0075  016
      10 filler001         pic  x.                            0076 0076  001
      10 cmt-prov          pic  x(2).                         0077 0078  002
      10 filler002         pic  x.                            0079 0079  001
      10 cmt-postal        pic  x(10).                        0080 0089  010
      10 cmt-phone         pic  x(12).                        0090 0101  012
      10 cmt-contact       pic  x(14).                        0102 0115  014
      10 cmt-count1        pic  s9(3) comp-3.                 0116 0117  002pns 3
      10 cmt-count2        pic  s9(3) comp-3.                 0118 0119  002pns 3
 *BGNOCCURSM:c-p:00005*00025=00125:00120-00244:1:00116:02pns:
      10 cmt-trans1 occurs 0 to 5 depending on cmt-count1.
         15 cmt-tran1-type  pic  x.                           0120 0120  001
         15 cmt-tran1-ref   pic  9(4).                        0121 0124  004 n  4
         15 cmt-tran1-amt   pic  s9(7)v99 comp-3 occurs 4.    0125 0129  005pns 9
 *ENDOCCURSM:c-p:00005*00025=00125:00120-00244:1:00116:02pns:
 *BGNOCCURSM:c-p:00005*00025=00125:00245-00369:1:00118:02pns:
      10 cmt-trans2 occurs 0 to 5 depending on cmt-count2.
         15 cmt-tran2-type  pic  x.                           0245 0245  001
         15 cmt-tran2-ref   pic  9(4).                        0246 0249  004 n  4
         15 cmt-tran2-amt   pic  s9(7)v99 comp-3 occurs 4.    0250 0254  005pns 9
 * min lth 120 no transctns, max 370 if all 5 transctns * 2 s
 *ENDOCCURSM:c-p:00005*00025=00125:00245-00369:1:00118:02pns:
 *RCSZ=00370

We will not show the outputs of uvhd & uvhdcob here, but you can see as follows:


 uvhd /home/uvadm/dat1/custran4 z4   <-- inspect data file with uvhd
 =================================

 uvhdcob dat1/custran4 mf/maps/custran4 z4g99o99i4
 =================================================
 - display uvhdcob with 2 ODO's

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

1G2. demo uvhdcob with 2 levels of group occurs

uvhdcob can handle 2 levels of group occurs. You can demo using datafile $UV/dat1/custran6 & copybook $UV/mf/maps/custran6 with 2 levels of ODOs.


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

 #2. uvcopy cobmap1,fili1=mf/cpys/custran6,filo1=mf/maps/custran6
     ============================================================

custran6 - 2 levels of group occurs

 cobmap1  start-end bytes for cobol record fields    201111031456  pg# 0001
 mf/cpys/custran6                               RCSZ=00256  bgn  end  lth typ
 * custran6 - copybook for customer master & transaction file
 *          - alt version of custran2 with nested group occur
      10 cmt-num             pic  9(6).                       0000 0005  006 n  6
      10 cmt-delete          pic  x(4).                       0006 0009  004
      10 cmt-name            pic  x(25).                      0010 0034  025
      10 cmt-adrs            pic  x(25).                      0035 0059  025
      10 cmt-city            pic  x(16).                      0060 0075  016
      10 filler001           pic  x.                          0076 0076  001
      10 cmt-prov            pic  x(2).                       0077 0078  002
      10 filler002           pic  x.                          0079 0079  001
      10 cmt-postal          pic  x(10).                      0080 0089  010
      10 cmt-phone           pic  x(12).                      0090 0101  012
      10 cmt-contact         pic  x(18).                      0102 0119  018
 *BGNOCCURSM:c-p:00005*00025=00125:00120-00244:1:
      10 cmt-trans occurs 5.
         15 cmt-tran-type    pic  x.                          0120 0120  001
         15 cmt-tran-ref     pic  9(4).                       0121 0124  004 n  4
 *BGNOCCURSS:--p:00002*00010=00020:00125-00144:2:
         15 cmt-tran-amt occurs 2.
            20 cmt-tran-amt1 pic s9(7)v99 comp-3.             0125 0129  005pns 9
            20 cmt-tran-amt2 pic s9(7)v99 comp-3.             0130 0134  005pns 9
 *ENDOCCURSS:--p:00002*00010=00020:00125-00144:2:
 *ENDOCCURSM:c-p:00005*00025=00125:00120-00244:1:
      10 filler003           pic  x(11).                      0245 0255  011
 *RCSZ=00256

We will not show the outputs of uvhd & uvhdcob here, but you can see as follows:


 uvhd /home/uvadm/dat1/custran6 z4   <-- inspect data file with uvhd
 =================================

 uvhdcob dat1/custran6 mf/maps/custran6 g99o99i4
 ===============================================
 - display uvhdcob with 2 levels of group occurs

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

1I1. uvhdcob: Operating Instructions & Command Line Options

uvhdcob command line & options


 uvhdcob datafile cobmap(copybook-layout) [options]   <-- format
 ==================================================

 uvhdcob dat1/custmas1 mf/maps/custmas1   <-- demo datafile & copybook
 ======================================

 uvhdcob dat1/custmas1 mf/maps/custmas1 r257  <-- option 'r' for Record size
 ===========================================    - overrides RCSZ=... in cobmap

If the 'r' record-size option is omitted, the rcsz will be picked up from the 'RCSZ=value' in the cobmap file. If indexed, (datafile.idx present), then rcsz is incremented by 1, to allow for the x'0A' delete flag on end of ISAM records.

RCSZ override for ISAM records only required if indexed file naming conventions not followed (data suffix '.dat' & index suffix '.idx').


 uvhdcob dat1/custmas0 mf/maps/custmas1 r257am50  <-- example multiple options
 ===============================================
option 'r257'
  • Record size override (discussed above)
option 'a'
  • translate to Ascii (dat1/custmas0 file is EBCDIC)
option 'm50'
  • display 50 lines per screen (if your teminal allows)
  • or max fields in copybook/record
Note
  • options must be a contiguous string of alpha options & numeric values
  • numeric values optional ('a' for ASCII translate does not need)
  • may use comma separators

*TYPE control record

cobmap may specify record types on *TYPE comment lines, to cause display screens to start with the first cobmap fieldname matching the fieldname on the *TYPE statements, for example:

*TYPE=0(1),='N','NAME-RECORD' <-- data records with 'N' in byte 0 *TYPE=0(1),='P','PAY-RECORD' <-- data records with 'P' in byte 0

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

1J1. inter-operation of uvhdcob & uvhd

The exit command of uvhdcob allows you to easily switch from uvhdcob to uvhd. You will sometimes need to uvhd to display the entire record because:

  1. uvhdcob displays only the 1st 36 bytes of long data fields
  2. uvhdcob displays only the 1st occurrence of occurs field sets.
  3. uvhdcob might display the wrong fieldnames for redefined records (if you have not inserted *TYPE control records in copybook/cobmaps)

 uvhdcob dat1/custmas1 mf/maps/custmas1  <-- start uvhdcob, then exit to uvhd
 ======================================
 uvhdcob datafile=dat1/custmas1
 20090222:0844 copybook=mf/maps/custmas1 options=
 record#=1 totalrecs=32 recsize=256 filesize=8192 fileptr=0
 rec#       1 fieldname occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 cm-num                       0   5 n  130140
 002 cm-delete                    6   9
 003 cm-name                     10  34    EVERGREEN MOTORS LTD.
 004 cm-adrs                     35  59    1815 BOWEN ROAD
 005 cm-city                     60  75    NANAIMO
 006 filler001                   76  76
 007 cm-prov                     77  78    BC
 008 filler002                   79  79
 009 cm-postal                   80  89    V9S1H1
 010 cm-phone                    90 101    250-754-5531
 011 cm-contact                 102 119     LARRY WRENCH
 012 cm-thisyr-sales       012  120 124pns 001234567C
 013 cm-lastyr-sales       012  180 184pns 001234567D
 014 filler003                  240 255    C 19950531
 rec#=1 rcount=32 rsize=256 fsize=8192 dat1/custmas1
 null=next,r#=rec,s=search,u=update,x=undo,p=print,i=iprint,w=write,t=tally
 ,v=verify,c=chkseq#,e=exit to uvhd,q=quit,?=help --> e <-- Exit to uvhd
                      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
 rec#=1 rcount=32 rsize=256 fsize=8192 tmp1/cm1
 null=next,r#=rec,s=search,u=update,x=rollback,p=print,i=iprint,w=write,e=count
 ,g=genseq#,c=chkseq#,t=translate(ta=Asc,te=Ebc,tu=Upr,tl=Lwr,tc=Chars,tp=Pers)
 ,R#=Recsize,h1=char,h2=hex,q=quit,?=help --> q <-- quit uvhd, return to uvhdcob

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

Part_2 uvhdcob: commands (HELP screens)

2H01. Help Menu, uvhdcob version 20140425

2H01. Help Menu Summary (enter # to goto desired help screen) 2H02. uvhdob command format (datafile, copybook,& options) 2H03. command line options a - t 2H04. command line options u - z 2H05. Browsing, jump to rec# or byte# (fixed-lth), find by rec# (var-lth) 2H06. Searching by data strings with optional qualifiers 2H07. Update 1 or multiple records, with optional qualifiers 2H08. Update/Clear record areas to the 1 byte specified by op2 2H09. Accumulate(a) record field (zoned/packed/binary)(all or qualified) 2H10. print to a file (option 'i' to schedule lp if configured) 2H11. write records to subdir $UVTMPDIR/... (selected by qualifier patterns) 2H12. Write options (recsize, fixlth, text, RDW, etc) 2H13. sequence check & tally (count records) 2H14. Verify data: digits/signs in numeric/packed, unprintables chars 2H15. option z correct blanks in numeric/packed & unprintables in pic x 2H16. Move character (m) & move Numeric (n) 2H17. Move Application - create Telephone list from customer master 2H18. konvert among numeric formats (zoned,packed,binary/hex) 2H19. Exit to uvhd (hexdump of record, quit uvhd returns to uvhdcob) 2H20. set Item/Group Occurs display & Inhibit zero/blank fields 2H21. Multi Record *TYPE files (type control record in copybook maps) 2H22. Index file saved in $UVTMPDIR/..., saves for next uvhd same file&size uvhdcob version 20140425 - Copyright (C) UV Software Inc. 1993-2014 see complete documentation at: www.uvsoftware.ca/uvhdcob.htm

2H02. command format & options


 uvhdcob    datafile     copybook-map   [options]   <-- uvhdcob format
 ================================================

 uvhdcob dat1/custmas1 mf/maps/custmas1 r256m50u <-- example
 ===============================================
 options 'r256m50u' - must be contiguous (alpha+digits+alpha+digits+...)
          r256      - rec-size, omit to use RCSZ= in map, specify to override
              m50   - max lines per screen, default 25, use 50 for PC terminal
                 u  - allow Updates (specify on command line if update intent)

 uvhdcob dat1/custmas1 mf/maps/custmas1   <-- may omit reciord-size
 ======================================       if copybook/map correct
 R#    - change Rec-size (Fixed-lth) vs option 'r' on command line
 ?     - display help screens

 uvhdc2 dat1/custmas1  <-- uvhdc2 format - uvhdc2 script omits copybook-map
 ====================      via ctlfile54I relating datafile to copybook-map
                         - may specify options as arg2 to override defaults
 Note - uvhdc2 script needs to be setup & customized at each site
      - see www.uvsoftware.ca/uvhdcob.htm#K1 - K6

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

2H03. command line options

 a   - Assume EBCDIC input, translate char fields to ASCII display
 b#  - Begin display with this record# (vs default #1)
 c1  - show field begin/end 1 relative vs 0 rel (assumes copybook is 0 rel)
 d1  - display Debug msgs for cobmaps with multi *TYPE defs
 d2  - insert record# at begining of each field for uvhdcobdif2 script
 e1  - inhibit Errmsg when file-size not evenly divisible by record-size
 f1  - build Index for Variable-Length files (BDW/RDW,IDXf8,text)
     - build Index for Fixed-Length files NOT required, can calc fileptrs
 f0  - inhibit Index build (save time if only need to see 1st few records)
 f3  - force Index re-build even if existing & filesize unchanged
 g#  - Group occurs display desired, default 1st only, g99 for copybook max
     - Group & Item occurs may also be set by commands g & o, see H19
 i1/2/4 - inhibit display zero/blank entries, i1=Item occurs,i2=Group,i4=ALL
        - inhibit 0/b entries may also be set by command i, see H19
 j=..- command to execute & exit from uvhdcob - for example:
       uvhdcob dat1/custmas1x mf/maps/custmas1 j=v99p99x7
       options j=v99p99x7 verifies all records, writes invalids to tmp & quits
 m#  - Max lines/screen (default 16) allow for hex/char, sp1/sp2
 o#  - Item Occurs display desired, default 1st only, o99 for copybook max
     - may also enter desired group/item occurs g#/o# at the command prompt
 p#  - progress message interval (search,index) record count default 1000000
 r#  - Record size overrides RCSZ= in cobmap file  default 256
 s2  - Space 2 between headings & field names/data lines
 t   - Text records ended by LF=x'0A' (specify option r if recsize > 256)

2H04. command line options

u
  • allow Updates to file (will lock file) else read only
    applies to: Update,Move,& Verify option z correct blank numerics
u2
  • updates without file-lock (to allow Exit 'e' to uvhd)
v
  • Variable length records in Micro Focus Indexed file
    show recs: v1=active, v2=deleted, v4=system, v8=system1 (default=v7)
x1
  • inhibit validity check <-BadN on numeric fields
x2
  • inhibit validity check <-BadP on packed fields
x4
  • inhibit validity check <-BadC on character fields
x7
  • inhibit validity checks on all field types (x1+x2+x4=x7)
y_
  • option for signs in numeric fields for 'verify' (v) command
  • may specify on command line OR on each verify command
y1
  • MF COBOL comatible (default): -0123456789 = pqrstuvwxy (zones x'70')
y2
  • EBCDIC signs: +0123456789 = {ABCDEFGHI, -0123456789 = }JKLMNOPQR
y4
  • separate +/- signs (leading or trailing)
y1
  • default is y1 if input file is ASCII (default)
y2
  • default is y2 if input file is EBCDIC (option 'a' on command line)
z#
  • input RDW format (2,4,8 byte prefixes with recsize in binary)
z2
  • RDW prefix 2 bytes only, recsize EXCLUDES prefix size
z4
  • RDW prefix 4 bytes, recsize 1st 2, 3&4 nulls, recsize INCLUDES prefix
z8
  • BDW/RDW 4+4, BDW bypasswd, else like z4
z1
  • (+ 1 bit) = z3/z5/z9 Little-end binary, z2/z4/z8 default BIG-end

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

2H05. Browsing, Jumping, Finding

null
  • next record (or next segment if rcsz > 384)
b#
  • goto a specific byte# within the file (zero relative)
r#
  • goto a specific record# within the file (one relative)
  • may omit 'r', a number assumed to be a record# (if Fixed-length)
  • advance a specified # of records (from current position)
  • backup a specified # of records (from current position)
f#
  • find records by record# in LARGE variable length files (RDW,text,IDX)
f#
  • use 'f#' if you need exact record# in Large Variable-Length files
f#
  • uses an Index of record#s & filepointers to find records quickly
  • Index built at program startup if variable lth input (RDW,text,IDX3/8)
  • may omit 'f', find record# assumed if BDW/RDW variable length file
r1
  • might return to record #1 before using options m & n
f99m123
  • option 'm' to find record with specified record-size
f99m50n90
  • option 'm' & 'n' to find records from minimum to maximum size
  • 'f99' used to search to EOF (99 is short for 999999999)
ff
  • repeat prior find command, to find next rec with m & n size
ff
  • 'ff' saves retyping big numbers & options m & n

2H06. Search


 uvhdcob dat1/custmas1 mf/maps/custmas1  <-- run uvhdcob on customer master
 ======================================      data-file & copybook-map
s 'ABC'
  • search (until EOF) for 'ABC' anywhere in the record
s 40(40),'ABC'
  • search for 'ABC' anywhere in columns 41-80
s 20(3),!'000'
  • search for records with cols 21-23 NOT 000
s 0(80),=x'0C'
  • search for a FormFeed x'0C' anywhere in 1st 80 bytes
s 0(80),>x'7F'
    - search for any byte > x'7F' in 1st 80 bytes of records
s 'ABC',,'XYZ'
  • search for 'ABC' AND 'XYZ' anywhere in record
s 'ABC',|,'XYZ'
  • search for 'ABC' OR 'XYZ' anywhere in record

s 0(40),'AB',40(40),'CD' - search for 'AB' in cols 1-40 & 'CD' in cols 41-80 s 0(1),'1',|0(1),'9' - search for '1' OR '9' in byte 0 (col 1) s 0(1),'1',|,'9' - same as above, op3 start(lth) defaults to op1 s 0(1),>'0',,<'9' - search for records wwith 1-8 in the 1st byte

ss
  • repeat last search (from current record)
sss
  • repeat search (in same record incrementing column)

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

2H07. Update


 uvhdcob dat1/custmas1 mf/maps/custmas1 r256u <-- must specify option 'u'
 ===========================================*     on command line
 u 0(3),'ABC'     - update 1st 3 bytes of current record to 'ABC'
 u 78(2),x'0D0A'  - update bytes 79 & 80 of current record to x'0D0A'
 uu               - repeat last update (on current record)
 u99 0(3),'ABC'         - update until EOF ('99' is short for 999999999)
 u99 10(1),'*',8(1),'D' - update byte 10 to '*', IF byte 8 is 'D'
 u99 8(1),'X',8(1),'D'  - change any 'D' in column 9 to 'X'
x
  • rollback last update to current rec (repeat toggles last update)
X
  • rollback all updates to current rec (repeat toggles all updts)
  • rollback ability is lost if you move off current updated record
  • no rollback is possible for multi-record updates
  • could 'w'rite (backup) entire file to tmpdir before updts
 u99s 77(2),'AB',,'AL' - update bytes 77-78 with 'AB' if currently 'AL'
    s        <-- note option 's' on 'u99s' saves update args in search args
 1               for subsequent reset to BOF (by goto record #1)
 ss          <-- and 'ss' to verify updates (without re-entering arguments)

2H08. Update/Clear


 uvhdcob dat1/vendormas3 mf/maps/vendormas z4u <-- options RDW & Update
 =============================================
 - update may clear large areas to the 1 byte op2 constant
 - specify op1 length as (99) to clear entire variable length records
u 0(99),x'00'
  • clear record to hex zeros, (99) indicates entire record
  • clear variable length records (except BDW/RDW prefixes)
u 4(99),x'00'
  • use 0(99) for uvhdcob, but 4(99) for uvhd since RDW shown
uu
  • repeat last update (after moving to new record)
X
  • rollback updates to current record
u99 0(99),'_'
  • clear all records to all underscores (assuming on record#1)
  • clears all bytes of all records (except BDW/RDW if variable)
X
  • NO rollback for multi-record updates
  • recommend backup/copy file before multi-record updates

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

2H09. Accumulate (a)


 uvhdcob dat1/custmas1 mf/maps/custmas1 r256 - customer mstr sales history
 ===========================================
                    - see custmas1 demofile at www.uvsoftware.ca/uvhd.htm#4A2
 a 120(5p)        <-- accum 5 byte packed field from current record until EOF
 =========
 1                                  <-- return to begin file before next acum
 a 120(5p),,77(2),'BC'              <-- acum if 'BC' in bytes 77-78
 a 120(5p),,77(2),'AB',|77(2),'YK'  <-- acum if 'AB' or YuKon
 a 120(5p),,77(2),'AB',|,'YK'       <-- acum if 'AB' or 'YK', omit 2nd 77(2)
 a 120(5p),,77(2),'BC',90(3),!'604' <-- acum if 'AB' and area code not=604
 ax12 120(5p)  <-- crossfoot & acum 12 x 5 byte packed fields (this yr sales)

 uvhdcob dat1/sales2 mf/maps/sales2 r64 - sales detail records
 ======================================
              - see sales2 demofile at www.uvsoftware.ca/uvhd.htm#4A3
 a 53(9)    <-- acum 9 bytes (assume unpacked Ascii, sign in zone or sep +/-)
 =======      - zone +sign x'3_', -sign x'7_' (Micro Focus COBOL compatible)
 a 53(9ze)  <-- acum 9 byte Zoned Ebcdic, +sign x'F_' or x'C_', -sign x'D_'
 =========    - do not need (_ze) if option 'a' on cmd line for EBCDIC input
 a 53(9zx)  <-- need (_zx) ASCII file with EBCDIC signs vs Micro Focus signs

2H10. print

print
  • write formatted records to a file for subsequent lp,uvlp,vi,etc
  • writes $UVTMPDIR/filename.yymmddhhmmP (concatenated for uvhd session)
 p5              - print 5 recs from current position
 p 'ABC'         - search for & print records with 'ABC' anywhere in record
 p5 0(40),'ABC'  - search & print 5 max with ABC within 1st 40 bytes
 p 40(3),e'ABC'  - print if EBCDIC 'ABC' 41-43 (use with cmdline a optn)
 p9f3            - print 9 records, formfeed after every 3rd record
 p <' '          - print records with any bytes < space char
 p5 0(40),<x'20' - print 5 max with any bytes < space in 1st 40 bytes
 p24f4           - print 24 records, formfeed after every 4th record
 pp              - repeat last print command (from current position)
 lp  <-- may follow print command with 'lp' command to close file for separate
         output files or omit for combined outputs from multi print commands
 p5i <-- option 'i' Immediate print (Aug2011 change to option vs command 'i')
       - calls script 'uvlp12' which schedules 'lp' to print the tmp/... file
         'export UVLPDEST=-dPRINTERNAME' in profile defines printer near you
       - see uvhd doc for more info on immediate printing

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

2H11. write records to $UVTMPDIR/...

 >>> write - write data records only for later use (test files,etc)
           - write output is written to $UVTMPDIR/filename.yymmddhhmmW
           - multiple write command outputs collected into 1 common file
           - writes start at current position & end at EOF (or max count)
 w5              - write (unformatted) 5 records from current position
 w ' SMITH '     - write records with ' SMITH ' anywhere in record
 w5 0(3),>'400'  - write 5 max records whose 1st 3 bytes > 400
 ww              - repeat last write command (from current position)
 w 77(2),'BC'    - select province BC in bytes 77-78 (zero relative)
 w 0(1),'2',0(64),'ABC' - write recs with '2' byte 0 & ABC anywhere in 0-64
 wi     - write entire file, dropping ISAM deleted records
          (option 'i' drops records with x'00' in last byte)
we10
  • write every 10th record (to make smaller test file ?)
w100e5
  • write 100 records, select every 5th (file must have 500+)
we10 77(2),'VA'
  • write every 10th rec with state = 'VA' (from here to EOF)
w100r64t2
  • sample Write command to Write next 100 records with options
  • r64=fixedsize 64 byte recs, t2=terminate with LF in last byte
w99z2a1c1
  • write next 99 recs in RDWz2 format (recsize in 2 byte prefix)
  • translate to ASCII, translate any unprintable chars to periods
  • see write options on next help screen

2H12. Write options

a1
  • translate to ASCII, write command output records
d#
  • displacement to 1st byte to be written
c1
  • convert unprintable chars in write output records to periods
n1
  • insert variable recsize as 4 numerics at BEGIN write output
n2
  • insert variable recsize as 4 numerics at END write output
r#
  • record size for fixed-length output, omit for RDWz2/z4
t1
  • insert Carriage-Return at end write records (for MAC)
t2
  • insert Line-Feed at end of write records (for Unix/Linux)
t3
  • insert both CR & LF at end write records (for some Windows programs)
t4
  • insert after Last-Non-Blank, else at end recsize (t6 for LF)
z#
  • write RDW format (2 or 4 byte prefixes with recsize in binary)
z2
  • prefix 2 bytes only, recsize EXCLUDES prefix size
z4
  • prefix 4 bytes, recsize 1st 2, 3&4 nulls, recsize INCLUDES prefix
z1
  • (add 1 bit) = z3/z5 Little-end binary, z2/z4 default BIG-end binary
w50d10r25t6
  • Write next 50 records, option d10=dsplcmnt to 1st byte to write
  • r25=recsize to write, t6=terminate LF after last nonblank
  • writes just customer name field of demo file dat1/custmas1
 lw  <-- may follow write command with 'lw' command to close file for separate
         output files or omit for combined outputs from multi write commands

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

2H13. sequence check & tally (count records)

 >>> check  - check sequence in specified field - until EOF or SEQUENCE ERR
 c  0(6)    - check sequence in columns 1-6, show 1st record out of sequence
 cd 0(6)    - check sequence descending (vs ascending default)
 ce 0(6)    - check seq equal not allowed (may use with ascending/descending)
 cc         - repeat last sequence check (from current position to EOF)
 >>> tally - count records from current point to EOF
 t                - count records from current position to EOF
 t 'ABC'          - count records with 'ABC' anywhere in record
 t500 10(3),'ABC' - count (within next 500 recs) recs with ABC in cols 11-13
 t 10(1),'A',77(2),'BC' - count records with 'A' col 11 AND 'BC' col 78-79
 t 8(1),'D',|8(1),'X'   - count records with 'D' OR  'X' col 9
 t 0(1),>'2',0(1),<'7'  - count records with 1st byte 3,4,5,or 6
 t 0(1),>'2',,<'7'      - same op3 omitted (,,) defaults same as op1
 ts 'ABC'    - count records with 'ABC' anywhere in record
  s        <-- note option 's' on 'ts' saves tally args in search args
 1             for subsequent reset to BOF (by goto record #1)
 ss          - and 'ss' to review selected records (w/o re-entering arguments)

2H14. Verify data fields

v99
  • verify Packed,Numeric,Character fields to EOF (99 short for 999999999)
  • will display 1st record found with bad data
  • shows packed fields in hexadecimal, with <-BadP note
  • replaces unprintable chars with '.'s & flags <--BadC or <--BadN
  • might print record for further investigation
vv
  • enter 'vv' to advance to next record & continue search/verify
v100
  • verify next 100 records vs until EOF (indicated by v99)
 ...x  - option 'x' no-stop-on-error, count for display at EOF (or max# spcfd)
 v99x1 - nostop on errors in numeric fields
 v99x2 - nostop on errors in packed fields
 v99x4 - nostop on errors in character (pic x) fields
 v99x3 - nostop on errors in numeric + packed fields
 v99x7 - nostop on errors in numeric + packed + character fields
 ...y  - option 'y' specify valid signs for numeric fields
 v99y1 - Micro Focus COBOL negatives: -0123456789=pqrstuvwxy x'70' zones
 v99y2 - EBCDIC signs: +0123456789={ABCDEFGHI, -0123456789=}JKLMNOPQR
 v99y4 - separate +/- signs (leading or trailing)
    y1 - default y1 if input file is ASCII (default)
    y2 - default y2 if input file is EBCDIC (option 'a' on command line)

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

2H15. Verify (continued)


 uvhdcob dat1/sales0 mf/maps/sales r64a  <-- sales0 is EBCDIC (option'a')
 ======================================    - recsize 64 (option 'r64')
 v99y2 - verify numeric fields with EBCDIC signs
       - no need to specify option 'y2', will default when input file EBCDIC
         (overriding default 'y1' when input file ASCII)
 ...z - option 'z' correct blank numeric/packed,& pic x with unprintable chars
 v99z1 - convert any all blank numeric fields to numeric zeros
 v99z2 - convert any all blank packed fields to packed zeros with x'_C' sign
 v99z4 - convert any any unprintable characters in pic x fields to '.' periods
 v99z7 - all of above
    abcdef - options to inhibit verify in 3 areas ID by offset from/to
 v99a120b239 - inhibit verify in all fields from dsplcmnt 120 to 239
             - to bypass known bad fields (to search for unknown bad fields)
 v99a100b120c200d220e300f320 - inhibit verify in 3 record areas max
v99x7p99
  • verify all records (v99) with option x7 for nostop (count only)
  • option 'p99' prints all errs to $UVTMPDIR/filename_yymmdd_hhmmssVP
  • option 'w99' writes all errs to $UVTMPDIR/filename_yymmdd_hhmmssVW
  • may follow with lvp/lvw to close files or omit to combine outputs

2H16. Move character & move Numeric


 uvhdcob dat1/custmas1 mf/maps/custmas1 r256u <-- must specify option 'u'
 ===========================================*     on command line
 m 35(12),90       <-- Move character (m), omit op2 lth assumes same as op1
 m 35(30),90(12)   <-- move 90-101 to 35-46, 47-64 extra op1 length blanked
 n 64(9z),120(5p)  <-- move Numeric (n), unpacks 5 bytes into 9 bytes Zoned
 n 130(5p),64(9z)  <-- move Numeric (n), 9 zoned bytes to 5 packed bytes)
 n 51(4b),120(5p)  <-- move Numeric, 5 bytes packed to 4 bytes binary
 n 140(5p),123456  <-- move Numeric value (length omitted) to 5 bytes packed
 n 64(9ze),120(5p) <-- move Numeric, unpacks 5 bytes into 9 bytes Zoned EBCDIC
                   - data type codes z/p/b (z default) 1st alpha after length
                   - Ascii/Ebcdic codes a/e (a default) 2nd alpha after length
 n 120(5p),0,,77(2),='BC' <-- clear 5 bytes packed (move 0) if province 'BC'
                            - conditional moves via qualifiers in op3-op6
 n99 120(5p),0 <-- clear this yr Jan sales in all records (99 means 999999999)
                 - use m99/n99 to move on all records until EOF reached
 x             <-- use 'x/X' to rollback (only for moves on 1 record)

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

2H17. Move Application

 Move Example - create Telephone-List from custmas1 demo file (layout follows)
 00-05 cust, 10-34 cust-name, 35-89 address, 90-91 tel#, 120-240 packed fields
 desired: move tel# after cust-name, blank fill,& write 64 byte text records
              - see this example illustrated at www.uvsoftware.ca/uvhd.htm#4K1

 cp dat1/custmas1 tmp/cm1  <-- 1st copy custmas1, rename (not final output)
 ========================

 uvhdcob tmp/cm1 mf/maps/custmas1 r256u <-- specify option 'u'
 =====================================*

 m99 35(30),90(12)         <-- Move tel# after cust-name & blank to 64
 ==================          - on all records (99 short for 999999999)

 w99r64t6                  <-- Write, max Recsize 64, Textfile option 't6'
 =========                   - t6 appends LF after last nonblank

 cp tmp/cm1_yymmdd_hhmmssW dat1/tellist <-- copy/rename date_time_stamped
 ======================================     tmp file output as desired

2H18. konvert numeric,packed,binary/hex

 'k' converts between numeric formats (zoned, packed, binary/hex)
   - results displayed only, records not updated, programmer convenience

 uvhdcob dat1/testbnp1 mf/maps/testbnp1 r128 <-- demo binary,numeric,packed
 ===========================================
                  10        20        30        40        50        60
 r#    1 0123456789012345678901234567890123456789012345678901234567890123
       0 0000001 0000256 0004096 0065536 1048576 .... .... .... .... ....
         3333333233333332333333323333333233333332000020000201002000020010
         0000001000002560000409600065536010485760100000100000000001000000
      64 ....... .....%l ......l ....eSl ....HWl .... .... .... .... ....
         0000001200000262000000620000656200014562000020000200102000020100
         000000C0000005C0000049C0000053C0000087C0000100010000000010000000
 Binary 40(4b),45(4b),50(4b),55(4b),60(4b) are Little-End (Intel,x86 Solaris)
 Binary 104(4b),109(4b),114(4b),119(4b),124(4b) Big-End (Sparc,AIX,HPUX,RISC)
 k 40(4b) =1, k 45(4b) =256, k 50(4b) =4096, k55(4b) =65536, k60(4b) =1048576
 k 40(4b)   --> 1          <-- x'01000000' on little-End machines (Intel, this doc)
 k 40(4bs)  --> 16,777,216 <-- option 's' Switch ends, shows value on other end
 k 104(4b)  --> 16,777,216 <-- x'00000001' on Big-End machines (AIX,SPARC,HPUX)
 k 104(4bs) --> 1          <-- option 's' on Big-End shows little-end value
 k x'00010000' --> 256 <-- may also enter a constant to convert (hex to numeric)
 kh4 '256'     --> 00010000 <-- convert numeric constant to Hex 4 bytes

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

2H19. Exit to uvhd & return to uvhdcob

 >>>Exit - exit to uvhd, to display data record without COBOL fieldnames
      - to see fields longer than 36 bytes
      - or all occurrences of occurs (uvhdcob can do, but more lines)
e
  • exit to uvhd (to display entire record w/o fieldnames)
  • will display same record
eu
  • may specify options (eg: u=update)
q
  • quit (in uvhd) returns you to uvhdcob

lw/lp/lvw/lvp separate or combined write/print files

 lw  <-- may follow write command with 'lw' command to close file for separate
         output files or omit for combined outputs from multi write commands
 lp  <-- similar command close print files for separate or omit for combined
 lvw <-- similar command close verify writes for separate or omit for combined
 lvp <-- similar command close verify prints for separate or omit for combined

2H20. Occurs display & Inhibit 0/b fields

o1
  • display only 1st of Item occurs (default)
  • Item occurs on same line as pic (vs Group occurs)
o99
  • display all Item occurs (as specified in copybook/map)
o3
  • display only 1st 3 fields of Item occurs
g1
  • display only 1st of Group occurs (default)
g99
  • display all Group occurs (as specified in copybook/map)
g3
  • display only 1st 3 fields of Group occurs

set Inhibit zero/blank fields

i1
  • Inhibit display zero/blank fields of Item occurs
i2
  • Inhibit display zero/blank fields of Group occurs
i4
  • Inhibit display all zero/blank fields (includes Item/Group occurs)
i4
  • use option 'i4' to see only significant fields of large records
  • dropping zero/blank fields to see more info on each screen

o5i1 - may specify 0/b display inhibit options on 'o' or 'g' commands o5g5i3 - may specify occurs & inhibit display options on uvhdcob command line

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

2H21. Multi Record *TYPE files

cobmap may specify record types on *TYPE comment lines, for example: *TYPE=0(1),=C'P','PAY-RECORD' <-- 'P' 1st byte displays pay-record fields *TYPE=0(1),='T','TIME-RECORD' <-- 'T' 1st byte displays time-record fields *TYPE=0(1),='H','HDR-RECORD' <-- 'H' 1st byte displays hdr-record fields *TYPE=0(1),!'H','HDR-RECORD' <-- last entry !not= for EOF display short rec *TYPE=0(1),=X'FF','HEX-RECORD' <-- may code TYPE as HEX constant

 *TYPE - starts display with 1st cobmap fieldname matching fieldname
       - insert *TYPE control records at begin copybook with redefined records
       - then rerun cobmap1 to convert copybooks to cobmap record layouts
       - do not insert in cobmaps (would be lost when cobmap1 rerun)
       - see details at www.uvsoftware.ca/uvhdcob.htm#J1 - J2

Alternate TYPE format for variable length records

 *TYPE=0:45,'VEN-NAME' <-- Alt format for variable length (RDW,IDXf3/8,text)
                         - identify type by record size range
 *TYPE=46:99,'VEN-PAY' <-- ven-pay layout if size 46:99, ven-name if 0:45

2H22. Index file saved for re-use


 uvhdcob dat1/vendormas3 mf/maps/vendormas z4  <-- demo uvhd RDW testfile
 ============================================
 vi $UVTMPDIR/uvhdindex_vendormas3 <-- investigate saved Index file
 =================================   - sample Index save file listed below

 #01:uvhdindex_vendormas3
 #02:filesize=249,options=z4
 #03:IndexCreated=110429_075017,BuildTimeSeconds=0
 #04:BDWmin=0,BDWmax=0,BDWavg=0,Blocks=0
 #05:RCSZmin=23,RCSZmax=45,RCSZavg=31,Records=8
 #06:1=0,2=23,3=53,4=98,5=129,6=158,7=185,8=219,8=249,

End 22 help screens, enter desired#, or null to exit help --> uvhd version=20140425, machine=LNX, H32/H64=H64

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

Part_3 uvhdcob - display data files with COBOL field names

Part 3 - Contents


3A1. Demo uvhdcob with various filetypes
- Fixed-EBCDIC, Fixed-ASCII, Variable-Text, Variable-RDW,
Indexed-Fixed, Indexed-variable
- Copybooks for the demo Data Files
  sample copybooks for vendormas & vendorpay

3A2. uvhdcob demo for vendorpaymas (multi record type file)
- vendor master records & vendor payment records
- '*TYPE' control records inserted in copybook/cobmap

3A3. Alternate method to identify multi-record types
- by different record-sizes (vs record-ID fields)
- demo for vendorpaymasa

3B1. demo Data-Files
- Fixed-EBCDIC, Fixed-ASCII, Variable-Text, Variable-RDW, Indexed
- vendormas0,vendormas1,vendormas2,vendormas3,vendormas4,vendormas5,vendormas6

3B2. Listings of demo Data-Files
 (Text versions only, need uvhd/uvhdcob for other types)
- dat1/vendormas2, dat1/vendorpay2

3B3. dat1/vendorpaymas2
multi-record-types (masters & payments)

3C1. preparation to demo uvhdcob for various filetypes
- login to your homedir & copy demo files

3C2. Create 6 types of fixed/variable length files using uvcp/uxcp
- use vi editor to create the text file (vendormas2)
- use 'uvcp/uxcp' to convert the text file into 5 other types
uvcp typ=RSF
  • for vendormas0 Fixed length EBCDIC file
uvcp typ=RSF
  • for vendormas1 Fixed length 64 bytes ASCII file
uvcp typ=RDW
  • for vendormas3 RDW variable length file
uvcp typ=IDXf1
  • for vendormas4 Micro Focus fixed-length Indexed file
uvxp typ=IDXf3v
  • for vendormas5 Micro Focus varlth 2 part .dat & .idx
uvxp typ=IDXf8v
  • for vendormas6 Micro Focus varlth single partition file

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

Part 3 Contents continued


3D1. uvhdcob demo for EBCDIC fixed lengh (vendormas0)

3D2. uvhdcob demo for ASCII fixed length (vendormas1)
uvhdcob demo for Text variable length (vendormas2)

3D3. uvhdcob demo for RDW variable length (vendormas3)
- with binary record size in 4 byte record prefixes

3D4. use uvhd to show RDW record-prefixes with binary record-sizes

3D5. alternative way to list RDW file with record-prefixes
uvcopy listRDW1 - converts binary recsizes to decimal

3D6. uvhdcob demo for IDXFORMAT1/3/8 files
- Micro Focus COBOL Indexed files (fixed & variable)

3D7. uvhdcob demo for Micro Focus Fixed-length files (IDXFORMAT1)

3D8. uvhdcob demo for Micro Focus variable-length files (IDXFORMAT3)

3D9. uvhdcob demo for Micro Focus variable-length files (IDXFORMAT8)

3E1. Multi-Record-Type files (Redefined records)
'*TYPE's inserted in copybooks/cobmaps to ID different daata records

3E2. Rules for coding record 'type' statements (inserted at begin copybook)

3E3. Sample display for dat1/vendorpaymas1 & maps/vendorpaymas

3E4. May use 'type's with various data-file-types (Ebcdic,Ascii,Fixed,Text,RDW)

3E5. May use for partially redefined records.

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

3A1. uvhdcob - display data-files with COBOL copybook field-names

copybooks for the demo datafiles

We will demo uvhdcob for various filetypes (Fixed, Text, RDW, IDXFORMAT3/8) using the following data files & copybooks. We will list the copybooks first since they are common to the 4 different filetypes.

dat1/vendormas
  • copybook for Vendor Master file
  • vendor#, Record Type, vendor name
  • see copybook/map listed below
dat1/vendorpay
  • copybook for Vendor Payment file
  • vendor#, Record Type, date, invoice, amount, item dscrptn
  • see copybook/map listed below
dat1/vendorpaymas
  • copybook for Vendor Payments sorted with Vendor Masters
  • Multi-Record-Type file to demo uvhdcob *TYPE control
  • see copybook/map with redefined records listed below
dat1/vendorpaymasa
  • Alternate copybook for Vendor Payments & Vendor Masters
  • Multi-Record-Type control by record-size vs record-codes
  • see copybook/map with redefined records listed below

mf/maps/vendormas

 cobmap1  start-end bytes for cobol record fields    201006071317  pg# 0001
 mf/cpys/vendormas.cpy       vendormas          RCSZ=00064  bgn  end  lth typ
 * vendormas - cobol copybook for vendormas1/2/3/4 data files
 *           - demo uvhdcob on 1=fixed, 2=text, 3=rdw, 4=idx3
 *           - by owen townsend, uv software, June 7/2010
  01  vendormas.
      10 venmas-num     pic  x(6).                            0000 0005  006
      10 venmas-type    pic  x(4).                            0006 0009  004
      10 venmas-name    pic  x(54).                           0010 0063  054
 *RCSZ=00064

mf/maps/vendorpay

 cobmap1  start-end bytes for cobol record fields    201006071317  pg# 0001
 mf/cpys/vendorpay.cpy       vendorpay          RCSZ=00064  bgn  end  lth typ
 * vendorpay - cobol copybook for vendorpay1/2/3/4 data file
 *           - demo uvhdcob on 1=fixed, 2=text, 3=rdw, 4=idx3
 *           - by owen townsend, uv software, june 7/2010
  01  vendorpay.
      10 venpay-num     pic  x(6).                            0000 0005  006
      10 venpay-type    pic  x(4).                            0006 0009  004
      10 venpay-date    pic  x(10).                           0010 0019  010
      10 venpay-inv     pic  x(10).                           0020 0029  010
      10 venpay-amt     pic  9(9).                            0030 0038  009 n  9
      10 filler001      pic  x(1).                            0039 0039  001
      10 venpay-item    pic  x(24).                           0040 0063  024
 *RCSZ=00064

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

3A2. copybooks for the demo datafiles

mf/maps/vendorpaymas

 cobmap1  start-end bytes for cobol record fields    201006071317  pg# 0001
 mf/cpys/vendorpaymas.cpy    vendormas          RCSZ=00064  bgn  end  lth typ
 * vendorpaymas - cobol copybook for vendorpaymas1/2/3/4 data
 *           - demo uvhdcob on 1=fixed, 2=text, 3=rdw, 4=idx3
 *           - by owen townsend, uv software, june 7/2010
 * - copybook stored at /home/uvadm/mf/cpys/vendorpaymas.c
 * to demo uvhdcob on multi-record-type files
 * - identified by record-type m/p in col8 dat1/vendorpaymas1
 *   (also see alternate 'vendorpaymasa' identifies by record
 *type=7(1),='M','vendormas'
 *type=7(1),='P','vendorpay'
 *type=7(1),!'x','badrecordtype'
  01  vendormas.
      10 venmas-num     pic  x(6).                            0000 0005  006
      10 venmas-type    pic  x(4).                            0006 0009  004
      10 venmas-name    pic  x(54).                           0010 0063  054
 *RCSZ=00064
 cobmap1  start-end bytes for cobol record fields    201006071317  pg# 0002
 mf/cpys/vendorpaymas.cpy    vendorpay          RCSZ=00064  bgn  end  lth typ
  01  vendorpay.
      10 venpay-num     pic  x(6).                            0000 0005  006
      10 recpay-type    pic  x(4).                            0006 0009  004
      10 venpay-date    pic  x(10).                           0010 0019  010
      10 venpay-inv     pic  x(10).                           0020 0029  010
      10 venpay-amt     pic  9(9).                            0030 0038  009 n  9
      10 filler001      pic  x(1).                            0039 0039  001
      10 venpay-item    pic  x(24).                           0040 0063  024
 *RCSZ=00064

Notes re *TYPE

      *type=7(1),='M','vendormas'
      *type=7(1),='P','vendorpay'
      *type=7(1),!'x','badrecordtype'
  1. Note the '*type' controls inserted at begining of copybook to identify the different Record Types & display the corresponding field-names and data-field-contents.

  2. Also note that '*type' can be coded to identify records by record-length vs record-data. See an example of this (mf/cpys/vendormapmasa) listed on the next page. Its '*type' controls are:

      *type=00:45,'vendormas'
      *type=46:99,'vendorpay'

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

3A3. copybooks for the demo datafiles

mf/maps/vendorpaymasa

Note
  • this is the Alternate method of record *TYPE control
  • by 'record-size' vs 'record-type-codes' (see above vendorpaymasa)
 cobmap1  start-end bytes for cobol record fields    201006071317  pg# 0001
 mf/cpys/vendorpaymasa.cpy   vendormas          RCSZ=00064  bgn  end  lth typ
 * vendorpaymasa - cobol copybook for vendorpaymas1/2/3/4 dat
 *           - demo uvhdcob on 1=fixed, 2=text, 3=rdw, 4=idx3
 *           - by owen townsend, uv software, june 7/2010
 * - copybook stored at /home/uvadm/mf/cpys/vendorpaymas.c
 * to demo uvhdcob on multi-record-type files
 * - this 'vendorpaymasa' is alternate copybook to 'vendorpay
 *   with *type controls by record-size vs record-type-data
 *type=00:45,'vendormas'
 *type=46:99,'vendorpay'
  01  vendormas.
      10 venmas-num     pic  x(6).                            0000 0005  006
      10 venmas-type    pic  x(4).                            0006 0009  004
      10 venmas-name    pic  x(54).                           0010 0063  054
 *RCSZ=00064
 cobmap1  start-end bytes for cobol record fields    201006071317  pg# 0002
 mf/cpys/vendorpaymasa.cpy   vendorpay          RCSZ=00064  bgn  end  lth typ
  01  vendorpay.
      10 venpay-num     pic  x(6).                            0000 0005  006
      10 recpay-type    pic  x(4).                            0006 0009  004
      10 venpay-date    pic  x(10).                           0010 0019  010
      10 venpay-inv     pic  x(10).                           0020 0029  010
      10 venpay-amt     pic  9(9).                            0030 0038  009 n  9
      10 filler001      pic  x(1).                            0039 0039  001
      10 venpay-item    pic  x(24).                           0040 0063  024
 *RCSZ=00064

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

3B1. uvhdcob - display data files with COBOL field names

demo Data-Files - Fixed,Text,RDW,IDX

There are 4 data-files for each copybook (listed above) to demo the 4 different types of data files. The data files are the same names as the copybooks with a digit appended to indicate the file-type (1=Fixed, 2=Text, 3=RDW, 4=IDX).

We will descibe the 4 types of files using vendormas1/2/3/4 as an example. I have added another type '0' for the Fixed-length file from a mainframe, which would be EBCDIC, with no LineFeeds.

dat1/vendormas0
  • Fixed length file from a mainframe (64 byte records)
  • EBCDIC with no LineFeeds
  • cannot be listed with normal Unix/Linux utilties
dat1/vendormas1
  • Fixed length file (64 bytes)
  • translated to ASCII
  • period inserted in 63rd byte to indicate End of Record
  • LineFeed inserted in 64th byte for convenience
    so you can use Unix/Linux utilities (vi,lp,cat,more,etc)
dat1/vendormas2
  • Text file with LineFeed after the last non-blank
  • can use Unix/Linux utilities (vi,lp,cat,more,etc)
  • Micro Focus COBOL 'ORGANIZATION LINE SEQUENTIAL'
dat1/vendormas3
  • RDW (Record Descriptor Word) file with 4 byte record prefixes
  • record-size binary in 1st 2 bytes, nulls in 3rd & 4th byte
  • file type option 'z4' for uvhd, uvhdcob, uvcp, uvcopy, etc
  • RDW must be used when variable lth files FTP'd from mainframe
dat1/vendormas4
  • Fixed length Indexed files for Micro Focus COBOL (IDXFORMAT1)
  • 2 parts vendormas4.dat (Data) & vendormas4.idx (Index)
dat1/vendormas5
  • variable length files for Micro Focus COBOL (IDXFORMAT3)
  • file header record 128 for IDXFORMAT3
  • record-size binary in 1st 2 bytes
  • various record types coded in 1st 2 bits
  • x'40' = data record, x'03' = system, x'02' = deleted
  • file type option 'v' for uvhd & uvhdcob
  • option 'typ=IDXf3/IDXf8' for uxcp, uxsort,& uxcopy
  • see details re IDXf3/f8 at uvhd.htm#5G1
dat1/vendormas6
  • variable length files for Micro Focus COBOL (IDXFORMAT8)
  • file header record 1024 for IDXFORMAT8
  • single part vendormas6.dat has both Data & Index
  • otherwise similar to IDXFORMAT3

notes re data-file listings (below)

We will list only the Text files (suffix '2'), since only the text file could be listed with normal unix/linux utilities (require LineFeeds & no binary data). See copybook/maps (record layouts) listed on page '3A1' - 3A3

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

3B2. demo data filetypes - Fixed,Text,RDW,IDX

dat1/vendormas2


 vendor# type vendor-name
 =========================================
 DELL10 M  Dell Inc.
 HP0010 M  Hewlett Packard
 IBM010 M  International Business Machines
 MFC010 M  Micro Focus COBOL
 MS0010 M  Microsoft Corp.
 REDH10 M  Red Hat Linux
 SUN010 M  Sun Microsystems Ltd
 UVSI10 M  UV Software Inc.

dat1/vendorpay2


 vendor# RT  date     invoice    amount  item-description
 ============================================================
 DELL10 P  20100131  INV00010  000195000 Dell server 2900
 HP0010 P  20100215  INV00020  000350000 HP XW9400 Workstation
 HP0010 P  20100215  INV00020  000042500 HP LCD Monitor
 IBM010 P  20100321  INV00030  000750000 AIX server
 IBM010 P  20100322  INV00030  000750000 DB2 database software
 MFC010 P  20100420  INV00040  000320000 Micro Focus Developer
 MS0010 P  20100501  INV00050  000011600 Microsoft Windows 7
 REDH10 P  20100620  INV00060  000034900 Red Hat Enterprise 5.4

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

3B3. demo data filetypes - Fixed,Text,RDW,IDX

dat1/vendorpaymas2


 vendor# RT name/date invoice    amount  item-description
 ============================================================
 DELL10 M  Dell Inc.
 DELL10 P  20100131  INV00010  000195000 Dell server 2900
 HP0010 M  Hewlett Packard
 HP0010 P  20100215  INV00020  000042500 HP LCD Monitor
 HP0010 P  20100215  INV00020  000350000 HP XW9400 Workstation
 IBM010 M  International Business Machines
 IBM010 P  20100321  INV00030  000750000 AIX server
 IBM010 P  20100322  INV00030  000750000 DB2 database software
 MFC010 M  Micro Focus COBOL
 MFC010 P  20100420  INV00040  000320000 Micro Focus Developer
 MS0010 M  Microsoft Corp.
 MS0010 P  20100501  INV00050  000011600 Microsoft Windows 7
 REDH10 M  Red Hat Linux
 REDH10 P  20100620  INV00060  000034900 Red Hat Enterprise 5.4
 SUN010 M  Sun Microsystems Ltd
 UVSI10 M  UV Software Inc.

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

3C1. uvhdcob - display data-files with COBOL copybook field-names

preparation to demo various filetypes

We will demo uvhdcob using the data files listed on pages '3A1' - '3B3', & using the copybook/maps listed on pages '3A1' - '3A3'. You can do these demos using the 'uvadm' login, or in your home directory if you copy the demo files.


 #1. login uvadm --> /home/uvadm  <-- can demo in uvadm homedir
     ===========================

OR login to your homedir & copy demo files


 #1. login yourself --> /home/yourhomedir  <-- to copy demo files to your homedir
     ====================================

 #2a. mkdir dat1        <-- make subdir for data files
      ==========
 #2b. mkdir cobol       <-- so instrns below same for uvadm or your login
      ===========
 #2c. mkdir mf/cpys  <-- subdir for copybooks
      =============
 #2d. mkdir mf/maps  <-- subdir for copybook/maps (record layouts)
      =============
 #2e. mkdir tmp         <-- subdir for output files from Print & Write commands
      =========

 #3. cp /home/uvadm/mf/cpys/vendor* cpys <-- copy all vendor* copybooks (3)
     ===================================
     (vendormas, vendorpay, vendorpaymas)

 #4. uvcopyx cobmap1 mf/cpys mf/maps uop=q0i7
     ========================================
     - convert COBOL copybooks to maps (record layouts) for uvhdcob

 #5. cp /home/uvadm/dat1/vendor* dat1  <-- copy all vendor* files (15)
     ================================
     (vendormas0,1,2,3,4,5,6 vendorpay0,1,2,3,4, vendorpaymas0,1,2,3,4)

Alternative re-create demo files vs #5 copy above

Note
  • you can re-create the various fixed/variable/Indexed demo files
  • as shown on the next page, using uvcp/uxcp
  • an alternative to copying from $UV/dat1/vendormas*

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

3C2. using uvhdcob with various file types

creating deno files with uvcp/uxcp

Here is how I created the 7 types of fixed/variable length files. First I used the vi editor to create the text file (vendormas2). Then I used 'uvcp' to create vendormas0 (EBCDIC fixed), vendormas1 (ASCII fixed), vendormas3 (RDW) & vendormas4 (IDXFORMAT1). Finally I used 'uxcp' to create vendormas5 (Micro Focus IDXFORMAT3) & vendormas6 (Micro Focus IDXFORMAT8). Note that only 'uxcp' has the file handler for Micro Focus variable length files.


 #1. vi dat1/vendormas2
     ==================
      DELL10 M  Dell Inc.
      HP0010 M  Hewlett Packard
      IBM010 M  International Business Machines
      MFC010 M  Micro Focus COBOL
      MS0010 M  Microsoft Corp.
      REDH10 M  Red Hat Linux
      SUN010 M  Sun Microsystems Ltd
      UVSI10 M  UV Software Inc.

 #2. uvcp "fili1=dat1/vendormas2,typ=LST,rcs=64\
          ,filo1=dat1/vendormas0,typ=RSF,tre=0(64)"
     ==========================*=========*********=

 #3. uvcp "fili1=dat1/vendormas2,typ=LST,rcs=64,filo1=dat1/vendormas1,typ=RSF"
     ===============================================================*=====***=

 #4. uvcp "fili1=dat1/vendormas2,typ=LST,rcs=64,filo1=dat1/vendormas3,typ=RDW"
     ===============================================================*=====***=

 #5. uxcp "fili1=dat1/vendormas2,typ=LST,rcs=64\
          ,filo1=dat1/vendormas4,typ=IDXf1,isk1=0(6)"
     ****======================*=====*****===========

 #6. uxcp "fili1=dat1/vendormas2,typ=LST,rcs=64\
          ,filo1=dat1/vendormas5,typ=IDXf3v,isk1=0(6)"
     ****======================*=====******===========

 #7. uxcp "fili1=dat1/vendormas2,typ=LST,rcs=64\
          ,filo1=dat1/vendormas6,typ=IDXf8v,isk1=0(6)"
     ****======================*=====******===========

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

3C3. using uvhdcob with various file types

Notes re uvcp/uxcp file types

  1. Note the output file 'typ's (after filo1=...) are:

typ=RSF
  • vendormas0 Fixed length (EBCDIC)
typ=RSF
  • vendormas1 Fixed length (ASCII)
typ=RDW
  • vendormas3 RDW variable length
  • RDW files have binary record size in 1st 2 bytes each record
typ=IDXf1
  • vendormas4 Micro Focus Fixed length
typ=IDXf3v
  • vendormas5 Micro Focus variable length
  • 2 parts vendormas5.dat (Data) & vendormas5.idx (Index)
typ=IDXf8v
  • vendormas6 Micro Focus variable length
  • single part vendormas6.dat has both data & index
  1. Note 'tre=0(64)' translates ASCII to EBCDIC (vendormas0)

  2. Note 'isk1=0(6)' specifies the key for Indexed files (vendormas4,5,6)

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

3D1. demo uvhdcob for various filetypes

uvhdcob demo for EBCDIC files


 #0. uvhdcob dat1/vendormas0 mf/maps/vendormas a  <-- note option 'a'
     ======================*====================
     - option 'a' translates EBCDIC to ASCII for display only
 uvhdcob datafile=dat1/vendormas0
 20100607:1405 copybook=mf/maps/vendormas options=a
 rec#=1 rcount=8 rsize=64 fsize=512 fptr=0
 rec#       1           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 venmas-num                   0   5    DELL10
 002 venmas-type                  6   9     M
 003 venmas-name                 10  63    Dell Inc.
 rec#=1 rcount=8 rsize=64 fsize=512 fptr=0
 Enter command, or ?=Help, or null=NextRecord -->

uvhdcob demo for various filetypes

  1. We showed the 1st 2 records for the EBCDIC file above, but we will show only the 1st record for most types (to save space) since the displays are similar.

  2. We will show all 8 records for file type RDW (option z4) - see page '3D3' & '3D4'

  3. uvhdcob shows the record lengths for variable length filetypes, which is why we thought it more interesting to show all records for the RDW file.

  4. When files are FTP'd from a mainframe, any variable length files must be FTP'd with the RDW option.

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

3D2. demo uvhdcob for various filetypes

uvhdcob demo for ASCII Fixed Length


 #1. uvhdcob dat1/vendormas1 mf/maps/vendormas
     ======================*==================
     - no options are required for ASCII fixed length
     - since record size is coded in the copybook/map
 uvhdcob datafile=dat1/vendormas1
 20100607:1432 copybook=mf/maps/vendormas options=
 rec#=1 rcount=8 rsize=64 fsize=512 fptr=0
 rec#       1           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 venmas-num                   0   5    DELL10
 002 venmas-type                  6   9     M
 003 venmas-name                 10  63    Dell Inc.
 rec#=1 rcount=8 rsize=64 fsize=512 fptr=0
 Enter command, or ?=Help, or null=NextRecord -->

uvhdcob demo for Text files


 #2. uvhdcob dat1/vendormas2 mf/maps/vendormas t  <-- note option 't'
     ======================*====================
     - option 't' for Text files (variable length termianted by LineFeed)
 uvhdcob datafile=dat1/vendormas2
 20100607:1518 copybook=mf/maps/vendormas options=t
 rec#=1 rcount=8 rsize=20 fsize=225 fptr=0
 rec#       1           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 venmas-num                   0   5    DELL10
 002 venmas-type                  6   9     M
 003 venmas-name                 10  63    Dell Inc.
 rec#=1 rcount=8 rsize=20 fsize=225 fptr=0
 Enter command, or ?=Help, or null=NextRecord -->
Note
  • the length of the 1st record is 20 bytes (rsize=20)
  • see all records below (displayed for RDW file dat1/vendormas3)

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

3D3. demo uvhdcob for various filetypes

uvhdcob demo for RDW files


 #3. uvhdcob dat1/vendormas3 mf/maps/vendormas z4  <-- note option 'z4'
     ======================*=====================
     - option 'z4' for RDW files with 4 byte record prefix
 uvhdcob datafile=dat1/vendormas3
 20100607:1523 copybook=mf/maps/vendormas options=z4
 rec#=1 rcount=8 rsize=23 fsize=249 fptr=0
 rec#       1           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 venmas-num                   0   5    DELL10
 002 venmas-type                  6   9     M
 003 venmas-name                 10  63    Dell Inc.
 rec#=1 rcount=8 rsize=23 fsize=249 fptr=0
 Enter command, or ?=Help, or null=NextRecord -->
 rec#=2 rcount=8 rsize=30 fsize=249 fptr=23
 rec#       2           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 venmas-num                   0   5    HP0010
 002 venmas-type                  6   9     M
 003 venmas-name                 10  63    Hewlett Packard
 rec#=2 rcount=8 rsize=30 fsize=249 fptr=23
 Enter command, or ?=Help, or null=NextRecord -->
 rec#=3 rcount=8 rsize=45 fsize=249 fptr=53
 rec#       3           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 venmas-num                   0   5    IBM010
 002 venmas-type                  6   9     M
 003 venmas-name                 10  63    International Business Machines
 rec#=3 rcount=8 rsize=45 fsize=249 fptr=53
 Enter command, or ?=Help, or null=NextRecord -->
 rec#=4 rcount=8 rsize=31 fsize=249 fptr=98
 rec#       4           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 venmas-num                   0   5    MFC010
 002 venmas-type                  6   9     M
 003 venmas-name                 10  63    Micro Focus COBOL
 rec#=4 rcount=8 rsize=31 fsize=249 fptr=98
 Enter command, or ?=Help, or null=NextRecord -->
 rec#=5 rcount=8 rsize=29 fsize=249 fptr=129
 rec#       5           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 venmas-num                   0   5    MS0010
 002 venmas-type                  6   9     M
 003 venmas-name                 10  63    Microsoft Corp.
 rec#=5 rcount=8 rsize=29 fsize=249 fptr=129
 Enter command, or ?=Help, or null=NextRecord -->

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

3D4. demo uvhdcob for various filetypes

demo for RDW (continued)

 rec#=6 rcount=8 rsize=27 fsize=249 fptr=158
 rec#       6           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 venmas-num                   0   5    REDH10
 002 venmas-type                  6   9     M
 003 venmas-name                 10  63    Red Hat Linux
 rec#=6 rcount=8 rsize=27 fsize=249 fptr=158
 Enter command, or ?=Help, or null=NextRecord -->
 rec#=7 rcount=8 rsize=34 fsize=249 fptr=185
 rec#       7           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 venmas-num                   0   5    SUN010
 002 venmas-type                  6   9     M
 003 venmas-name                 10  63    Sun Microsystems Ltd
 rec#=7 rcount=8 rsize=34 fsize=249 fptr=185
 Enter command, or ?=Help, or null=NextRecord -->
 rec#=8 rcount=8 rsize=30 fsize=249 fptr=219
 rec#       8           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 venmas-num                   0   5    UVSI10
 002 venmas-type                  6   9     M
 003 venmas-name                 10  63    UV Software Inc.
 rec#=8 rcount=8 rsize=30 fsize=249 fptr=219
 EOF, enter -1 Last Record, or 1 return Begin File
 Enter command, ?=Help, null=NextRec -->

Variable Length files (text,RDW,IDX)

  1. Note the record sizes displayed on each of the 8 records above. Record-Sizes: #1=23, #2=30, #3=45, #4=31, #5=29, #6=27, #7=34, #8=30.

  2. For variable lth files, the record count would be wrong, without building an Index on startup, which uvhd now does since November 2010. Prior to the Index the record# was calculated at each record by dividing the file-size by the record-size.

  3. Building the Index on startup speeds up subsequent finds by record#. Startup reads to EOF storing file-pointers & record#s at 1% filesize intervals. This also locks in the correct record count on all future screens headings. Use 'f#' to find records by their actual record# in Variable-Length files (vs r# for Fixed-length files).

  4. When files are FTP'd from a mainframe, any variable length files should be FTP'd with the RDW option.

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

3D5. demo uvhdcob for various filetypes

use uvhd to show RDW record-sizes


 uvhd dat1/vendormas3 z4    <-- note 'uvhd' (vs uvhdcob)
 =======================      - option 'z4' for recsize in 4 byte binary prefix

--> p8 <-- print 8 records to tmp/vendormas1_yymmdd_hhmmssP


 uvlp12 tmp/vendormas3_100607_160344P  <-- list Print command output
 ====================================
 uvhd filename=/home/uvadm/dat1/vendormas3
 options=z4 lastmod=2010060708 today=20100607160344 print=p8
 records=8 rsize=23 fsize=249 fsize%rsize(rmndr)=19
                      10        20        30        40        50        60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 ....DELL10 M  Dell Inc.
             01004444332422466624662
             070045CC100D0045CC09E3E
                      10        20        30        40        50        60
 r#        2 0123456789012345678901234567890123456789012345678901234567890123
           0 ....HP0010 M  Hewlett Packard
             010045333324224676677256666762
             0E008000100D00857C5440013B1240
                      10        20        30        40        50        60
 r#        3 0123456789012345678901234567890123456789012345678901234567890123
           0 .-..IBM010 M  International Business Machines
             020044433324224676766766666247766677246666667
             0D0092D0100D009E452E149FE1C02539E5330D1389E53
                      10        20        30        40        50        60
 r#        4 0123456789012345678901234567890123456789012345678901234567890123
           0 ....MFC010 M  Micro Focus COBOL
             0100444333242246676246677244444
             0F00D630100D00D932F06F35303F2FC
                      10        20        30        40        50        60
 r#        5 0123456789012345678901234567890123456789012345678901234567890123
           0 ....MS0010 M  Microsoft Corp.
             01004533332422466767667246772
             0D00D300100D00D932F3F6403F20E
                      10        20        30        40        50        60
 r#        6 0123456789012345678901234567890123456789012345678901234567890123
           0 ....REDH10 M  Red Hat Linux
             010054443324225662467246677
             0B002548100D0025408140C9E58
                      10        20        30        40        50        60
 r#        7 0123456789012345678901234567890123456789012345678901234567890123
           0 ."..SUN010 M  Sun Microsystems Ltd
             0200554333242257624667677776672476
             020035E0100D0035E0D932F39345D30C44
                      10        20        30        40        50        60
 r#        8 0123456789012345678901234567890123456789012345678901234567890123
           0 ....UVSI10 M  UV Software Inc.
             010055543324225525667767624662
             0E005639100D005603F64712509E3E

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

3D6. demo uvhdcob for various filetypes

listRDW1 alternative to uvhd above

When you want to list an RDW file, an alternative to 'uvhd' could be 'uvcopy listRDW1', which will provide a more compact listing & it shows the record-size converted to decimal (vs hexadecimal by uvhd/uvhdcob).


 #1. uvcopy listRDW1,fili1=dat1/vendormas3   <-- list in vertical hexadecimal
     =====================================
     - by default writes output file to tmp/... (with same name as input)

 #2. uvlp12 tmp/vendormas3     <-- list report file created by listRDW1
     =====================
           1         2         3         4         5         6         7
 01234567890123456789012345678901234567890123456789012345678901234567890123456789
 rec# rcsz <---------------- record data (1st 64 bytes) ------------------>
 0001 0019 DELL10 M  Dell Inc.
           4444332422466624662
           45CC100D0045CC09E3E
 0002 0026 HP0010 M  Hewlett Packard
           4533332422467667725666676
           8000100D00857C5440013B124
 0003 0041 IBM010 M  International Business Machines
           44433324224676766766666247766677246666667
           92D0100D009E452E149FE1C02539E5330D1389E53
 0004 0027 MFC010 M  Micro Focus COBOL
           444333242246676246677244444
           D630100D00D932F06F35303F2FC
 0005 0025 MS0010 M  Microsoft Corp.
           4533332422466767667246772
           D300100D00D932F3F6403F20E
 0006 0023 REDH10 M  Red Hat Linux
           54443324225662467246677
           2548100D0025408140C9E58
 0007 0030 SUN010 M  Sun Microsystems Ltd
           554333242257624667677776672476
           35E0100D0035E0D932F39345D30C44
 0008 0026 UVSI10 M  UV Software Inc.
           55543324225525667767624662
           5639100D005603F64712509E3E

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

3D7. using uvhdcob with Micro Focus COBOL files

uvhdcob for Micro Focus IDXFORMAT1 Fixed-Length files


 uvhdcob dat1/vendormas4.dat mf/maps/vendormas
 =============================================
 now=20121120:1426 uvhdcob dat1/vendormas4.dat r64
 version=20120911 copybook=mf/maps/vendormas
 rec#=1 rcount=8 rsize=64 fsize=512 fptr=0
 rec#       1           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 venmas-num                   0    5    DELL10
 002 venmas-type                  6    9     M
 003 venmas-name                 10   63    Dell Inc.
 rec#=1 rcount=8 rsize=64 fsize=512 fptr=0 -->
 rec#=2 rcount=8 rsize=64 fsize=512 fptr=64
 rec#       2           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 venmas-num                   0    5    HP0010
 002 venmas-type                  6    9     M
 003 venmas-name                 10   63    Hewlett Packard
 rec#=2 rcount=8 rsize=64 fsize=512 fptr=64 -->

Notes re IDXFORMAT1 fixed-length Indexed files

  1. Note that IDXFORMAT1 files have x'0A' in the last byte of the record size. This is the status byte for a valid record (x'00' for a deleted record). x'0A' is the same code as a LineFeed in text files, which means you can use various unix utilities (such as vi, more, lp, grep, etc). BUT, you would need to be very careful using vi to update since deleting or inserting even 1 byte destroys the remainder of the file since the index assumes that all records are exactly the record size loaded.

  2. We can load IDXFORMAT1 files with either 'uvcp' or 'uxcp'. 'uxcp' uses the Micro Focus file handler & the user must have Micro Focus COBOL installed. 'uvcp' uses the D-ISAM file handler & you do not need MF COBOL installed. Here are the 2 commands to load the file (shortening names from vendormas2/4 to vmas2/4 to fit the command on 1 line). Note the difference 'uvcp' & 'typ=ISF' for D-ISAM vs 'uxcp' & typ=IDXf1 for MF IDXFORMAT1.


 uvcp "fili1=dat1/vmas2,typ=LST,rcs=64,filo1=dat1/vmas4,typ=ISF,rcs=63,isk1=0(6)"
 =*=========================================================***==================

 uxcp "fili1=dat1/vmas2,typ=LST,rcs=64,filo1=dat1/vmas4,typ=IDXf1,rcs=63,isk1=0(6)"
 =*=========================================================*****==================
  1. Note that we defined the record-size as 'rcs=63' on the uvcp (or uxcp) used to load the file - so that the physical record-size would be 64 (after loading adds the x'0A'). This is simply a convenience for uvhdcob which displays files in 64 byte segments.

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

3D8. using uvhdcob with Variable-Length files

uvhdcob demo for Micro Focus variable-length files


 uvhdcob dat1/vendormas5.dat mf/maps/vendormas v <-- option 'v' variable lth
 ===============================================     Micro Focus COBOL files
 now=20121120:1426 uvhdcob dat1/vendormas5.dat v
 version=20120911 copybook=mf/maps/vendormas
 rec#=1 rcount=9 rsize=128 fsize=440 fptr=0
 rec#       1           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 venmas-num                   0    5    ......      000000000000      <-BadC
 002 venmas-type                  6    9    1211
 003 venmas-name                 10   63    201110136112112011101361.>..........
 rec#=1 rcount=9 rsize=128 fsize=440 fptr=0 -->
 rec#=2 rcount=9 rsize=24 fsize=440 fptr=196
 rec#       2           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 venmas-num                   0    5    DELL10
 002 venmas-type                  6    9     M
 003 venmas-name                 10   63    Dell Inc
 rec#=2 rcount=9 rsize=24 fsize=440 fptr=196 -->
 rec#=3 rcount=9 rsize=28 fsize=440 fptr=220
 rec#       3           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 venmas-num                   0    5    HP0010
 002 venmas-type                  6    9     M
 003 venmas-name                 10   63    Hewlett Packard
 rec#=3 rcount=9 rsize=28 fsize=440 fptr=220 -->

demo uvhdcob for IDXf3/IDXf8 files

  1. The first record is the 'file header record', which is a binary record and can not be displayed with uvhdcob - use 'uvhd' to see the contents. See the uvhd display for this file at uvhd.htm#5G1

  2. Note that vendormas5 is a Micro Focus IDXFORMAT3 variable length Indexed file with 2 partitions (vendormas5.dat & vendormas5.idx). We are investigating the data partition (vendormas5.dat). If desired, you could also investigate the Index partition as follows:


 uvhdcob dat1/vendormas5.idx   <-- investigate Index partition (binary file)
 ===========================     - omit options to display 256 byte chunks
  1. The Vancouver Utilities (uxcopy,uxsort,uxcp) can handle these files and refers to them as IDXf3 and IDXf8.

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

3D9. using uvhdcob with Variable-Length files

uvhdcob demo for Micro Focus IDXFORMAT8


 uvhdcob dat1/vendormas6.dat mf/maps/vendormas v <-- option 'v' variable lth
 ===============================================     Micro Focus COBOL files
 now=20121120:1427 uvhdcob dat1/vendormas6.dat v
 version=20120911 copybook=mf/maps/vendormas
 rec#=1 rcount=10 rsize=1024 fsize=3408 fptr=0
 rec#       1           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 venmas-num                   0    5    ......      000000000000      <-BadC
 002 venmas-type                  6    9    1211
 003 venmas-name                 10   63    201109473212112011094732.>..........
 rec#=1 rcount=10 rsize=1024 fsize=3408 fptr=0 -->
 rec#=2 rcount=10 rsize=24 fsize=3408 fptr=3144
 rec#       2           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 venmas-num                   0    5    DELL10
 002 venmas-type                  6    9     M
 003 venmas-name                 10   63    Dell Inc
 rec#=2 rcount=10 rsize=24 fsize=3408 fptr=3144 -->
 rec#=3 rcount=10 rsize=28 fsize=3408 fptr=3168
 rec#       3           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 venmas-num                   0    5    HP0010
 002 venmas-type                  6    9     M
 003 venmas-name                 10   63    Hewlett Packard
 rec#=3 rcount=10 rsize=28 fsize=3408 fptr=3168 -->

Notes re IDXFORMAT3/8 differences

  1. You use the same option 'v' to identify both IDXFORMAT3 & IDXFORMAT8

  2. IDXFORMAT8 files have only 1 partition (.dat) vs 2 parts for IDXFORMAT3 (.dat & .idx).

  3. IDXFORMAT8 allows files > 2 gigs (IDXFORMAT3 does not)

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

3E1. uvhdcob - display data-files with COBOL copybook field-names

Multi-Record-Types (Redefined records)

The pages above demonstrated uvhdcob using dat1/vendormas0,1,2,3,4,5,6. These files had only 1 record type. Now we will demo uvhdcob for files with multiple record types.

 Please see 'dat1/vendorpaymas2' listed on page '3B3' with 2 record types.
 - Vendor names identified by an 'M' in byte 7 (column 8)
 - Vendor payments identified by a 'P' in byte 7 9column 8).
  Here are the 1st 4 records:

 vendor# RT name/date invoice    amount  item-description
 ============================================================
 DELL10 M  Dell Inc.
 DELL10 P  20100131  INV00010  000195000 Dell server 2900
 HP0010 M  Hewlett Packard
 HP0010 P  20100215  INV00020  000042500 HP LCD Monitor

Here is the copybook/map (originally listed on page '3A2') which defines both record types & has '*TYPE' control records inserted at the begining.

 cobmap1  COBOL record layout            2016/03/11_13:00:10  pg# 0001
 maps/vendorpaymas                                 RCSZ=00064  bgn  end  lth typ
 * vendorpaymas - cobol copybook for vendorpaymas1/2/3/4 data
 *   to demo uvhdcob on multi-record-type files
 * - identified by record-type 'M/P' in col8 dat1/vendorpaymas1
 *type=7(1),='M','vendormas'
 *type=7(1),='P','vendorpay'
 *type=7(1),!'x','badrecordtype'
  01  vendorpaymas      pic  x(64).                           0000 0063  064
  02  vendormas redefines vendorpaymas.
      10 venmas-num     pic  x(6).                            0000 0005  006
      10 venmas-type    pic  x(4).                            0006 0009  004
      10 venmas-name    pic  x(54).                           0010 0063  054
  02  vendorpay redefines vendorpaymas.
      10 venpay-num     pic  x(6).                            0000 0005  006
      10 recpay-type    pic  x(4).                            0006 0009  004
      10 venpay-date    pic  x(10).                           0010 0019  010
      10 venpay-inv     pic  x(10).                           0020 0029  010
      10 venpay-amt     pic  9(9).                            0030 0038  009 n  9
      10 filler001      pic  x(1).                            0039 0039  001
      10 venpay-item    pic  x(24).                           0040 0063  024
  02  badrecordtype redefines vendorpaymas.
      10 unidentified-record-1st30  pic  x(30).               0000 0029  030
 *RCSZ=00064

 uvcopy cobmap1,fili1=cpys/vendorpaymas,filo1=maps/vendorpaymas
 ==============================================================
 - convert 1 copybook to a cobmap (record layout)

 uvcopyx cobmap1 cpys maps uop=q0i7
 ==================================
 - convert All copybooks to cobmaps, easier to key & very fast

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

3E2. demo uvhdcob for Multi-File-Types

      *type=7(1),='M','vendormas'
      *type=7(1),='P','vendorpay'
      *type=7(1),!'x','badrecordtype'

Record TYPE rules

  1. Insert the record 'type' statements as *comments in the copybook and then reconvert the copybooks to maps. Do not insert in the maps because reconversion of cpys/ to maps/ would lose your type statements in maps/.

  2. Type values are usually in UPPER case to match the data (usually UPPER case), but the redefined fieldnames are usually in lower case - because the cobmap1 utility converts to lower case (except in quotes).

  3. Code the 'type' statements in the same sequence as the redefined fieldnames.

  4. You must code a '!' (Not Equal) type statement following the '=' types to catch any record that does not match the '=' types.

  5. You can add 'badrecordtype' definition at the end of the redefined redcords. Since 30 bytes is max shown on 1 line, you might define 2 or 3 fields as follows so you can see part of the bad record.

      01 badrecordtype.
          10 badrec1      pic x(30).
          10 badrec2      pic x(30).
          10 badrec3      pic x(30).

Alternate TYPE ID by record-length

Also see the Alternate copybook/map 'vendorpaymasa' listed on page '3A3' which contains the following 'type' control recors:

      *type=00:45,'vendormas'
      *type=46:99,'vendorpay'

This Alternate format identifies record types by record length. From the vendorpaymas file listed above, you can see that the payment records are considerably longer than the vendor name records. We decided to use 45 as the boundary between the 2 types.

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

3E3. demo uvhdcob for Multi-File-Types

sample display for vendorpaymas


 uvhdcob dat1/vendorpaymas1 mf/maps/vendorpaymas
 ===============================================
 *type=7(1),='M','vendormas'
 *type=7(1),='P','vendorpay'
 *type=7(1),!'x','badrecordtype'
 rec#=1 rcount=16 rsize=64 fsize=1024 fptr=0
 rec#       1           occurs  bgn  end typ <------ data (hex if typ=p/b) ----->
 001 vendorpaymas                  0   63    DELL10 M  Dell Inc.
 002 vendormas                     6    0
 003 venmas-num                    0    5    DELL10
 004 venmas-type                   6    9     M
 005 venmas-name                  10   63    Dell Inc.
 rec#=1 rcount=16 rsize=64 fsize=1024 fptr=0
 Enter command, or ?=Help, q=quit, null=NextRecord -->
 rec#=2 rcount=16 rsize=64 fsize=1024 fptr=64
 rec#       2           occurs  bgn  end typ <------ data (hex if typ=p/b) ----->
 001 vendorpaymas                  0   63    DELL10 P  20100131  INV00010  000195
 002 vendorpay                     6    0
 003 venpay-num                    0    5    DELL10
 004 recpay-type                   6    9     P
 005 venpay-date                  10   19    20100131
 006 venpay-inv                   20   29    INV00010
 007 venpay-amt                   30   38 n  000195000
 008 filler001                    39   39
 009 venpay-item                  40   63    Dell server 2900      ..
 rec#=2 rcount=16 rsize=64 fsize=1024 fptr=64
 Enter command, or ?=Help, q=quit, null=NextRecord -->
 rec#=3 rcount=16 rsize=64 fsize=1024 fptr=128
 rec#       3           occurs  bgn  end typ <------ data (hex if typ=p/b) ----->
 001 vendorpaymas                  0   63    HP0010 M  Hewlett Packard
 002 vendormas                     6    0
 003 venmas-num                    0    5    HP0010
 004 venmas-type                   6    9     M
 005 venmas-name                  10   63    Hewlett Packard
 rec#=3 rcount=16 rsize=64 fsize=1024 fptr=128
 Enter command, or ?=Help, q=quit, null=NextRecord -->
 rec#=4 rcount=16 rsize=64 fsize=1024 fptr=192
 rec#       4           occurs  bgn  end typ <------ data (hex if typ=p/b) ----->
 001 vendorpaymas                  0   63    HP0010 P  20100215  INV00020  000042
 002 vendorpay                     6    0
 003 venpay-num                    0    5    HP0010
 004 recpay-type                   6    9     P
 005 venpay-date                  10   19    20100215
 006 venpay-inv                   20   29    INV00020
 007 venpay-amt                   30   38 n  000042500
 008 filler001                    39   39
 009 venpay-item                  40   63    HP LCD Monitor        ..
 rec#=4 rcount=16 rsize=64 fsize=1024 fptr=192
 Enter command, or ?=Help, q=quit, null=NextRecord --> ** quit request - program ended **

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

3E4. demo uvhdcob for Multi-File-Types

Data file types & multi-record-types

 You may use cobmaps with inserted record-types with any of the Data-File-Types
 - by coding the data-file-type option as arg3 after cobmap arg2.

 uvhdcob dat1/vendorpaymas1 mf/maps/vendorpaymas
 ==============================================
 - no arg3 option defaults to ASCII fixed record lengths

 uvhdcob dat1/vendorpaymas0 mf/maps/vendorpaymas a
 ==================================================
 EBCDIC files dat1/vendorpaymas0 - use option 'a' translate ebcdic to Ascii

 uvhdcob dat1/vendorpaymas2 mf/maps/vendorpaymas t
 =================================================
 TEXT files dat1/vendorpaymas2 - use option 't' (records ended by Linefeeds)

 uvhdcob dat1/vendorpaymas2 mf/maps/vendorpaymas z4
 ==================================================
 RDW files dat1/vendorpaymas2 - use option 'z4' (4 byte hdrs with record-size)

Partial Redefined Records

The example above redefined the entire record, but sometimes only part of the record is redefined - usially with a common base portion. For example 'vendorpaymas2' has a common base of 10 bytes (venmas-num & venmas-base), and then redefines the records from that point up.

 cobmap1  COBOL record layout            2016/03/11_13:18:22  pg# 0001
 maps/vendorpaymas2                                RCSZ=00064  bgn  end  lth typ
 *type=7(1),='M','vendormas'
 *type=7(1),='P','vendorpay'
 *type=7(1),!'x','badrecordtype'
  01  vendorpaymas.
      10 venmas-num     pic  x(6).                            0000 0005  006
      10 venmas-type    pic  x(4).                            0006 0009  004
  02  vendormas.
      10 venmas-name    pic  x(54).                           0010 0063  054
  02  vendorpay redefines vendorpaymas.
      10 venpay-date    pic  x(10).                           0000 0009  010
      10 venpay-inv     pic  x(10).                           0010 0019  010
      10 venpay-amt     pic  9(9).                            0020 0028  009 n  9
      10 filler001      pic  x(1).                            0029 0029  001
      10 venpay-item    pic  x(24).                           0030 0053  024
  02  badrecordtype redefines vendorpaymas.
      10 unidentified-record-1st30  pic  x(30).               0000 0029  030
 *RCSZ=00064

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

3E5. demo uvhdcob for Multi-File-Types

Partial Redefined Records


 uvhdcob dat1/vendorpaymas1 mf/maps/vendorpaymas2
 ================================================
 *type=7(1),='M','vendormas': bgn=7,lth=1,typ=M,fnm=vendormas
 *type=7(1),='P','vendorpay': bgn=7,lth=1,typ=P,fnm=vendorpay
 *type=7(1),!'x','badrecordtype': bgn=7,lth=1,typ=x,fnm=badrecordtype
 *Note: bgn=...,lth=...,typ=... inserted to assist processing partial redefineds
 now=20160311:1334 uvhdcob vpm1 m45
 version=20160311 copybook=vpm2
 rec#=1 rcount=16 rsize=64 fsize=1024 fptr=0
 rec#       1           occurs  bgn  end typ <------ data (hex if typ=p/b) ----->
 001 vendorpaymas                  0    0
 002 venmas-num                    0    5    DELL10
 003 venmas-type                   6    9     M
 004 vendormas                    10    0
 005 venmas-name                  10   63    Dell Inc.
 rec#=1 rcount=16 rsize=64 fsize=1024 fptr=0
 Enter command, or ?=Help, q=quit, null=NextRecord -->
 rec#=2 rcount=16 rsize=64 fsize=1024 fptr=64
 rec#       2           occurs  bgn  end typ <------ data (hex if typ=p/b) ----->
 001 vendorpaymas                  0    0
 002 venmas-num                    0    5    DELL10
 003 venmas-type                   6    9     P
 004 vendorpay                    10    0
 005 venpay-date                   0    9    DELL10 P
 006 venpay-inv                   10   19    20100131
 007 venpay-amt                   20   28 n  INV00010    494E56303030313020<-BadN
 008 filler001                    29   29
 009 venpay-item                  30   53    000195000 Dell server 29
 rec#=2 rcount=16 rsize=64 fsize=1024 fptr=64

other options for uvhdcob

Another option (besides data-file-type) that you may find useful is option 'm' to specify the number of lines to display before prompting to continue. This is very useful if you have large records & have screens that allow more than the default of 25 lines. For example I like to use 'm45' for my screen.


 uvhdcob dat1/vendorpaymas1 mf/maps/vendorpaymas2 m45
 ====================================================

And so I don't have to remember to code it on each command, I define this option in my profile as follows:


 export UVHDCOBROP=m45
 =====================

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

Part_4 uvhdcob - display data files with COBOL field names

Part 4 - Contents


4A1. Verify data command (v)
- creating BAD data for demo

4A2. test/demo verify command
- sample display with BAD data fields indicated
Bad-Numeric, Bad-Packed, Bad-Character

4A3. Notes re verify test/demo
- unprintable bytes in pic x fields converted to '.' periods flagged <-BadC
- unpacked numeric fields with invalid digits/signs and flagged with <-BadN
  and the field is also shown in hexadecimal
- packed numeric fields with invalid digits are flagged with <-BadP
  (packed fields are always shown in hexadecimal)

4B1. Options for Verify command
options a-b,c-d,e-f to inhibit Verify on up to 3 areas
- identified by start & end byte displacements
- allows you to search/Verify for other fields in record
 options x1,x2,x4 to inhibit stop-on-err for numeric/packed/character fields
- continues to EOF & displays error counts & record#s of 1st & last error
 options y1,y2,y4 to specify signs: zoned ASCII, zoned EBCDIC, separate +/-
 options z1,z2,z4 to convert all blank numeric/packed fields to zeros
- or convert unprintables in character fields to '.' periods
- option 'p' to print formatted err records to tmp/filename_yymmdd_hhmmssVP
- option 'w' to write original err records to tmp/filename_yymmdd_hhmmssVW
- may follow with lvp/lvw to close files or omit to combine outputs

4C1. Create verify report for entire file --> v99p99x7
- option p99 creates separate tmp/report with error records only
- option x7 inhibits normal stop/display
- quit uvhdcob & use vi/more/lp/uvlp12 on tmp/report
 See sample report for dat1/custmas1x with errs created on 4A1

4D1. verify errors in occurs fields not shown if default option o1
- but indicated with 'Bad@ 9999 ->' shown on right side of 1st occurs
  (where '9999' is the displacement of the error field)

4D2. verify errors in occurs fields with option o99 to show all occurs
- test/demo/illustration using dat1/custmas1 with bad packed field

4E1. Option 'j' to execute 1 command & exit
- perfect example: 'j=v99p99x7' verify all records, write invalids to tmp

4F1. Find command for Variable Length record files
- Index built on startup for Variable-Length files
- find command examples

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

4A1. uvhdcob - display data files with COBOL field names

'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 (dat1/custmas1x) to test/demo uvhdcob. dat1/custmas1x has been updated (using uvhdcob) to create errors in record#s 10 & 20.

creating BAD data

Here are the 'update' commands we used to create the BAD data for the 'verify' command test/demo. We will omit the displays & list only the commands.


 #1. login uvadm or cd /home/uvadm   <-- change to uvadm
     =============================

 #2. cp dat1/custmas1 dat1/custmas1x  <-- copy to alt file to make bad data
     ===============================

 #3. uvhdcob dat1/custmas1x mf/maps/custmas1 u <-- option 'u' for update
     =========================================

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

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

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

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

test/demo verify command


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

 #2. uvhdcob dat1/custmas1x mf/maps/custmas1  <-- run on demo file
     =======================================
     - uvhdcob displays 1st record & prompts for command
     - we are omitting 1st record display, see verify displays next page
     --> v99  <-- search/verify until bad record found or EOF reached
                - will display next bad record found & prompt for command
                - if desired, could print(formatted) or write(raw) to tmp/...
     --> vv   <-- may then enter 'vv' to continue search/verify

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

4A2. uvhdcob 'verify' test/demo

sample display with BAD data fields

The 'v' verify command searches from the current record until it finds a record with at least 1 bad data field & displays that record. For our demo file (dat1/custmas1x) record# 10 is the 1st record with bad data fields.

--> v99 <-- Verify

 rec#      10           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 cm-num                       0    5 n  15468*      31353436382A      <-BadN
 002 cm-delete                    6    9
 003 cm-name                     10   34    FRANKLIN RESOUCES
 004 cm-adrs                     35   59    805 - 1199 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-666-5489
 011 cm-contact                 102  119    RON BENNETT
 012 cm-thisyr-sales       012  120  124pns EE0123456C                    <-BadP
 013 cm-lastyr-sales       012  180  184pns 000000000C
 014 filler003                  240  255    C 19980331
      v99 --> 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                     <-BadP
 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

4A3. uvhdcob 'verify' test/demo

Notes re uvhdcob Verify demo above

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

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

  3. cm-num '15468*' flagged because '*' 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 or invalid).

  7. uvhdcob shows only the 1st field of occurs. You could verify all occurs fields using 'genverify1' (see DATAcnv1.htm#8D1) which generates a uvcoy job to verify all numeric & packed fields using the 'vnf' instruction. See the 'vnf' instrucion at uvcopy3.htm#vnf.

  8. As of Dec 2010, uvhdcob now has option 'o99' to display all occurrences

  9. In Jan 2011, we added options 'p' & 'x' to the verify command, which allow you to create a verify report for entire file.


    --> v99p99x7 <-- create a verify report for the entire file
        =======      for separate investigation & printing.
  1. If desired, you may specify option 'z7' to convert any all blank numeric or packed fields to zeros, and convert any unprintable bytes in character fields to '.' periods. See options z1,z2,z4=z7 on the next page.

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

4B1. uvhdcob 'verify' test/demo

options for Verify

    abcdef - options to inhibit verify in 3 areas ID by offset from/to
 v99a120b239 - inhibit verify in all fields from dsplcmnt 120 to 239
             - to bypass known bad fields (to search for unknown bad fields)
 v99a100b120c200d220e300f320 - inhibit verify in 3 record areas max
 ...x  - option 'x' no-stop-on-error, count for display at EOF (or max# spcfd)
 v99x1 - nostop on errors in numeric fields
 v99x2 - nostop on errors in packed fields
 v99x4 - nostop on errors in character (pic x) fields
 v99x3 - nostop on errors in numeric + packed fields
 v99x7 - nostop on errors in numeric + packed + character fields
 ...y  - option 'y' specify valid signs for numeric fields
 v99y1 - (default) Micro Focus COBOL -0123456789=pqrstuvwxy x'70' zones
 v99y2 - EBCDIC signs: +0123456789={ABCDEFGHI, -0123456789=}JKLMNOPQR
       - defaults to y2 when input file EBCDIC (option 'a' on command line)
 v99y4 - separate +/- signs (leading or trailing)
 ...z - option 'z' correct blank numeric/packed,& pic x with unprintable chars
 v99z1 - convert any all blank numeric fields to numeric zeros
 v99z2 - convert any all blank packed fields to packed zeros with x'_C' sign
 v99z4 - convert any any unprintable characters in pic x fields to '.' periods
 v99z7 - all of above
v99x7p99
  • verify all records (v99) with option x7 for nostop (count only)
  • option 'p99' prints all error to tmp/filename_yymmdd_hhmmssVP
  • option 'w99' writes all error to tmp/filename_yymmdd_hhmmssVW
  • may follow with lvp/lvw to close files or omit to combine outputs

lw/lp/lvw/lvp separate or combined write/print files

 lw  <-- may follow write command with 'lw' command to close file for separate
         output files or omit for combined outputs from multi write commands
 lp  <-- similar command close print files for separate or omit for combined
 lvw <-- similar command close verify writes for separate or omit for combined
 lvp <-- similar command close verify prints for separate or omit for combined
Note
  • might use close command 'l' with option 'j' to execute 1 command & quit
  • see option 'j' example on page '4E1'

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

4C1. uvhdcob 'verify' test/demo

create verify report for entire file

Use command --> v99p99x7 <-- to create a verify report for the entire file in the tmp/... subdir for separate investigation & printing. Option p99 writes only the error records into tmp/filename_yymmdd_hhmmssVP. Option x7 inhibits the default stop/display on each error record. You can then quit uvhd & use vi/more/lp/uvlp12/... on the tmp/report. Here is a demo using the dat1/custmas file with the 2 bad records created on page '4A1' & displayed on page '4A2'.


 #1.  uvhdcob dat1/custmas1x mf/maps/custmas1  <-- run uvhdcob with demo files
      =======================================
      --> ........  <-- displays 1st record (display omitted to save space here)
 #1a. --> v99p99x7  <-- enter command 'v99' with options 'p99' & 'x7
      ============
 #1b. --> q         <-- quit uvhdcob

 #2.  more tmp/custmas1x_110101_084059VP   <-- display verify error records
      ==================================
 rec#      10           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 cm-num                       0    5 n  15468*      31353436382A      <-BadN
 002 cm-delete                    6    9
 003 cm-name                     10   34    FRANKLIN RESOUCES
 004 cm-adrs                     35   59    805 - 1199 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-666-5489
 011 cm-contact                 102  119    RON BENNETT
 012 cm-thisyr-sales       012  120  124pns EE0123456C                    <-BadP
 013 cm-lastyr-sales       012  180  184pns 000000000C
 014 filler003                  240  255    C 19980331
 rec#      20           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...      593141EEEEEE20202 <-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                    <-BadP
 014 filler003                  240  255      20021130

v99p99x7 --> 32 recs verified, 2 with errs, 1st at rec# 10, last at rec# 20 ERRs: 12 packed, 3 numeric signs/digits, 4 unprintable characters --> v99p99x7 closing: tmp/cm1_110102_093123VP

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

4D1. uvhdcob 'verify' test/demo

verify errors in occurs fields

verify errors in occurs fields are not shown if default option o1 which shows only the 1st occurrence, but an error is indicated with 'Bad@ 9999 ->' shown on right side of 1st occurs ('9999' is displacement of error field).

Here is a demo using dat1/custmas1x with a bad packed field at byte 140 (in the 5th field of occurs 12). We will illustrate - 1st with default option 'o1' (show only 1st occurrence), then with option 'o99' to show all occurrences and see the error field.


 uvhdcob dat1/custmas1x mf/maps/custmas1  <-- uvhdcob will display 1st record
 =======================================      and prompt for command
                                                 see entry 'v99' below <======
 rec#       1           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 cm-num                       0    5 n  130140
 002 cm-delete                    6    9
 003 cm-name                     10   34    EVERGREEN MOTORS LTD.
 004 cm-adrs                     35   59    1815 BOWEN ROAD
 005 cm-city                     60   75    NANAIMO
 006 filler001                   76   76
 007 cm-prov                     77   78    BC
 008 filler002                   79   79
 009 cm-postal                   80   89    V9S1H1
 010 cm-phone                    90  101    250-754-5531
 011 cm-contact                 102  119     LARRY WRENCH
 012 cm-thisyr-sales       012  120  124pns 001234567C
 013 cm-lastyr-sales       012  180  184pns 001234567D
 014 filler003                  240  255    C 19950531
 rec#=1 rcount=32 rsize=256 fsize=8192 fptr=0
 Enter command, or ?=Help, or null=NextRecord --> v99 <=== enter 'verify' command
 rec#       1           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 cm-num                       0    5 n  130140
 002 cm-delete                    6    9
 003 cm-name                     10   34    EVERGREEN MOTORS LTD.
 004 cm-adrs                     35   59    1815 BOWEN ROAD
 005 cm-city                     60   75    NANAIMO
 006 filler001                   76   76
 007 cm-prov                     77   78    BC
 008 filler002                   79   79
 009 cm-postal                   80   89    V9S1H1
 010 cm-phone                    90  101    250-754-5531
 011 cm-contact                 102  119     LARRY WRENCH
 012 cm-thisyr-sales       012  120  124pns 001234567C              Bad@ 0140 ->
 013 cm-lastyr-sales       012  180  184pns 001234567D
 014 filler003                  240  255    C 19950531
 v --> 1 recs verified, 1 error recs, 4 this record, 1st at byte# 140
 ERRs: 4 packed, 0 numeric signs/digits, 0 unprintable characters
 - vv99 continue, vv99h7 (x1=num,x2=pack,x4=char) count/nostop til EOF

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

4D2. uvhdcob 'verify' test/demo

rerun with option 'o99' (show all occurrences)


 uvhdcob dat1/custmas1x mf/maps/custmas1 o99 <-- rerun demo with option 'o99'
 ===========================================
 --> o99 <-- OR enter command 'o99' at prompt, note ERROR shown below '<-BadP'
 rec#       1           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 cm-num                       0    5 n  130140
 002 cm-delete                    6    9
 003 cm-name                     10   34    EVERGREEN MOTORS LTD.
 004 cm-adrs                     35   59    1815 BOWEN ROAD
 005 cm-city                     60   75    NANAIMO
 006 filler001                   76   76
 007 cm-prov                     77   78    BC
 008 filler002                   79   79
 009 cm-postal                   80   89    V9S1H1
 010 cm-phone                    90  101    250-754-5531
 011 cm-contact                 102  119     LARRY WRENCH
 012 cm-thisyr-sales       001  120  124pns 001234567C
 012 cm-thisyr-sales       002  125  129pns 000000000C
 012 cm-thisyr-sales       003  130  134pns 000000000C
 012 cm-thisyr-sales       004  135  139pns 000257300D
 012 cm-thisyr-sales       005  140  144pns EE051460EE                    <-BadP
 012 cm-thisyr-sales       006  145  149pns 000000000C
 --- continue to EOR -->
 012 cm-thisyr-sales       007  150  154pns 000029587D
 012 cm-thisyr-sales       008  155  159pns 000266331C
 012 cm-thisyr-sales       009  160  164pns 000404945C
 012 cm-thisyr-sales       010  165  169pns 000000000C
 012 cm-thisyr-sales       011  170  174pns 000000000C
 012 cm-thisyr-sales       012  175  179pns 000000000C
 013 cm-lastyr-sales       001  180  184pns 001234567D
 013 cm-lastyr-sales       002  185  189pns 000015660C
 013 cm-lastyr-sales       003  190  194pns 000003457C
 013 cm-lastyr-sales       004  195  199pns 000004567D
 013 cm-lastyr-sales       005  200  204pns 000000000C
 013 cm-lastyr-sales       006  205  209pns 000002838C
 013 cm-lastyr-sales       007  210  214pns 000000000C
 013 cm-lastyr-sales       008  215  219pns 000008138C
 013 cm-lastyr-sales       009  220  224pns 000005668D
 013 cm-lastyr-sales       010  225  229pns 000001123C
 013 cm-lastyr-sales       011  230  234pns 000000000C
 013 cm-lastyr-sales       012  235  239pns 000001669D
 014 filler003                  240  255    C 19950531
 v --> 1 recs verified, 1 error recs, 4 this record, 1st at byte# 140
 ERRs: 4 packed, 0 numeric signs/digits, 0 unprintable characters
 - vv99 continue, vv99h7 (x1=num,x2=pack,x4=char) count/nostop til EOF
Note
  • '<-BadP' higlights the field referred to by the 'Bad@ 0140 ->' shown on
    the previous page display (without option o99 to show all fields)

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

4E1. uvhdcob option 'j' execute 1 command & quit

demo option j=v99p99x7 verify all, select invalids

Option 'j=command' will execute 1 command & quit. The perfect example is to verify all records in a file, writing any invalid records to tmp/... & quit. Try the following (similar to the previous verify demo on page '4C1').


 #1. Login --> your homedir
     =====

 #2. mkdir data maps tmp    <-- make subdirs for demo files
     ===================

 #3a. cp $UV/dat1/custmas1x data      <-- copy demo datafile (with 3 bad records)
      ==========================

 #3b. cp $UV/mf/maps/custmas1 maps <-- copydemo copybook cobmap (record layout)
      ============================

 #4. uvhdcob data1/custmas1x maps/custmas1 j=v99p99x7
     ===============================================
     - execute uvhdcob with option j=... execute 1 command & quit
     - see verify options explained on page '4B1'
     - writes invalid records to tmp/filename_yymmdd_hhmmssVP

 #5. vi tmp/custmas1x_120911_163520VP  <-- inspect invalid records
     ================================      (sample of date/time stamped output)
Note
  • if you already have multiple files in tmp (with long filenames)
  • here is an easy way to select the desired file

 #6. l tmp/*VP       <-- list all Verify Print files
     =========
     tmp/custmas1x_120911_161955VP   <-- example of 2 files
     tmp/custmas1x_120911_163520VP

 #7. vi tmp/*20VP    <-- inspect filename ending with '20VP'
     ============      - the seconds of the date/time stamp often unique

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

4F1. uvhdcob find command

find command for Variable Length, N/R for Fixed-Lth

uvhd/uvhdcob can handle various filetypes - Text, RDW,& IDXFORMAT1/3/8 (Micro Focus COBOL compatible). It is easier to handle 'Fixed Length' records than 'Variable Length' records.

For fixed length records, we can calculate the number of records in the file by diividing the file-size by the record-size. We can jump instantly to any record# in the file, because we can calculate & fileseek to its byte offset (record# * record-size).

For variable length records, you can jump to a record#, but it will not be correct, because the offset would be calculated using the current record-size. After the fileseek, it is unlikely we would be positioned at the begining of a record, but uvhd/uvhdcob will automatically scan to the begining of the next record depending on the filetype (using LineFeeds for text files & the unique binary record-prefixes in RDW & IDX files).

In May 2010, we added the 'f' find command to find records by their record#. For variable length this would be very slow without an Index (would have to read sequentially to know begining of records).

Index built on startup for Variable-Length files

For variable lth files, the record count would be wrong, without building an Index on startup, which uvhd now does since November 2010. Prior to the Index the record# was calculated at each record by dividing the file-size by the record-size.

Building the Index on startup speeds up subsequent finds by record#. Startup reads to EOF storing file-pointers & record#s at 1% filesize intervals. This also locks in the correct record count on all future screens headings. By default the Index is built for typ=RDW & typ=IDXf3/f8, but not text. You can specify option 'f1' to force Index build for text files.

Then use 'f#' to find records by their actual record# in Variable-Length files (vs r# for Fixed-length files).

Building the Index for a 2.2 gigabyte file (avg recsize 1000 bytes) takes 10 seconds on my HP xw9400 workstation.

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

4F2. uvhdcob find command

find command examples


 uvhd dat1/bigRDWfile z4   <-- start uvhdc (or uvhdcob)
 =======================     - displays record#1
 --> f123456789     <-- find any desired record# (quickly using index)

options m & n find records by size


 uvhd dat1/bigRDWfile z4   <-- start uvhdc (or uvhdcob)
 =======================
 --> fm500          <-- find next record of an exact record-size (option 'm')
 --> fm500n600      <-- find next record in a size-range (options 'm' & 'n')
 --> ff             <-- repeat prior find (saves recoding m & n options)

option f0 inhibit & f1 force Index Build

For RDW & IDX files (options z&v), an Index is built by default. You might want to inhibit the index build for a very large file (to save time) when you only want to examine the 1st few records in the file & have no need to jump to exact record boundaries further down the file.


 uvhd dat1/bigRDWfile z4f0  <-- option 'f0' to inhibit Index build
 =========================    - save time when only need to see 1st few records

For Text files (option 't'), the default is to NOT build the Index, even though text records are usually variable length. But you can use option 'f1' to force building the index for text files.


 uvhd dat1/bigTEXTfile tf0  <-- option 't' Text file + 'f0' inhibit Index build
 =========================    - save time when only need to see 1st few records

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

Part_5 uvhdcob - display data files with COBOL field names

Part 5 - Contents


5A1. uvhdc1/uvhdc2 - Overview (summary of setup procedures)
uvhdc1 - intended for demos you can run in /home/uvadm with no setup
  using files provided in dat1/... & cobmaps in mf/maps/...
uvhdc2 - intended for you to customize for your datafiles & copybooks/maps

5A3. uvhdc1/uvhdc2 scripts make uvhdcob easier to use
- may omit specifying the copybook/map, file-type,& record-size
- uvhdc1/uvhdc2 retrieves by looking up control file
  (indexed by datafilename)

5A4. Environmental Variables for uvhdc1/uvhdc2
- CTLMAPDIR, RUNLIBS, RUNDATA, CNVDATA

5B1. uvhdc1 demo (may run in /home/uvadm)
- using /home/uvadm/dat1/vendormas0,1,2,3,4,5,6 vendorpay0,1,2,3,4
  and /home/uvadm/mf/maps/vendormas,vendorpay,vendorpaymas

5B2. Pre-Requisites for uvhdc1 (& uvhdc2)
- converting copybooks to cobmaps (record layouts)
- creating the Indexed file of datafilenames & copybooknames
- already performed by UV Software, you can demo immediatley

5B3. test/demo uvhdc1
uvhdc1 dat1/vendormas0 - sample display
======================

5C1. uvhdc2 - intended for your site (vs uvadm demos)
- illustration using /home/mvstest/testlibs/... & testdata/...
- you can copy testlibs/ & testdata/ to your homedir

5C2. Pre-Requisites for uvhdc2 (same as for uvhdc1)
- you can run uvhdc2 using mvstest/testlibs & mvstest/testdata
- you might repeat as practise for creating the cobmaps & control-file
  to allow you to use uvhdc2 with your own data-files

5C3. test/demo uvhdc2 with sequeential file
uvhdc2 dat1/ar.customer.master - sample display
==============================

5C4. test/demo uvhdc2 with GDG files
uvhdc2 dat1/gl.account.master_ <-- id via trailing '_' underscore
==============================

5D1. ctlfile_uvhdc1 listing - demo uvhdc1 with no setup required
5D2. ctlfile_uvhdc2 listing - guide for your control file steup
5E1. script uvhdc1 listing
5E2. script uvhdc2 listing
5F1. uvcopy job 'uvhdget2' called by 'uvhdc1/2'

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

5A1. scripts 'uvhdc1/2' make it easier to use 'uvhdcob'

uvhdc1/uvhdc2 - overview

uvhdc1/uvhdc2 are scripts to display data field-contents with COBOL copybook field-names. They can do this using an Indexed file that relates the data file-name to the copybook-name, record-size,& file-type.

uvhdc1/uvhdc2 scripts call 'uvhdcob' (the C program that displays data fields with copybook names). Using 'uvhdcob' directly requires specifying the copybook/map-name in addition to the data-file-name. Here are examples of calling uvhdcob directly or indirectly via script uvhdc2.


 uvhdcob dat1/ar.customer.master mf/maps/custmas1 <-- uvhdcob needs cobmap
 ================================================

 uvhdc1 dat1/ar.customer.master   <-- uvhdc1/uvhdc2 allow OMITTING COPYBOOK/MAP
 ==============================

Using scripts uvhdc1/uvhdc2 is much easier because we do not need to specify (or remember) the copybook name or where it is. To enable using uvhdc2, we do need to invest some time in creating the control-file, but this process is well documented & there is a utility to create a skeleton as follows:

uvhdc1/uvhdc2 - difference

uvhdc1
  • is for demos that you can run in /home/uvadm
  • control file provided for demo data-files & copybooks
uvhdc2
  • is for you to modify/customize to access your data-files.
  • you need to create a control file to relate your data-files
    to the corresponding copybook

creating control file - manually


 vi ctl/ctlfile_uvhdc2    <-- create control file
 =====================
 ar.customer.master                 cpy=custmas1   rcs=00256 typ=RSF   ops=f
 ar.sales.items                     cpy=saledtl    rcs=00064 typ=RSF   ops=f
 gl.account.trans_                  cpy=acnttran   rcs=00080 typ=RSF   ops=f
Note
  • see the ctl/ctlfile_uvhdc1 demo control file listed on page '5B2'

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

5A2. scripts 'uvhdc1/2' make it easier to use 'uvhdcob'

creating control file - automatically

uvcopy job 'data2cpy51' will read your directory of data-files & create a skeleton control file for you to edit in the approriate copybook-names.


 #1. uvcopy data2cpy51,fild1=data,filo2=ctl/ctlfile_uvhdc2
     =====================================================
     - read data directory, extract all filenames,& create control-file skeleton
 ar.customer.master                 cpy=________   rcs=_____ typ=_____ ops=__
 ar.sales.items                     cpy=________   rcs=_____ typ=_____ ops=__
 gl.account.trans_000001            cpy=________   rcs=_____ typ=_____ ops=__
 gl.account.trans_000002            cpy=________   rcs=_____ typ=_____ ops=__

 #2. vi ctl/ctlfile_uvhdc2    <-- edit auto-generated ctlfile to fill in the blanks
     =====================
 ar.customer.master                 cpy=custmas1   rcs=00256 typ=RSF   ops=f
 ar.sales.items                     cpy=saledtl    rcs=00064 typ=RSF   ops=f
 gl.account.trans_                  cpy=acnttran   rcs=00080 typ=RSF   ops=f

 #3. uvcopy loadctlI,fili1=ctl/ctlfile_uvhdc2,filo1=ctl/ctlfile_uvhdc2I
     ==================================================================
     - load edited control file into Indexed file for look-up by uvhdc2

 #4. uvcopyx cobmap1 cpys maps uop=q0i7
     ==================================
     - must convert your copybooks to record layouts (maps) which are accessed
       by the uvhdcob utility via scripts uvhdc1/uvhdc2

notes re ctlfile preparation

You would fill in the blanks (copybook,recsize,typ,options) for the files that you intend to display with uvhdc2/uvhdcob. You would omit files such as output lists (reports) - you dont need uvhdcob for these.

For GDG files - you can delete all but 1 entry & remove the 6 digit generation#. The uvhdc2 script recognizes a GDG file by the trailing '_' underscore & display the latest generation. If desired you may specify the generation# & uvhdc2 knows to use the file maatch with trailing '_'.

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

5A3. scripts 'uvhdc1/2' make it easier to use 'uvhdcob'

scripts to make uvhdcob easier to use

Scripts 'uvhdc1' & 'uvhdc2' make it easier to use 'uvhdcob' because:

  1. You do not need to specify the copybook, just the datafile,

  2. You do not need to specify file type options, since they can be picked up from the control file.

This system depends on the following components, listed later in this part (if a link given here).


5E1. uvhdc1 demo script - supplied in /home/uvadm/sf/util/uvhdc1
- intended for demos you can run in /home/uvadm with no setup
- using files in dat1/... & cobmaps in mf/maps/...

5E2. uvhdc2 production script - supplied in /home/uvadm/sf/util/uvhdc2
- intended for you to customize for your datafiles & copybooks/maps
- see control-file setup instructions on page '5C2'
- Op. Instrns. setup in /home/mvstest/testlibs & testdata
  but you can use subdirs in your homedir or your actual production dirs

5D1. ctlfile_uvhdc1 control files - supplied in /home/uvadm/mf/ctl/...
- already loaded into Indexed file mf/ctl/ctlfile_uvhdc1I.dat & .idx

5D2. ctlfile_uvhdc2 control files - supplied in /home/uvadm/ctl/...
- use as a guide to create your own control-file
- see instructions as #comments at begining of ctlfile_uvhdc2
- customize & load into Indexed files $RUNLIBS/ctl/ctlfile_uvhdc2I.dat/.idx
- our Op. Instrns. will use RUNLIBS=/home/mvstest/testlibs/...

3A1. demo copybooks: mf/cpys/vendormas, mf/cpys/vendorpay,
  cobmaps: mf/maps/vendormas, mf/maps/vendorpay,
3B1.  demo datafiles: dat1/vendormas0/1/2/3/4, dat1/vendorpay0/1/2/3/4
- datafiles & cobmaps related by mf/ctl/ctlfile_uvhdc1
 XXX. production copybooks: $RUNLIBS/cpys/custmas1, saledtl, acntmas
                   cobmaps: $RUNLIBS/maps/custmas1, saledtl, acntmas
      production datafiles: $RUNDATA/ar.customer.master, ar.sales.items,
                            $RUNDATA/gl.account.master_ (GDG)
      - datafiles & cobmaps related by $RUNLIBS/ctl/ctlfile_uvhdc1

5F1. uvhdget2, uvcopy job to lookup indexed control file to get copybook name
- uvcopy job supplied in /home/uvadm/pf/util/uvhdget2

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

5A4. 'uvhdc1/2' scripts make it easier to use 'uvhdcob'

$CTLMAPDIR, $RUNLIBS, $RUNDATA, $CNVDATA

The scripts use environmental variables CTLMAPDIR,RUNLIBS,RUNDATA,CNVDATA (in that sequence) to define the superdir for subdirs ctl/... & maps/...

CTLMAPDIR is not defined in the supplied profiles, so the default will be RUNLIBS. You can define CTLMAPDIR when you need to override the default.

For our 1st demos (uvhdc1, $UV/mf/maps, $UV/mf/ctl/ctlfile_uvhdc1), we will define CTLMAPDIR as follows (can export from prompt):


 export CTLMAPDIR=/home/uvadm/cobol
 ==================================

For production (uvhdc2) we will use the defaults defined in the .bash_profile.


 export RUNLIBS=/home/mvstest/testlibs
 =====================================
 - control-file used by uvhdc2 will be: /home/mvstest/testlibs/ctl/ctlfile_uvhdc2
 - copybookmaps used by uvhdc2 will be: /home/mvstest/testlibs/maps/...

data-file locations

The data-files can be anywhere & you could be in the same directory, but we recommend you stay 1 level above the data-files (your working directory).

The whole idea of these scripts (uvhdc1 & uvhdc2) is that you can be anywhere convenient to your data-files & you do not have to know or specify the path to the copybook/cobmap, which could be a long inconvenient path.

For our production Op. Instrns. (on page '5C3'), our .bash_profile will have:


 export RUNDATA=/home/mvstest/testdata
 =====================================

AND, our test data files will be in: /home/mvstest/testdata/data1/...

BUT, the scripts do NOT use $RUNDATA (allowing data-files to be anywhere).

Assuming we want to use the data-files in their normal place $RUNDATA/data, we could use $RUNDATA only indirectly via alias 'cdd' to get us to our working directory $RUNDATA 1 level above our files in data1/... For example:


 #1. Login --> /home/mvstest

 #2. cdd --> /home/mvstest/testdata (since alias cdd='cd $RUNDATA')

 #3. uvhdc2 data1/ar.customer.master
     ==============================
     - see display later on page '5C3'

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

5B1. 'uvhdc1/2' scripts make it easier to use 'uvhdcob'

uvhdc1 demo in /home/uvadm/...

We will 1st demo the script using the supplied copybooks & datafiles (previously listed at '3A1' & '3B1'). You can run these demos in /home/uvadm/ or you can run in your homedir if you copy demo files as shown on page '3C1'. Here are the directories relevant to demonstrating the uvhdc1 script.

 /home/uvadm
 :----mf                       <-- test/demo libraries
 :    :----cpys/                 - copybooks
 :    :    :----custmas1.cpy
 :    :    :----saledtl.cpy
 :    :    :----vendormas.cpy
 :    :    :----vendorpay.cpy
 :    :    :----vendorpaymas.cpy
 :    :    :
 :    :----maps/               <-- maps (record layouts) generated from copybooks
 :    :    :----custmas1
 :    :    :----saledtl
 :    :    :----vendormas
 :    :    :----vendorpay
 :    :    :----vendorpaymas
 :    :    :
 :    :----ctl/                <-- control files
 :    :    :----ctlfile_uvhdc1      <-- sequential ctlfile for editing
 :    :    :----ctlfile_uvhdc1I.dat <-- Indexed control for lookup by uvhdget2
 :    :    :----ctlfile_uvhdc1I.idx   - loaded by 'uvcopy loadctl1'
 :----dat1                     <-- test/demo data files
 :    :----custmas0              - fixed length EBCDIC
 :    :----custmas1              - fixed length ASCII
 :    :----sales0                - fixed length EBCDIC
 :    :----sales1                - fixed length ASCII
 :    :----vendormas0            - Fixed length EBCDIC
 :    :----vendormas1            - Fixed length ASCII
 :    :----vendormas2            - text file (LineFeed after last nonblank)
 :    :----vendormas3            - RDW (4 byte prefix, binary recsize in 1st 2)
 :    :----vendormas4            - IDXFORMAT1 (Micro Focus fixed length)
 :    :
 :    :----vendorpay0/1/2/3/4    - payment records (same 5 formats as above)
 :    :
 :    :----vendorpaymas0/1/2/3/4 - multi-record-type file (payments + names)
                                 - same 5 formats as above

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

5B2. uvhdc1 demo in /home/uvadm/...

Pre-Requisites for uvhdc1/uvhdc2

I have already performed these pre-requisites for the demos in /home/uvadm using script 'uvhdc1' & control file 'ctlfile_uvhdc1'. You can repeat them if you wish & you would have to do similar commands to setup ctlfile_uvhdc2 for your own files (for the uvhdc2 script).


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

 #2. uvcopyx cobmap1 mf/cpys mf/maps uop=q0i7
     ========================================
     - convert the 'copybooks' to 'cobmaps'
       (record layouts with field start/end/length/type on right side)

 #3. vi mf/ctl/ctlfile_uvhdc1
     ========================
     - create the control file to relate datafiles to copybooks & filetypes
     - here are a few sample records
     - see complete control file listed on page '5D1'
 #-----datafile------       --copybook--      -recsize-  -type-   -options-
 custmas0                   cpy=custmas1      rcs=00256  typ=RSF    ops=fa
 custmas1                   cpy=custmas1      rcs=00256  typ=RSF    ops=f
 sales0                     cpy=sales1        rcs=00064  typ=RSF    ops=fa
 sales1                     cpy=sales1        rcs=00064  typ=RSF    ops=f
 vendormas0                 cpy=vendormas     rcs=00064  typ=RSF    ops=fa
 vendormas1                 cpy=vendormas     rcs=00064  typ=RSF    ops=f
 vendormas2                 cpy=vendormas     rcs=00064  typ=LST    ops=t
 vendormas3                 cpy=vendormas     rcs=00064  typ=RDW    ops=z4
 vendormas4                 cpy=vendormas     rcs=00064  typ=IDXf1  ops=v
 vendorpay0                 cpy=vendorpay     rcs=00064  typ=RSF    ops=fa
 vendorpay1                 cpy=vendorpay     rcs=00064  typ=RSF    ops=f
 vendorpay2                 cpy=vendorpay     rcs=00064  typ=LST    ops=t
 vendorpay3                 cpy=vendorpay     rcs=00064  typ=RDW    ops=z4
 vendorpay4                 cpy=vendorpay     rcs=00064  typ=IDXf1  ops=v
 vendorpaymas0              cpy=vendorpaymas  rcs=00064  typ=RSF    ops=fa
 vendorpaymas1              cpy=vendorpaymas  rcs=00064  typ=RSF    ops=f
 vendorpaymas2              cpy=vendorpaymas  rcs=00064  typ=LST    ops=t
 vendorpaymas3              cpy=vendorpaymas  rcs=00064  typ=RDW    ops=z4
 vendorpaymas4              cpy=vendorpaymas  rcs=00064  typ=IDXf1  ops=v

 #4. uvcopy loadctlI,fili1=mf/ctl/ctlfile_uvhdc1,filo1=mf/ctl/ctlfile_uvhdc1I
     ========================================================================
     - load the control file into an indexed file for random access by uvhdget2
Note
  • We created ctlfile_uvhdc1 with the 'vi' editor, OK for a few demo files
  • For the uvhdc2 demo in mvstest dirs, we will show you how to use
    'uvcopy data2cpy51' to automatically extract your data-file-names from
    your data1/ directory & create a skeleton control-file with fill in the
    blanks for copybook, recsize, type,& options.

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

5B3. 'uvhdc1' script make it easier to use 'uvhdcob'

test/demo uvhdc1

We will 1st demo the script using the copybooks & datafiles already listed above starting at '3A1' & '3B1'. You can run demos in /home/uvadm/... as follows:


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

 #2a. ls -l dat1/vendor*             <-- list demo data datafiles available
      ==================               - listed above starting on page '3B1'
 #2b. ls -l mf/maps/vendor*       <-- list demo copybook/maps available
      =====================         - listed above starting on page '3A1'
 #2c. more mf/ctl/ctlfile_uvhdc1  <-- list demo control files available
      ==========================    - listed below starting on page '5D1'

 #3. export CTLMAPDIR=/home/uvadm/cobol <-- define superdir for uvhdc1 to look
     ==================================     for subdirs of maps/... & ctl/...

 #4. uvhdc1 dat1/vendorpay0   <-- run script to display EBCDIC version of file
     ======================

sample display dat1/vendormas0

 now=20130111:1645 uvhdcob dat1/vendorpay0 r00064fam24
 version=20120911 copybook=/home/uvadm/mf/maps/vendorpay
 rec#=1 rcount=8 rsize=64 fsize=512 fptr=0
 rec#       1           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 venpay-num                   0    5    DELL10
 002 venpay-type                  6    9     P
 003 venpay-date                 10   19    20100131
 004 venpay-inv                  20   29    INV00010
 005 venpay-amt                  30   38 n  000195000
 006 filler001                   39   39
 007 venpay-item                 40   63    Dell server 2900
 rec#=1 rcount=8 rsize=64 fsize=512 fptr=0
 Enter command, or ?=Help, or null=NextRecord -->
Note
  • uvhdc1 allows you to specify only the datafilename
    & omit the copybookname
  • the uvhdc1 script will call the uvhdcob program as shown below
    using info from the control-file (copybook, recsize, options)

 #5a. uvhdcob dat1/vendormas0 $CTLMAPDIR/maps/vendormas fr64a
      =======================================================

 #5a. uvhdcob dat1/vendormas0 /home/uvadm/mf/maps/vendormas fr64a
      ===========================================================
      - same with $CTLMAPDIR expanded
Note
  • the convenience of not having to remember the copybook-name & filetype
  • in this case filetype is f=Fixedlth, r=recsize 64,& a=translate to ASCII

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

5C1. 'uvhdc2' script makes it easier to use the 'uvhdcob' program

uvhdc2 demo in /home/mvstest/...

'uvhdc2' is intended for your implementation (vs 'uvhdc1' used in demos above).

We will illustrate uvhdc2 using the 'mvstest' files supplied to demo the JCL conversions. The mvstest files are distributed in /home/uvadm/mvstest/..., but we recommend you setup a separate user 'mvstest' & copy:


 cp -r /home/uvadm/mvstest/* /home/mvstest
 =========================================

The mvstest files are more relevant to mainframe conversions than the 'vendor' files used in the uvhdc1 demos above. See mvstest setup procedures in JCLcnv1demo.htm#Part_3. Alternatively, you could copy the test files to subdirs in your homedir:


 #1. Login --> your homedir
 #2. mkdir testlibs testdata
 #3a. cp /home/mvstest/testlibs/* testlibs/
 #3b. cp /home/mvsdata/testdata/* testdata/

Here are the directories & files relevant to illustrating the uvhdc2 script.

 /home/mvstest
    -- OR --
 /home/yourhomedir
 :----testlibs                   <-- test/demo libraries
 :    :----cpys/                   - copybooks
 :    :    :----acntmas.cpy
 :    :    :----acnttran.cpy
 :    :    :----custmas1.cpy
 :    :    :----saledtl.cpy
 :    :----maps/                 <-- record layouts generated from copybooks
 :    :    :----acntmas
 :    :    :----acnttran
 :    :    :----custmas1
 :    :    :----saledtl
 :    :----ctl/                  <-- control files
 :    :    :----ctlfile_uvhdc2     - sequential ctlfile for editing
 :    :    :----ctlfile_uvhdc2.dat - Indexed control for lookup by uvhdget2
 :    :    :----ctlfile_uvhdc2.idx
 :----testdata                   <-- test/demo data files
 :    :----data1/
 :    :    :----ar.customer.master              - sequential file
 :    :    :----ar.customer.master.indexed.dat  - Indexed file
 :    :    :----ar.customer.master.indexed.idx
 :    :    :----ar.sales.items
 :    :    :----gl.account.master_000001        - GDG files
 :    :    :----gl.account.master_000002
 :    :    :----gl.account.trans_000001
 :    :    :----gl.account.trans_000002

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

5C2. uvhdc2 demo in /home/mvstest or your homedir

setup to illustrate uvhdc2


 #1. Login mvstest --> /home/mvstest
     =============
 Alternatively, you could copy the test files to subdirs in your homedir:
      #1a. Login yourself --> your homedir
      #1b. mkdir testlibs testdata
      #1c. cp /home/mvstest/testlibs/* testlibs/
      #1d. cp /home/mvsdata/testdata/* testdata/

 #2. cd testlibs   <-- change to /home/uvadm/mvstest/testlibs
     ===================

 #3. uvcopyx cobmap1 cpys maps uop=q0i7
     ==================================
     - convert the 'copybooks' to 'cobmaps'
       (record layouts with field start/end/length/type on right side)

 #2. uvcopy data2cpy51,fild1=$RUNDATA/data,filo2=ctl/ctldata50
     =========================================================
     - extract data1/filenames to create skeleton with cpy=___ to fill in

 #3. cp ctl/ctldata50 ctl/ctlfile_uvhdc2 - rename as expected by uvhdc2
     ===================================

 #4. vi ctl/ctlfile_uvhdc2
     =====================
     - edit the control file to relate datafiles to copybooks & filetypes
     - fill in the blanks cpy=____ rcs=____ typ=___ ops=__ left by data2cpy51
     - see complete control file listed on page '5D2'

 #5. uvcopy loadctlI,fili1=ctl/ctlfile_uvhdc2,filo1=ctl/ctlfile_uvhdc2I
     ==================================================================
     - load the control file into an indexed file for random access by uvhdc2

samples from ctlfile_uvhdc2

 ar.customer.master                 cpy=custmas1   rcs=00256 typ=RSF   ops=f
 ar.customer.master.indexed         cpy=custmas1   rcs=00256 typ=IDXf1 ops=f
 ar.customer.nameadrs.list100       cpy=________   rcs=_____ typ=_____ ops=__
 ar.customer.sales2                 cpy=saledtl    rcs=00048 typ=RSF   ops=t
 gl.account.acntlist_               cpy=________   rcs=_____ typ=_____ ops=__
 gl.account.master_                 cpy=acntmas    rcs=00128 typ=RSF   ops=f
 gl.account.trans_                  cpy=acnttran   rcs=00080 typ=RSF   ops=f
Note
  • #2 & #3 above would overwrite our edited file
  • but please try out #2 uvcopy data2cpy51 to generate control-file
  • you could then recover our edited file as follows:

 #4a. cp /home/uvadm/ctl/ctlfile_uvhdc2 /home/mvstest/testlibs/
      =========================================================

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

5C2. uvhdc2 demo in /home/mvstest or your homedir

test/demo uvhdc2


 #1. Login mvstest --> /home/mvstest
        -- OR --
     Login yourself --> your homedir
     ===============================
     - if you have copied /home/mvstest/testlibs,testdata to your homedir

 #2. cdd     --> /home/mvstest:yourhomedir/testdata
     ====

 alias cdd='cd $RUNDATA'       <-- alias definition in common_profile
 =======================
 export RUNDATA=$HOME/testdata <-- 'cdd' depends on .bash_profile export RUNDATA
 =============================

 #3. l data         <-- list data files
     ======

 #4. uvhdc2 data1/ar.customer.master
     ==============================
     - uvhdc2 script calls the uvhdcob program as follows:

 #5a. uvhdcob data1/ar.customer.master $RUNLIBS/maps/custmas fr256
      ===========================================================
      - with $RUNLIBS expanded it will be as shown below

 #5b. uvhdcob data1/ar.customer.master /home/mvstest/testlibs/maps/custmas fr256
      =========================================================================
      - options 'fr256' f=Fixed-length, r256=Recsize 256
Note
  • uvhdc2 convenience: not having to remember the copybook,filetype,rec-size

sample display dat1/ar.customer.master

 uvhdcob datafile=data1/ar.customer.master
 20090222:0844 copybook=/home/mvstest/testlibs/maps/custmas options=
 record#=1 totalrecs=32 recsize=256 filesize=8192 fileptr=0
 rec#       1 fieldname occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 cm-num                       0   5 n  130140
 002 cm-delete                    6   9
 003 cm-name                     10  34    EVERGREEN MOTORS LTD.
 004 cm-adrs                     35  59    1815 BOWEN ROAD
 005 cm-city                     60  75    NANAIMO
 007 cm-prov                     77  78    BC
 009 cm-postal                   80  89    V9S1H1
 010 cm-phone                    90 101    250-754-5531
 011 cm-contact                 102 119     LARRY WRENCH
 012 cm-thisyr-sales       012  120 124pns 001234567C
 013 cm-lastyr-sales       012  180 184pns 001234567D
 014 filler003                  240 255    C 19950531

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

5C4. 'uvhdc2' script make it easier to use 'uvhdcob'

test/demo uvhdc2 with GDG files

'uvhdc2' can recognize GDG files because they are uniquely identified by a trailing '_' underscore + the 6 digit generation#. The generation# may be omitted, in which case uvhdc2 will display the latest generation. We will prove it as follows:


 #1. Login mvstest --> /home/mvstest
     OR Login yourself --> your homedir
     -- assuming you have copied testlibs/testdata files to your homedir

 #2. cdd     --> /home/mvstest:yourhomedir/testdata
     ====

 #3. l data1/gl.account.master_*    <-- list GDG files
     ==========================
 -rw-rw-r--  1 mvstest apps 13952 Mar 17  2012 data1/gl.account.master_000001
 -rw-rw-r--  1 mvstest apps 13952 Jan 11 17:44 data1/gl.account.master_000002
 -rw-rw-r--  1 mvstest apps 13952 Jan 11 17:44 data1/gl.account.master_000003

 #4. uvhdc2 data1/gl.account.master_     <-- generation# omitted
     ==============================  note - gen# '_000003' selected below
 now=20130111:1804 uvhdcob data1/gl.account.master_000003 r00128fm24
 version=20120911 copybook=/home/mvstest/testlibs/maps/acntmas
 rec#=1 rcount=109 rsize=128 fsize=13952 fptr=0
 rec#       1           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 am-status                    0    0
 002 am-acnt1                     1    5 n  11100
 003 am-filler1                   6   12
 004 am-acnt2                    13   17 n  11100
 005 am-description              18   47    Royal Bank Lynn Valley
 006 am-balance                  48   53pns 00001907628C
 007 am-lastupdate               54   61 n  20090331
 008 am-filler2                  62  127

 #5. uvhdc2 data1/gl.account.master_000001     <-- generation# specified
     ====================================  note - gen# '_000001' confirmed below
 now=20130111:1804 uvhdcob data1/gl.account.master_000001 r00128fm24
 version=20120911 copybook=/home/mvstest/testlibs/maps/acntmas
 rec#=1 rcount=109 rsize=128 fsize=13952 fptr=0
 rec#       1           occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 am-status                    0    0
 002 am-acnt1                     1    5 n  11100
 003 am-filler1                   6   12
 004 am-acnt2                    13   17 n  11100
 005 am-description              18   47    Royal Bank Lynn Valley
 006 am-balance                  48   53pns 00001907628C
 007 am-lastupdate               54   61 n  20090131
 008 am-filler2                  62  127

Also note that the 'lastupdate' field has different dates in the generations.

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

5D1. control-files for uvhdc1/uvhdc2 scripts

ctlfile_uvhdc1 - for demo in uvadm dirs

 # ctlfile_uvhdc1 - sample control file for script 'uvhdc1' (calls uvhdcob)
 #                - see complete doc at www.uvsoftware.ca/uvhdcob.htm#Part_5
 #                - stored at /home/uvadm/mf/ctl/ctlfile_uvhdc1 for demos
 #                - using data files in /home/uvadm/dat1/...
 #                  (custmas1, vendormas0/1/2/3/4, vendorpay0/1/2/3/4, ...)
 #                - using copybook/maps in /home/uvadm/mf/maps/...
 #                  (custmas1,vendormas,vendorpay,vendorpaymas)
 # ctlfile_uvhdc1 - for demos run in /home/uvadm/... with no setup required
 # ctlfile_uvhdc2 - intended for you to copy/customize for your own files
 #
 # ctlfile - saves having to specify copybook/map for uvhdcob & desired datafile
 #         - using uvhdcob directly requires copybook/map
 #           (awkward when datafile & copybook in different filesystems)
 #
 # uvhdcob dat1/custmas1 mf/maps/custmas1 <--using uvhdcob program directly
 # ======================================    requires both datafile & copybook
 #
 # uvhdc1 dat1/custmas1      <-- script 'uvhdc1' saves coding copybook/map
 # ====================        - looks-up ctlfile to get copybook
 #
 #                     ** Pre-Requisites for uvhdc1 **
 #
 # 0. cd $CTLMAPDIR or $RUNLIBS or $RUNLIBS or $CNVDATA
 # 1. uvcopyx cobmap1 cpys maps uop=q0i7p0  <-- create cobmaps
 #    ====================================
 # 2. vi ctl/ctlfile_uvhdc1  <-- edit ctlfile to relate datafiles to copybooks
 #    =====================
 # 3. uvcopy loadctlI,fili1=ctl/ctlfile_uvhdc1,filo1=ctl/ctlfile_uvhdc1I
 #    ==================================================================
 #Note - loadctlI will load following non #comment lines into Indexed file
 #     - filename max 60 bytes, cpy=... shifted over as required
 #
 #-----datafile------       --copybook--      -recsize-  -type-   -options-
 custmas0                   cpy=custmas1      rcs=00256  typ=RSF    ops=fa
 custmas1                   cpy=custmas1      rcs=00256  typ=RSF    ops=f
 sales0                     cpy=sales1        rcs=00064  typ=RSF    ops=fa
 sales1                     cpy=sales1        rcs=00064  typ=RSF    ops=f
 vendormas0                 cpy=vendormas     rcs=00064  typ=RSF    ops=fa
 vendormas1                 cpy=vendormas     rcs=00064  typ=RSF    ops=f
 vendormas2                 cpy=vendormas     rcs=00064  typ=LST    ops=t
 vendormas3                 cpy=vendormas     rcs=00064  typ=RDW    ops=z4
 vendormas4                 cpy=vendormas     rcs=00064  typ=IDXf1  ops=v
 vendorpay0                 cpy=vendorpay     rcs=00064  typ=RSF    ops=fa
 vendorpay1                 cpy=vendorpay     rcs=00064  typ=RSF    ops=f
 vendorpay2                 cpy=vendorpay     rcs=00064  typ=LST    ops=t
 vendorpay3                 cpy=vendorpay     rcs=00064  typ=RDW    ops=z4
 vendorpay4                 cpy=vendorpay     rcs=00064  typ=IDXf1  ops=v
 vendorpaymas0              cpy=vendorpaymas  rcs=00064  typ=RSF    ops=fa
 vendorpaymas1              cpy=vendorpaymas  rcs=00064  typ=RSF    ops=f
 vendorpaymas2              cpy=vendorpaymas  rcs=00064  typ=LST    ops=t
 vendorpaymas3              cpy=vendorpaymas  rcs=00064  typ=RDW    ops=z4
 vendorpaymas4              cpy=vendorpaymas  rcs=00064  typ=IDXf1  ops=v

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

5D2. control-files for uvhdc1/uvhdc2 scripts

ctlfile_uvhdc2 for script uvhdc2

 # ctlfile_uvhdc2 - sample control file for script 'uvhdc2' (calls uvhdcob)
 #                - see complete doc at www.uvsoftware.ca/uvhdcob.htm#Part_5
 # - stored at /home/uvadm/mvstest/testlibs/ctl/ctlfile_uvhdc2
 # - using data files in /home/uvadm/mvstest/testdata/data1/...
 # - using copybook/maps in /home/uvadm/mvstest/testlibs/cpys/... & maps/...
 # - intended for use with mvstest mainframe conversion demo files
 # ctlfile_uvhdc2 - intended for you to copy/customize for your own files
 # ctlfile_uvhdc1 - for demos run in /home/uvadm/... with no setup required
 #
 # ctlfile - saves having to specify copybook/map for uvhdcob & desired datafile
 #         - using uvhdcob directly requires copybook/map
 #           (awkward when datafile & copybook in different filesystems)
 #
 # uvhdcob dat1/custmas1 mf/maps/custmas1 <--using uvhdcob program directly
 # ======================================    requires both datafile & copybook
 #
 # uvhdc2 dat1/custmas1      <-- script 'uvhdc2' saves coding copybook/map
 # ====================        - looks-up ctlfile to get copybook
 #
 #                     ** Pre-Requisites for uvhdc2 **
 #
 # 0. cd $CTLMAPDIR or $RUNLIBS or $RUNLIBS or $CNVDATA
 # 1. uvcopyx cobmap1 cpys maps uop=q0i7p0  <-- create cobmaps
 #    ====================================
 # 2. uvcopy data2cpy51,fild1=$RUNDATA/data,filo2=ctl/datacpy51
 #    =========================================================
 #    - extract data1/filenames to create skeleton with cpy=___ to fill in
 #
 # 3. cp ctl/datacpy51 ctl/ctlfile_uvhdc2 - rename as expected by uvhdc2
 #    ===================================
 # 4. vi ctl/ctlfile_uvhdc2  <-- edit ctlfile to relate datafiles to copybooks
 #    =====================
 # 5. uvcopy loadctlI,fili1=ctl/ctlfile_uvhdc2,filo1=ctl/ctlfile_uvhdc2I
 #    ==================================================================
 #Note - loadctlI will load following non #comment lines into Indexed file
 #     - filename max 60 bytes, cpy=... shifted over as required
 #
 #-------datafile------      --copybook--      -recsize-  -type-   -options-
 ar.customer.master                 cpy=custmas1   rcs=00256 typ=RSF   ops=f
 ar.customer.master.indexed         cpy=custmas1   rcs=00256 typ=IDXf1 ops=f
 ar.customer.nameadrs.list100       cpy=________   rcs=_____ typ=_____ ops=__
 ar.customer.sales2                 cpy=saledtl    rcs=00048 typ=RSF   ops=t
 ar.product.list                    cpy=________   rcs=_____ typ=_____ ops=__
 ar.sales.items2                    cpy=saledtl    rcs=00064 typ=RSF   ops=f
 ar.sales.items3                    cpy=saledtl    rcs=00064 typ=RSF   ops=f
 ar.sales.items                     cpy=saledtl    rcs=00064 typ=RSF   ops=f
 ar.sales.items.sorted              cpy=saledtl    rcs=00064 typ=RSF   ops=f
 ar.sales.list                      cpy=________   rcs=_____ typ=_____ ops=__
 gl.account.master_                 cpy=acntmas    rcs=00128 typ=RSF   ops=f
 gl.account.trans_                  cpy=acnttran   rcs=00080 typ=RSF   ops=f
 vendormas3                         cpy=vendormas  rcs=00064  typ=RDW  ops=z4
 #note - control file auto generated from data1/... by 'uvcopy data2cpy51'
 #     - then edited to fill in cpy=___ rcs=___ typ=___ & ops=__

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

5E1. 'uvhdc1' script make it easier to use 'uvhdcob'

script uvhdc1 - listing

 #!/bin/ksh
 # uvhdc1 - Korn shell script from UVSI stored in: /home/uvadm/sf/demo/
 # uvhdc1 - script to run uvhdcob without specifying copybookname
 #        - using uvhdcob directly requires copybookname
 #          (awkward when datafile & copybook in different filesystems)
 #        - see complete doc at www.uvsoftware.ca/uvhdcob.htm#Part_5
 #Jan08/13 - remove subdir from ctlfile names, allow datafiles in any subdir
 #
 # uvhdc2 - also see uvhdc2 for production (example mvstest/testlibs,testdata)
 # uvhdc1 - this script for demo in /home/uvadm/...
 # uvhdc1 - datafiles       in /home/uvadm/dat1/...
 #        - copybook/maps   in /home/uvadm/mf/maps/...
 #        - ctlfile_uvhdc1I in /home/uvadm/mf/ctl/...
 #
 # export CTLMAPDIR=/home/uvadm/cobol
 # ==================================
 # - for demo documented at www.uvsoftware.ca/uvhdcob.htm#Part_5
 #
 # uvhdc1 dat1.custmas1      <-- sample command for this script
 # ====================
 # - above script 'uvhdc1' generates following 'uvhdcob' command:
 #   (using control file entry matching datafilename spcfd)
 #
 # uvhdcob dat1/custmas1 $CTLMAPDIR/maps/custmas1 r256
 # ===================================================
 # - uvhdc1 looks for control-file & copybookmap in $CTLMAPDIR
 #   ($CTLMAPDIR/ctl/ctlfile_uvhdc1 & $CTLMAPDIR/maps/...)
 # - if $CTLMAPDIR undefined, default to $CNVDATA, $RUNLIBS, or $RUNDATA
 #
 #                    ** sample control file **
 #
 # custmas0                 cpy=custmas1      rcs=00256  typ=RSF    ops=fa
 # custmas1                 cpy=custmas1      rcs=00256  typ=RSF    ops=f
 # sales0                   cpy=sales1        rcs=00064  typ=RSF    ops=fa
 # sales1                   cpy=sales1        rcs=00064  typ=RSF    ops=f
 # vendormas0               cpy=vendormas     rcs=00064  typ=RSF    ops=fa
 # vendormas1               cpy=vendormas     rcs=00064  typ=RSF    ops=f
 # vendormas2               cpy=vendormas     rcs=00064  typ=LST    ops=t
 # vendormas3               cpy=vendormas     rcs=00064  typ=RDW    ops=z4
 # vendormas4               cpy=vendormas     rcs=00064  typ=IDXf8  ops=v
 #
 # This script (uvhdc1) calls uvcopy job 'uvhdget2' to lookup the control file
 # to get the copybookname & options (record-size & file-type), for example:
 #
 # uvhdc1 d2asc/custmas1  <-- script minimizes keystrokes required
 # =====================
 #
 # uvcopy uvhdget2,filr1=$CTLMAPDIR/ctl/ctlfile_uvhdc1I,filo1=/tmp/$LOGNAME.cpy\
 #                ,arg1=custmas1
 # =============================================================================
 #
 # uvhdcob d2asc/custmas1 $CTLMAPDIR/maps/custmast
 # ===============================================
 # - long 'uvhdcob' command generated from short 'uvhdc1' script
 #
 #                ** Pre-Requisites for uvhdc1 **
 #
 # 0. cd $CTLMAPDIR or $CNVDATA or $RUNLIBS or $RUNLIBS
 # 1. uvcopyx cobmap1 cpys maps uop=q0i7p0  <-- create cobmaps
 #    ====================================
 # 2. uvcopy data2ctl50,fild1=$RUNDATA/data,filo2=ctl/ctldata50
 #    ==========================================================
 #    - extract data1/filenames to create skeleton with cpy=___ to fill in
 # 3. sort ctl/ctldata50 -o ctl/ctlfile_uvhdc1 - sort filenames & rename
 #    ========================================   as expected by uvhdc1
 # 4. vi ctl/ctlfile_uvhdc1  <-- edit ctlfile to relate datafiles to copybooks
 #    =====================
 # 5. uvcopy loadctlI,fili1=ctl/ctlfile_uvhdc1,filo1=ctl/ctlfile_uvhdc1I
 #    ==================================================================
 #Note - load control file to Indexed file for use by uvhdget2
 #     - keyed by datafilename to lookup copybook/map, recsize,& filetype options
 #
 file1="$1"; clops="$2" # give names to arg1(datafilename) & arg2(options)
 file2="$1"             # will append .dat if Indexed
 file3=$(basename "$1") # basename (with subdir removed)
 if [[ -z "$clops" ]]; then clops=m24; fi
 # if CTLMAPDIR undefined, default to $RUNLIBS or $RUNDATA or $CNVDATA
 if   [[ -d "$CTLMAPDIR" ]]; then :
 elif [[ -d "$RUNLIBS" ]]; then export CTLMAPDIR=$RUNLIBS;
 elif [[ -d "$RUNDATA" ]]; then export CTLMAPDIR=$RUNDATA;
 elif [[ -d "$CNVDATA" ]]; then export CTLMAPDIR=$CNVDATA;
 else echo "superdir not found for .../ctl/ctlfile_uvhdc1 & .../maps/..."
      echo "- use 1st superdir in: \$CTLMAPDIR,\$RUNLIBS,\$RUNDATA,\$CNVDATA"
 exit 99; fi
 # filenames ending with '_' indicate generation files
 # - get latest generation using exportgen0 function
 export GTMP=tmp
 if [[ "$file1" == *_ ]]; then exportgen0 +0 file1 $file1; fi
 # verify user filename is a valid file
 # - check for Indexed file & set file2 = $file1.dat if indexed
 if [[ -f "$file1.dat" ]]; then file2=$file1.dat; fi
 if [[ ! -f "$file2" ]]
    then echo "usage: uvhdc1 datafile [options]"
         echo "       ========================="
         echo "example: uvhdc1 dat1/custmas1"
         echo "         ===================="
         echo "arg1 - data file in $CTLMAPDIR/ctl/ctlfile_uvhdc1I"
         echo "     - ctlfile_uvhdc1I specifies cpy=copybookmap & rcs=recsize"
         exit 1; fi
 # use uvcopy job to get copybookname from datafilename
 # - will write copybookname to: /tmp/${LOGNAME}.cpy
 uvcopy uvhdget2,filr1=${CTLMAPDIR}/ctl/ctlfile_uvhdc1I\
 ,filo1=/tmp/${LOGNAME}.cpy,arg1=$file3
 if (( $? != 0))
    then echo "datafilename not in control file"; exit 2;fi
 # open the file written by uvcopy & retrieve copyname & options into $variables
 exec 3< /tmp/${LOGNAME}.cpy             # open file written by uvcopy
 read -u3 copyname rcsz cfops keys other # read file contents into variables
 exec 3<&-                               # close file
 #echo "DEBUG: copyname=$copyname, rcsz=$rcsz, cfops=$cfops clops=$clops"
 #
 uvhdcob $file2 $CTLMAPDIR/maps/$copyname $rcsz$cfops$clops
 #=========================================================
 exit 0

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

5E2. 'uvhdc2' script make it easier to use 'uvhdcob'

script uvhdc2 - listing

 #!/bin/ksh
 # uvhdc2 - Korn shell script from UVSI stored in: /home/uvadm/sf/util/
 # uvhdc2 - script to run uvhdcob without specifying copybookname
 #        - see doc at www.uvsoftware.ca/uvhdcob.htm#Part_5
 #        - using uvhdcob directly requires copybookname
 #          (awkward when datafile & copybook in different filesystems)
 #
 # uvhdc1 - also see uvhdc1 for demo in /home/uvadm/...
 # uvhdc2 - this script for production (example for mvstest/testlibs,testdata)
 #        - see demo documented at www.uvsoftware.ca/uvhdcob.htm#Part_5
 #
 # profile exports: RUNLIBS=/home/mvstest/testlibs RUNDATA=/home/mvstest/testdata
 # - copybook/maps   $RUNLIBS/maps/... = /home/mvstest/testlibs/maps/...
 # - ctlfile_uvhdc2I $RUNLIBS/ctl/...  = /home/mvstest/testlibs/ctl/...
 # - datafiles       $RUNDATA/data1/... = /home/mvstest/testdata/data1/...
 #
 # export CTLMAPDIR=/home/mvstest/testlibs  <-- optional override $RUNLIBS
 # =======================================
 #
 # uvhdc2 data1/ar.customer.master <-- sample command for this script
 # ===============================
 # - above call to script 'uvhdc2' generates following 'uvhdcob' command:
 # - see control file entry below matching datafilename specified
 #
 # uvhdcob data1/ar.customer.master $RUNLIBS/maps/custmas1 r256
 # ============================================================
 # - looks for control-file & copybookmap in $RUNLIBS
 #   ($RUNLIBS/ctl/ctlfile_uvhdc2I/... & $RUNLIBS/maps/...)
 # - may override $RUNLIBS if you define CTLMAPDIR
 #
 #                    ** sample control file **
 #
 # ar.customer.master          cpy=custmas   rcs=00256  typ=RSF  ops=f
 # ar.sales.items              cpy=custmas   rcs=00256  typ=RSF  ops=f
 # gl.account.master_          cpy=custmas   rcs=00256  typ=RSF  ops=f
 # citytax1                    cpy=citytax1  rcs=128    typ=RSF  ops=f
 #
 # This script (uvhdc2) calls uvcopy job 'uvhdget2' to lookup the control file
 # to get the copybookname & options (record-size & file-type), for example:
 #
 # uvhdc2 data1/ar.customer.master  <-- script minimizes keystrokes required
 # ===============================
 #
 # uvcopy uvhdget2,filr1=$CTLMAPDIR/ctl/ctlfile_uvhdc2I\
 #                ,filo1=/tmp/$LOGNAME.cpy,arg1=ar.customer.master
 # ===============================================================
 #
 # uvhdcob data1/ar.customer.master $CTLMAPDIR/maps/custmast
 # =========================================================
 # - long 'uvhdcob' command generated from short 'uvhdc2' script
 #

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

 #                     ** Pre-Requisites for uvhdc2 **
 #
 # 0. cd $CTLMAPDIR or $CNVDATA or $RUNLIBS or $RUNLIBS
 # 1. uvcopyx cobmap1 cpys maps uop=q0i7p0  <-- create cobmaps
 #    ====================================
 # 2. uvcopy data2ctl50,fild1=$RUNDATA/data,filo2=ctl/ctldata50
 #    =========================================================
 #    - extract data1/filenames to create skeleton with cpy=___ to fill in
 # 3. sort ctl/ctldata50 -o ctl/ctlfile_uvhdc2 - sort filenames & rename
 #    ========================================   as expected by uvhdc2
 # 4. vi ctl/ctlfile_uvhdc2  <-- edit ctlfile to relate datafiles to copybooks
 #    =====================    - sample in #comments above or Part_5 datacnv1.htm
 # 5. uvcopy loadctlI,fili1=ctl/ctlfile_uvhdc2,filo1=ctl/ctlfile_uvhdc2I
 #    ==================================================================
 #Note - load control file to Indexed file for use by uvhdget2
 #       to relate datafiles to copybooks & get datafile type options
 #     - keyed by datafilename to lookup copybook/map, recsize,& filetype options
 #
 file1="$1"; clops="$2" # give names to arg1(datafilename) & arg2(options)
 file2="$1"             # will append .dat if Indexed
 file3=$(basename "$1") # basename (with subdir removed)
 if [[ -z "$clops" ]]; then clops=m24; fi
 #
 # if CTLMAPDIR undefined, default to $RUNLIBS or $RUNDATA or $CNVDATA
 if   [[ -d "$CTLMAPDIR" ]]; then :
 elif [[ -d "$RUNLIBS" ]]; then export CTLMAPDIR=$RUNLIBS;
 elif [[ -d "$RUNDATA" ]]; then export CTLMAPDIR=$RUNDATA;
 elif [[ -d "$CNVDATA" ]]; then export CTLMAPDIR=$CNVDATA;
 else echo "superdir not found for .../ctl/ctlfile_uvhdc1 & .../maps/..."
      echo "- use 1st superdir in: \$CTLMAPDIR,\$RUNLIBS,\$RUNDATA,\$CNVDATA"
 exit 99; fi
 #
 # filenames ending with '_' indicate generation files
 # - get latest generation using exportgen0 function
 export JSTEP=0000
 export GTMP=tmp
 export GDGCTLUPDT="NO"
 export UVCOPYROP=i63
 ##echo "DEBUGA: datafilename=$file1"
 if [[ "$file1" == *_ ]]; then
    exportgen0 +0 file4 $file1
    ##echo "DEBUGB: GDGfilename=$file4"
 else file4=$file1
 fi
 # verify user filename is a valid file
 # - check for Indexed file & set file2 = $file1.dat if indexed
 if [[ -f "$file1.dat" ]]; then file2=$file1.dat; fi
 if [[ -f "$file2" || "$file2" == *_
    || "$file2" == *_[0-9][0-9][0-9][0-9][0-9][0-9] ]]; then :
    else echo "usage: uvhdc2 datafile [options]"
         echo "       ========================="
         echo "example: uvhdc2 data1/ar.customer.master"
         echo "         ==============================="
         echo "- datafile=$file2 NOT FOUND"
         echo "- datafilename must have match in CTLMAPDIR/ctl/ctlfile_uvhdc2I"
         echo "- ctlfile specifies cpy=copybookmap rcs=recsize cfops=??"
         exit 1; fi
 #

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

 ##echo "DEBUG1: datafilename=$file1"
 # use uvcopy job to get copybookname from datafilename
 # - will write copybookname to: /tmp/${LOGNAME}.cpy
 uvcopy uvhdget2,filr1=${CTLMAPDIR}/ctl/ctlfile_uvhdc2I\
 ,filo1=/tmp/${LOGNAME}.cpy,arg1=$file3
 #======================================================
 if (( $? != 0))
    then echo "datafilename not in control file"; exit 2;fi
 #
 # open the file written by uvcopy & retrieve copyname & options into $variables
 exec 3< /tmp/${LOGNAME}.cpy              # open file written by uvcopy
 read -u3 copyname rcsz cfops keys other  # read file contents into variables
 exec 3<&-                                # close file
 #
 #Jan28/09/DEBUG - display $rcsz$clops (seems to be space btwn ?)
 ##echo "DEBUG2: datafilename=$file4"
 ##echo "DEBUG3: copyname=$copyname, rcsz=$rcsz, cfops=$cfops, clops=$clops"
 ##echo "DEBUG4: cobmap=$CTLMAPDIR/maps/$copyname"
 #
 uvhdcob $file4 $CTLMAPDIR/maps/$copyname $rcsz$cfops$clops
 #=========================================================
 exit 0
 #

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

5F1. 'uvhdc1/2' scripts make it easier to use 'uvhdcob'

uvcopy job 'uvhdget2' called by 'uvhdc1/2'

 # uvhdget2 - uvcopy Parameter File from UVSI stored in: /home/uvadm/pf/util/
 # uvhdget2 - get the copybookname using indexed control file
 #            of datafilenames & copybooknames
 #          - command format & examples follow below:
 #
 # uvcopy uvhdget2,filr1=Indexed-control-file,filo1=copyname,arg1=datafile
 # =======================================================================
 #
 # uvcopy uvhdget2,filr1=$CTLMAPDIR/ctl/ctlfile_uvhdc2
 #                ,filo1=/tmp/$LOGNAME.cpy,arg1=ar/customer.master
 # ===============================================================
 #
 # $CTLMAPDIR/ctl/ctlfile_uvhdc2 <-- datafilenames, cpy=copybookmap, rcs=recsize
 # $CTLMAPDIR/maps/copybookmaps  <-- record layouts created by uvcopy cobmap1
 # if $CTLMAPDIR undefined, defaults to $CNVDATA, or $RUNLIBS, or $RUNDATA
 #
 # This uvcopy job is called by script 'uvhdc2' which allows you to run 'uvhdcob'
 # without specifying the copybookname, or options for record-size
 # - uses indexed control file to determine copyname from datafilename
 #
 # uvhdcob subdir/datafile copybook options <-- uvhdcob direct command
 # ========================================   - must specify file,copybook,optns
 #
 # uvhdc2 subdir/datafile [r257m50a] <-- usually need no options
 # =================================   - option 'r' recsize supplied by copybook
 #                                     - may override & specify other options
 #
 # uvhdc2 ar/customer.master
 # =========================
 #
 # - above script 'uvhdc2' generates following 'uvhdcob' command:
 #   (using control file entry below matching datafilename spcfd)
 #
 # uvhdcob ar/customer.master $CTLMAPDIR/maps/custmas fr256
 # ========================================================
 #
 #                    ** sample control file **
 #
 # ar/customer.master            cpy=custmas   rcs=00256  typ=RSF   ops=f
 # ar/sales.items                cpy=custmas   rcs=00256  typ=RSF   ops=f
 # gl/account.master_            cpy=custmas   rcs=00256  typ=RSF   ops=f
 #
 filr1=${CTLMAPDIR}/ctl/ctlfile_uvhdc2I,typ=ISF,rcs=150
 filo1=/tmp/${LOGNAME}.cpy,typ=LSTt,rcs=150
 #

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

 @run
        opn    all                  open files
        mvc    a0(60),$arg1         store datafilename as key
        repp   a0(60),'_###### ','_ '  remove any GDG gen# (Jan11/13)
        redm5  filr1,a0(150)        random read by key to get copymapname
        skp!   err1
        clr    b0(300),' '          init arguments build area
 #
 # store copybookname as field1 of record to be written
 man20  scn    a0(128),'cpy='       scan for copybook ID
        skp!   err2
        mvum   b0(40),ax4,'. '      store cpybknm til .ext or blank
 #
 # store rec-size as field2 (1st option, will append any ops=...)
 # - but clear if recsize zero (for RDW files)
 #Feb06/10 - allow alt rcs= ID at Everis
        scn    a0(128),'rcs='       scan for recsize ID
        skp=   man26
        scn    a0(128),'rcm='       scan for alternate recsize ID
        skp!   err3
 man26  mvc    b41(1),'r'           prefix 'r' reqd for uvhdcob
        mvn    b42(5),ax4(5)        store recsize & test zero ?
 #
 # add 1 to recsize if typ=ISF or typ=IDXf1
 man30  scn    a0(128),'typ=ISF'
        skp=   man38
        scn    a0(128),'typ=IDXf1'
        skp=   man38
        skp    man50
 man38  add    b42(5),1             add 1 to recsize in ctlfile
 #
 #Jun12/10 - scan for ops=...
 man50  scn    a0(128),'ops='       control file options ?
        skp!   1
        mvc    b50(8),ax4           store as field3 (will squeeze fld2 & fld3)
 #
 # squeeze arguments to 1 blank between
 # - 1st squeeze options to no blanks (all options arg2)
 man80  sqz    b40(60),' '          squeeze all options into arg2
        sqzc1  b0(100),' '          squeeze to 1 blank btwn words
        put    filo1,b0(128)        write to output file
        eoj
 #
 #--------------------------------------------------------------------
 err1  msgv1  'datafilename NOT FOUND in ctlfile: $filr1'
       mvfv3  c0(80),'datafile = '
       catb1  c0(80),$arg1
       can    c0(80)
 err2  msgv1  'copybookmapname NOT FOUND in ctlfile: $filr1'
       mvfv3  c0(80),'for datafile: '
       catb1  c0(80),$arg1
       can    c0(80)
 err3  msgv1  'record-size not found in ctlfile: $filr1'
       mvfv3  c0(80),'for datafile = '
       catb1  c0(80),$arg1
       can    c0(80)

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

Part_6 uvhdcob - display data files with COBOL field names

Part 6 - Contents


6A1. Customizing uvhd for each user via UVHDCOBROP

6A2. Environmental Variables for printing
- using the 'i' command (Immediate print)
  vs the 'p' command (print to a file)

6B1. uvhdcobdif2 - script to compare files
- using uvhdcob to show copybook fieldnames & datafield contents
- sample output report

6B2. Listing of uvhdcobdif2 script

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

6A1. setting Options via Environmental Variables

Customizing uvhd for each user via UVHDCOBROP

You may export variable UVHDCOBROP in the profile to specify the preferred options for each user. For example, users who prefer 50 lines per screen & space between headings could add the following to their profile:

50 lines per screen is possible for the Windows command screens using terminal emulators such as 'putty'.


 export UVHDCOBROP=m50s2   <-- user options for 50 lines/screen
 =======================       & space after hdgs
Note
  • the 'ROP' stands for Run OPtions
  • most Vancouver Utilities have similar Run OPtions
  • utility program name + ROP
  • UVCOPYROP, UVSORTROP, UVHDROP, UVHDCOBROP, etc

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

6A2. Environmental Variables for uvhdcob

Customizing printing with Environmental Variables

The 'print' command 'p' does not print immediately, but writes the screen displays to a tmp/file, which can subsequently be printed manually after you quit the uvhdcob utility.

The immediate print option 'i' uses the command stored in the variable 'iprtcmd' in the uvhdcob 'C' program. You could modify this command in the C program, & recompile the program.

     char iprtcmd[30] = "uvlp12";     (original command)

'uvlp12' is a script, 1 of several supplied scripts using the 'uvlist' utility, which supplies page headings & page numbering. See uvlist.doc for instructions to modify the destination printer used by these scripts.

You could modify the script called by the 'pi' command. For example to print at 14 chars per inch (vs default 10 cpi):

char iprtcmd[30] = "uvlp14"; (modified command)

environmental variables for 'pi' printing

A more convenient method of modifying Immediate printing is to use the environmental variables 'UVLPDEST' & 'UVHDCOBPRINT'. You could export them at your shell prompt before running uvhd or even better setup your normal choices in your .profile. Here are some examples:

 export UVLPDEST=-dlaser2     <-- setup printer dest for all 'uvlp' scripts

export UVHDCOBPRINT=uvlp12 <-- the default script uvlp12 for 80 chars Portrait

export UVHDCOBPRINT=uvlp14 <-- uvlp14 would leave more space on right

env-vars for printing on Windows

The default scripts for printing on Windows are uvlpr12 & uvlpr12L. These are defined within the uvhd.c program & are used if no environmental variables are defined. These are equivalent to the following:

set UVHDCOBPRINT=uvlpr12 <-- specify DOS script for 64 chars Portrait

For Windows you could define on the following screen:

ControlPanel --> System --> Advanced --> Environmental Variables

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

6B1. uvhdcob/diff script to compare 2 datafiles

The 'uvhdcob' utility & 'uvhdcobdif2' script can be used to compare 2 datafiles & show the differences with the corresponding COBOL copybook names.

uvhdcobdif2 - script to compare files

We will demo uvhdcobdif2, using the /home/uvadm/mf/maps directory of cobmaps, already generated from the copybooks (/home/uvadm/mf/cpys), as previously described on page '1B1'.


 #1a. cd $HOME                    <-- change to your homedir (or uvadm)
 #1b. mkdir testdif               <-- make subdir for test
 #1c. cd testdif                  <-- change into subdir
 #1d. mkdir dat2 tmp tmp1 tmp2    <--  make sub-subdirs

 #2a. cp /home/uvadm/dat1/warmas1 dat2  <-- copy testfile to dat2
 #2b. vi dat2/warmas1                   <-- make some changes

 #3. uvhdcobdif2 /home/uvadm/dat1/warmas1 dat2/warmas2 /home/uvadm/mf/maps/warmas1
    ==============================================================================
    - may sppecify pathnames to files

--> OR may export directories & specify only the filenames within those directories


 #4a. export D1=/home/uvadm/dat1        <-- define subdir for 1st file
 #4b. export D2=dat2                    <-- define subdir for 2nd file
 #4c. export CM=/home/uvadm/mf/maps     <-- define cobmaps subdir

 #5.  uvhdcobdif2 warmas1 warmas1 warmas1  <-- run script to create diff report
      ===================================

 #6.  vi tmp/warmas1.dif          <-- investigate difference report
                   ** sample output report **
 1c1
 < dat1/warmas1 fsz=576 rsz=64 totrecs=9 current=1
 ---
 > dat2/warmas1 fsz=576 rsz=64 totrecs=9 current=1
 34c34
 < wm-descrip                      12  29    dish washer
 ---
 > wm-descrip                      12  29    dish CRASHER
 76c76
 < wm-descrip                      12  29    clothes dryer
 ---
 > wm-descrip                      12  29    clothes SHRINKER

Note that this method of comparing data-files is not as exact as the uvcmp1/2/3 jobs documented in CMPjobs.doc because:

  1. uvhdcob displays only the 1st 30 bytes of longer data-fields
  2. uvhdcob displays the 1st field of occurs (unless option o99g99)

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

6B2. uvhdcob/diff script to compare 2 datafiles

uvhdcobdif2 - script listing

 #!/bin/ksh
 # uvhdcobdif2 - Korn shell script from UVSI stored in: /home/uvadm/sf/util/
 # uvhdcobdif2 - run uvhdcob & diff for 1 pair of data files
 #
 # uvhdcobdif2 file1 file2 cobmap    <-- may specify 3 filenames
 # ==============================
 #
 # OR may export D1, D2, CM & specify filenames within dirs
 # export D1=dir1; D2=dir2; CM=dir3;
 #
 # uvhdcobdif2 dir1/file1 dir2/file2 dir3/cobmap  <-- efectively
 # =============================================
 #
 # tmp   - directory for interim work files & diff report
 #       - filename will be: datafile1.dif
 # tmp,tmp1,tmp2 - will be created if absent or all files removed if present
 #     tmp1,tmp2 - used to store Print files (different dirs for time stamps)
 #
 if [[ -f "$1" ]]; then f1=$1; else f1=$D1/$1; fi
 if [[ -f "$2" ]]; then f2=$2; else f2=$D2/$2; fi
 if [[ -f "$3" ]]; then cm=$3; else cm=$CM/$3; fi
 echo "debug: f1=$f1 f2=$f2 cm=$cm"
 if [[ -f $f1 && -f $f2 && -f $cm ]]; then :
    else echo "#1.  uvhdcobdif2 file1 file2 cobmap   <-- may specify files directly"
         echo "     =============================="
         echo "#2a. export D1=dir1 D2=dir2 CM=dir3 <-- OR may export dirs"
         echo "     =============================="
         echo "#2b. uvhdcobdif2 file1 file2 cobmap   <-- aand specify files in subdirs"
         echo "     =============================="
         echo "#3.  vi tmp/datafilename.dif        <-- diff report in tmp/ subdir"
         echo "     ======================="
 exit 9; fi
 f=$(basename $f1)
 test -d tmp || mkdir tmp; rm -f tmp/*
 test -d tmp1 || mkdir tmp1; rm -f tmp1/*
 test -d tmp2 || mkdir tmp2; rm -f tmp2/*
 #
 uvhdcob $f1 $cm d2j=p99999999 >/dev/null
 #=======================================
 # option d2 inserts record#
 # option j=p99999999 issues Print command & quits
 mv -f tmp/* tmp1/$f
 sleep 1
 uvhdcob $f2 $cm d2j=p99999999 >/dev/null
 #=======================================
 mv -f tmp/* tmp2/$f
 diff -b tmp1/$f tmp2/$f >tmp/$f.dif
 #==================================
 status=$?
 if (($status == 0))
 then echo "No Difference: $f1 & $f2"
 else echo "diff report in: tmp/$f.dif, investigate with vi,cat,more,etc"
 fi
 exit 0

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

Visitor Counters for ThisYear and LastYear