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
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
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 |
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).
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
What is the difference between 'uvhd' & 'uvhdcob' ?
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 -->
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 |
|
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
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
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 -->
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
We will demo 'group occurs' options using the following files:
dat1/custran1 |
|
mf/cpys/custran1 |
|
#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
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 |
|
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 -->
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
We will demo 'group AND ITEM occurs' options using the following files:
dat1/custran2 |
|
mf/cpys/custran2 |
|
#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
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 |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 -->
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
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 |
|
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 |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
We will demo occurs 'DEPENDING ON' using the following files:
dat1/custran3 |
|
mf/cpys/custran3 |
|
#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)
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
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 ============================================================
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
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 ============================================================
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
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' |
|
option 'a' |
|
option 'm50' |
|
Note |
|
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
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:
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
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
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
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)
u |
|
u2 |
|
v |
|
x1 |
|
x2 |
|
x4 |
|
x7 |
|
y_ |
|
y1 |
|
y2 |
|
y4 |
|
y1 |
|
y2 |
|
z# |
|
z2 |
|
z4 |
|
z8 |
|
z1 |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
null |
|
b# |
|
r# |
|
f# |
|
f# |
|
f# |
|
r1 |
|
f99m123 |
|
f99m50n90 |
|
ff |
|
ff |
|
uvhdcob dat1/custmas1 mf/maps/custmas1 <-- run uvhdcob on customer master ====================================== data-file & copybook-map
s 'ABC' |
|
s 40(40),'ABC' |
|
s 20(3),!'000' |
|
s 0(80),=x'0C' |
|
s 0(80),>x'7F' |
|
s 'ABC',,'XYZ' |
|
s 'ABC',|,'XYZ' |
|
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 |
|
sss |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 |
|
X |
|
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)
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' |
|
u 4(99),x'00' |
|
uu |
|
X |
|
u99 0(99),'_' |
|
X |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
|
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
>>> 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 |
|
w100e5 |
|
we10 77(2),'VA' |
|
w100r64t2 |
|
w99z2a1c1 |
|
a1 |
|
d# |
|
c1 |
|
n1 |
|
n2 |
|
r# |
|
t1 |
|
t2 |
|
t3 |
|
t4 |
|
z# |
|
z2 |
|
z4 |
|
z1 |
|
w50d10r25t6 |
|
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
>>> 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)
v99 |
|
vv |
|
v100 |
|
...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
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 |
|
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
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
'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
>>>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 |
|
eu |
|
q |
|
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
o1 |
|
o99 |
|
o3 |
|
g1 |
|
g99 |
|
g3 |
|
i1 |
|
i2 |
|
i4 |
|
i4 |
|
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
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
*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
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
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 |
|
uvcp typ=RSF |
|
uvcp typ=RDW |
|
uvcp typ=IDXf1 |
|
uvxp typ=IDXf3v |
|
uvxp typ=IDXf8v |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
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 |
|
dat1/vendorpay |
|
dat1/vendorpaymas |
|
dat1/vendorpaymasa |
|
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
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
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
*type=7(1),='M','vendormas' *type=7(1),='P','vendorpay' *type=7(1),!'x','badrecordtype'
*type=00:45,'vendormas' *type=46:99,'vendorpay'
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Note |
|
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
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 |
|
dat1/vendormas1 |
|
dat1/vendormas2 |
|
dat1/vendormas3 |
|
dat1/vendormas4 |
|
dat1/vendormas5 |
|
dat1/vendormas6 |
|
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
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.
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
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
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 ===========================
#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)
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
typ=RSF |
|
typ=RSF |
|
typ=RDW |
|
typ=IDXf1 |
|
typ=IDXf3v |
|
typ=IDXf8v |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#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 -->
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#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 -->
#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 |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#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
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 -->
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
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
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 -->
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)" =*=========================================================*****==================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 -->
uvhdcob dat1/vendormas5.idx <-- investigate Index partition (binary file) =========================== - omit options to display 256 byte chunks
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 -->
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
*type=7(1),='M','vendormas' *type=7(1),='P','vendorpay' *type=7(1),!'x','badrecordtype'
01 badrecordtype. 10 badrec1 pic x(30). 10 badrec2 pic x(30). 10 badrec3 pic x(30).
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
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
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)
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
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
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
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
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.
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)
#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
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
--> v99p99x7 <-- create a verify report for the entire file ======= for separate investigation & printing.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 |
|
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 |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
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
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 |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 |
|
#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
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).
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
uvhd dat1/bigRDWfile z4 <-- start uvhdc (or uvhdcob) ======================= - displays record#1
--> f123456789 <-- find any desired record# (quickly using index)
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)
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
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
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 |
|
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 |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
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
Scripts 'uvhdc1' & 'uvhdc2' make it easier to use 'uvhdcob' because:
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
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/...
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
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
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 |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 ======================
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 |
|
#5a. uvhdcob dat1/vendormas0 $CTLMAPDIR/maps/vendormas fr64a =======================================================
#5a. uvhdcob dat1/vendormas0 /home/uvadm/mf/maps/vendormas fr64a =========================================================== - same with $CTLMAPDIR expanded
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
'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
#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
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 |
|
#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
#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 |
|
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
'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
# 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
# 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
#!/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
#!/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
# 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
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
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 |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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)
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
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
The 'uvhdcob' utility & 'uvhdcobdif2' script can be used to compare 2 datafiles & show the differences with the corresponding COBOL copybook names.
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:
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#!/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