uvcopy2.doc - Index
A0. |
WORK AREA SUMMARY - 26 work areas available (a-z) |
A1. |
work area 'x' - registers & accumulators |
A2. |
work area 'y' - system information (date,time,jobname,etc) |
A3. |
work area 'z' - file control table |
A4. |
work area 'w' - bal subrtn parameter passing areas |
|
- optional data from bal op2,op3,op4 stored in w0(200),w200(200),w400(200) |
B0. |
$SYMBOLS |
B1. |
$symbol addresses - INDEX REGISTERS |
B2. |
$symbol addresses - COUNTERS (user & instruction counters) |
B3. |
$symbol addresses - OPTIONS (instrn,run,& user options) |
B4. |
$symbol addresses - OPTIONS (process options) |
B5. |
$symbol addresses - OPTIONS (alternative instruction options) |
B6. |
$symbol addresses - TRANSLATE TABLES |
B7. |
$symbol addresses - $date,$time,$jobname,$reply, |
B8. |
$symbol addresses - filenames ($fili1-8,$filo1=$fil40,$filr1-8,$fild1-8) |
B9. |
$symbol CONSTANTS (vs $symbol addresses above) |
B10. |
$symbol USER ASSIGNED addresses |
B11. |
${symbol} access to environmental variables |
C0. |
OPTIONS (6 kinds) & option coding rules |
C1. |
uvcopy RUN options - set via: rop=a1b2...z9999,etc |
C2. |
USER options - set via: uop=a1b1,etc, test via: $uopca-$uopcz,etc |
|
export UVCOPYROP=... set options until logoff or export UVCOPYROP="" |
C3. |
file TYP codes (typ=RSF,RST,LST,ISF,RDW,etc) |
C10. |
file typ=LST... options for text files |
C11. |
file typ=LST... options for text files |
C12. |
file typ=XXX... options for multiple file types |
C13. |
file typ=RDW... options unique to typ=RDW files |
C14. |
file typ=RSV... options unique to typ=RSV/RSR <-- This page |
C15. |
file typ=ISF... options for Indexed files |
C16. |
file typ=IDX... options for variable Indexed files |
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
uvcopy2.doc - Index (continued)
D0. |
INSTRUCTION options |
D1. |
- applicable to all instructions (ex: mvuz3) |
D2. |
- applicable to repeatable instructions (ex: addx9j9k9) |
D3. |
- applicable to individual instructions (ex: msgw, putl2, etc) |
E1. |
ALTERNATIVE INSTRUCTION option areas - $iopo0- $iopo9 |
F1. |
user PROCESS options - set via: pop=a1b2...z9999,etc |
G1. |
Special Pattern Match Characters |
H0. |
INDEX REGISTERS ($ra - $rz) |
H1. |
Index registers - summary by instruction |
H2. |
Index registers - explanation & examples |
H3. |
Index Registers - loading tables |
H4. |
Index Registers - looking up tables |
H5. |
Index Registers - scanning & replacing |
H6. |
Index Registers - move until pattern found & insert |
H7. |
LENGTH INDEXING |
I1. |
USER & INSTRUCTION COUNTERS ($ca0-$ch24 & $ci0-$ci24) |
J0. |
uvcopy DEBUGGER - Contents |
J1. |
Debugging uvcopy jobs - Run OPtion rop=d |
J2. |
Debug demo session#1 |
|
uvcopy fixUSstates.csv,rop=d - USstares.csv to fixed-field |
J3. |
Debug Command Summary (group1) - Display Data-Areas, Counters, Registers |
J4. |
Debug Command Summary (group2) - Breakpoints & Gotos |
J5. |
Debug demo session#2 - uvcopy extendsales1,rop=d |
J6. |
I/O files session#2 - debug extendsales1 uvcopy job |
J7. |
debug session#2 - null entry steps thru instrucitons |
J8. |
debug session#2 - d/p Display/Print Areas, a/c Accums/Counters, r Registers |
J9. |
debug session#2 - c display counter#1 ($ca1) at EOF for total, G to end job |
J10. |
Debug session#3 - Breakpoints & Gotos, goto to label at end 1st record |
J11. |
Debug session#3 - Brkpts & Gotos, goto to label at EOF, display total |
J11. |
Debug session#4 - may use only gotos to both define & goto brkpts |
J12. |
Debug session#4 - investigate ERROR caused by invalid product# (extendsales1) |
J11. |
Debug Command 'x' to Display Hexadecimal data |
K1. |
uvcopystat1 - analyze uvcopy code, report usage: areas,registers,counters |
K2. |
chkdig10 - sample job input to uvcopystat1 for sample report |
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
uvcopy documentation - uvcopy1,2,3,4,5.doc + uvtrain.doc
uvcopy1.doc - FUNCTIONS
Functions are declarations (not executed as are instructions). Functions are
processed once only at setup time. '@run' separates Functions from Instructions.
initial: prm,opr,rop,uop,was
arguments: arg1,arg2,...,arg9
file declaration: fil__,typ,rcs,isk
special functions: lod
begin instructions: @run
uvcopy - Work areas, $symbols, options, etc
This section documents items that apply to all instructions (work areas,
options, registers, etc). If you want to know everything about any 1
instruction, please refer to the next section. If you want to know all
instructions that use option 'a' or affect register 'x' this is the place.
Work Areas - 26 work areas (a-z)
$symbols - for registers, counters, system values (date,time,filenames,etc)
Options - user options, run options, file type options
Index Registers - explanations & examples
Debugging - step thru program, display work areas, breakpoints, etc
uvcopy3.doc - INSTRUCTIONS
Instructions follow the '@run' function & are stored in memory at 'setup time'.
Instructions are executed at 'run time' (after validation at setup time).
Instructions are usually executed repeatedly (eg: for each record in a file)
- logical: mvc,mvf,mvr,mvp,cat,clr,edt,anc,orc,xor,shf
- arithmetic: mvn,add,sub,mpy,div,pac,unp,xft
- comp/test/skip: cmc,cmn,skp,nop,tst,tsb,mwb
- sequential I/O: opn,cls,get,put,rel,rtb,wtb
- Indexed I/O: set,red,wrt,upd,del,lck,ulk
- message&control: msg,can,eoj,tim,wat,bal,ret,bcr
- translation: tra,tre,trl,tru,trt,hxc,chx,vhx
- scan&replace: scn,rep,mvu,sct,sst,tts,rpt,sts,rts
- squeeze-insert: sqz,sqf,jus,cnt,ins,ctr
- conversion: fix,var,dlm,und,swp,dat,rfm
- special: sys,lok,pop,fxt,env,evt,vnf,xxa,xxb,xxc
- sort: sxo,sxp,sxs,sxg,sxc,srt
- table: tbl,tbf,tbh,tbp,tbd
uvcopy4.doc - uvcopy sample jobs
translations, edited reports, sorts, table lookups, convert tabs to blanks
uvcopy5.doc - uvcopy advanced examples
convert fixed length fields to delimited (comma,pipe,etc), split files,
ISAM file random access to update sequential files.
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
A0. uvcopy 'work areas' summary/overview
Uvcopy provides the user with 26 work areas which may be addressed
via a lower case alpha prefix, a displacement,& a length.
For example 'a20(8)' addresses bytes 21-28 within area 'a'
(displacements are always zero relative).
Most area sizes default to 8192 bytes.
a-n |
- work areas a-n are completely available to the user
- may be used for record I/O areas or whatever
- the default size is 8192 bytes & may be increased via the 'was'
function, was=a64000b128000 would assign 64000 bytes to a & 128000 to b |
o |
- before 1st instruction executed, any user options ($uopba to $uopbz)
are stored in o1 to o26 as binary 1 byte counters, to make it easier
for the user to bit test (independent of BIG-end Little-end arch).
- Use $uopba-$uopbz (4 byte binary fields) for testing values
- Use o1-o26 (1 byte binary fields) for bit testing, because this works
on both RISC & INTEL, but $uopba-$uopbz bit tests wont work on RISC.
(HP-UX, IBM AIX,& SUN SPARC are RISC machines). |
tsb o1(1),x'04' <-- bit test (option 'a' x'04') OK RISC+INTEL
tsb $uopba(1),x'04' <-- bit test (using $uopb_) wont work on RISC
o |
- Here is a chart to make it easy for you to relate the option letters
to the area 'o' addresses: |
a b c d e f g h i j k l m n o p q r s t u v w x y z
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
p |
- completely available to the user (same as a-n)
|
q |
- operand $symbol equate table area
- user may 'lod' $symbols into this area & then any $symbol operands
on following instructions will be replaced with these equated
addresses of area.dsp(lth) - more explanation further below
- default size is 8192 bytes & you will need to increase (via 'was')
if you use $symbols (each $symbol requires 24 bytes) |
r,s |
- r & s are completely available to the user (same as a-p)
|
t |
- area 't' is available to the user, except when using the 'vnf' instruction
- see complete details at uvcopy3.htm#vnf, but briefly:
- option 't1' on vnft3 on 1st vnf in job inits area t to all tildes (8000)
- option 't2' on vnft2 acumulates errors in area 't' for dump at EOJ
- if vnft2 detects Numeric Field error, it builds 80 byte entry in area t
- dump area t table after last vnf for current record via 'wtb' instruction
|
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
A0a. 'work areas' summary/overview
system reserved work areas (u-z)
u-z |
- system reserved areas, user must be careful with modifications
- modifications usually restricted to registers & counters,
|
u & v - internal instruction work areas (default 8192 bytes)
- u & v are used as copy over & back areas for some instructions
such as the 'scn' (scan), 'sqz' (squeeze), & 'rep' (replace)
- you will need to increase (using the 'was' function) if you intend
to scan, squeeze, replace,etc operand areas larger than 8192 bytes
w |
- work area 'w' used to store data for some instructions
- stores data from op2,3,4 of 'bal', to be accessed by the subrtn
- op2 w0(200), op3 w200(200), op4 w400(200) (areas blank right filled)
- output (9 lines max) stored in w1000(100),w2000(100),...,w9000(100)
- 9 words max from first line in w1100(100),w1200(100),...,w1900(100)
- 9 words max from 2nd line in w2100(100),w2200(100),...,w2900(100)
- - - - - etc - - - - -
- 9 words max from 9th line in w9100(100),w9200(100),...,w9900(100)
|
x |
- system registers, system counters,& user accumulators
- these should be addressed via the reserved words $ra, $ca1, etc
- see detailed layout & explanation below
|
y |
- system information area
- may address via reserved words ($date, $time, etc)
- see detailed layout & explanation below
|
z |
- system file control table
- may address via reserved words ($fili1, $fili2, etc)
- see detailed layout & explanation below
|
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
A1. uvcopy work area 'x' - system registers & accumulators
absolute | symbolic | item
address | address | description
x0(4b) $ra index register 'a'
x4(4b) $rb index register 'b'
x8(4b) $rc index register 'c'
... ... ...
x92(4b) $rx index register 'x'
x96(4b) $ry index register 'y'
x100(4b) $rz index register 'z'
Note |
- see register details on pages 'H0' - H7
|
x104(8b) $rem remainder of last divide
x112(8b) $cc post-instruction condition code
set by various instructions (cmc,cmn,get,etc)
tested by skp< skp= skp>
x120(4b) $pid UNIX process-id
x124(4b) $ppid UNIX parent process-id
x128(4b) $icnt uvcopy instruction count
x144(4b) size of area 'x'
x148(4b) size of area 'y'
x152(4b) size of area 'z' (File Control Table)
x156(4b) size of each entry of File Control Table
x160(4b) size of FXT uvcopy structure (stores 1 instrn)
x164(4b) size of UNIX stat structure
x168(4b) interrupt signal switch (set & reset)
x172(4b) interrupt signal count
- user could test to see if interrupted & continued
Note |
- follwing 3 fields for uvqrpg (vs uvcopy)
|
x176(4b) $linectr line counter
x180(4b) $pagectr page counter
x184(8) $pagenum page counter edited page####
x193(1) stat1 after set,red,wrt,upd,del instructions
x194(1) stat2 after set,red,wrt,upd,del instructions
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
A1a. work area 'x' - continued
As of Feb 2000 counters may be 4 bytes or 8 bytes, depending on compile
argument H32 or S64/H64. See compile options in install.htm#C1.
As of Dec 2007, all counters are 64 bits (8 bytes). Prior to that, counters
could be 32 or 64 bits depending on compile argument H32/S64/H64. Compile
arguments are now H32/H64 (size of a long depending on machine), but counters
are now always 64 bits (using 'long long' if 'long' is not 64 bits).
Normally you don't need to care since you will use the $symbols.
x200(8b) $ca0 user counter set 'a' counter# 0
x208(8b) $ca1 user counter set 'a' counter# 1
... ... ...
x392(8b) $ca24 user counter set 'a' counter# 24
x400(8b) $cb0 user counter set 'b' counter# 0
x592(8b) $cb24 user counter set 'b' counter# 24
x600(8b) $cc0 user counter set 'c' counter# 0
x792(8b) $cc24 user counter set 'c' counter# 24
x800(8b) $cd0 user counter set 'd' counter# 0
x992(8b) $cd24 user counter set 'd' counter# 24
x1000(8b) $ce0 user counter set 'e' counter# 0
x1192(8b) $ce24 user counter set 'e' counter# 24
x1200(8b) $cf0 user counter set 'f' counter# 0
x1392(8b) $cf24 user counter set 'f' counter# 24
x1400(8b) $cg0 user counter set 'g' counter# 0
x1592(8b) $cg24 user counter set 'g' counter# 24
x1600(8b) $ch0 user counter set 'h' counter# 0
x1792(8b) $ch24 user counter set 'h' counter# 24
$ch1 - length of arg1 entered on command line
$ch2 - length of arg2 entered on command line
---- - - - etc - - -
$ch9 - length of arg9 entered on command line
x1800(8b) $ci0 instruction counter i0
x1808(8b) $ci1 instruction counter i1
... ... ...
x1992(8b) $ci24 instruction counter i24
Note |
- counters are initially 0 (except for $h noted above)
- see $ci1-$ci24 instruction counter details in sub-section I1
|
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
A1c. work area 'x' - continued
Note |
- most of this extended information in area 'x' is not normally
of interest to the most uvcopy users. |
address | $symbol | item description
x2100(40) 'bal' instruction return address stack
(allows bal nesting up to 10 deep)
x2140(4b) index into 'bal' return address stack
x2148(4b) debug option step counter (stop when 0 reached)
x2148(12) last debug command entered
x2160(4) debug instruction search id
x2164(8) debug tag/label search id
x2200(104) $iopba-z instruction options integer values
a thru z 26 x 4 bytes each = 104 bytes
x2304(26) $iopca-z instruction options character values a-z
(x'00' if unspecified)
x2400(104) $ropba-z run options (coded on rop=??) integer values
a thru z 26 x 4 bytes each = 104 bytes
x2504(26) $ropca-z run options character values a-z
(x'00' if unspecified)
x2536(64) $lovalues low-values x'00's
x2600(104) $uopba-z user options (coded on uop=??) integer values
a thru z 26 x 4 bytes each = 104 bytes
x2704(26) $uopca-z user options character values a-z
(x'00' if unspecified)
x2736(64) $hivalues high-values x'FF's
x2800(104) $popba-z user process options (result of 'pop' instrn) integers
a thru z 26 x 4 bytes each = 104 bytes
x2904(26) $popca-z user process options character values a-z
(x'00' if unspecified)
x2944(4b) $iserr ISAM error number (set by get,red,upd,wrt,etc)
ex: red sets to 111 if record not found
x2948(4b) ISAM status code 1 (D-ISAM)
x2952(4b) ISAM status code 2
x2956(4b) ISAM most recent I/O function #
x2960(4b) ISAM current record number
x3000(20) $iopo0 alternate instruction option storage o0
x3020(20) $iopo1 alternate instruction option storage o1
... ...
x3180(20) $iopo9 alternate instruction option storage o9
(see instruction option 'o')
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
A1d. work area 'x' - continued
x3200(256) $trt translate table for trt instruction, originally
neutral (user may modify or copy & modify)
x3456(256) $trtsea translate table for trt instruction, to correct signs of
zoned numeric fields translated from EBCDIC to ASCII
x3712(256) $trtsae translate table for trt instruction, to correct signs
of numeric fields translated from ASCII to EBCDIC
x3968(256) $trtchr translate table for trt instruction, to convert data
to printable characters only.
x'00'-x'1F' & x'7F'-x'FF' translated to blanks.
x4224(256) $trtper translate table to convert unprintable chars to periods
(similar to $trtchr above)
x4480(256) $trta2e ASCII to EBCDIC translate table for trt instrn
default table does not change values > x'80'
run option rop=t2 loads alternate table which
translates values > x'80' to EBCDIC blanks x'40's
x4736(256) $trte2a EBCDIC to ASCII translate table for trt instrn
x5000(45) utsname structure for uname UNIX system call
x5000(9) $usysname - UNIX system software (ex: RedHAT,etc)
x5009(9) $unodename - UNIX network node name (ex: uvsoft)
x5018(9) $urelease - UNIX system release (ex: 3.2)
x5027(9) $uversion - UNIX system release version (ex: 2)
x5036(9) $umachine - UNIX machine (ex: i386)
Note |
- following documented for UNIX gurus, most users can bypass this topic.
|
x5100(100) |
- system independent directory entry structure (dirent)
- see the 'dirent' structure documented on the next page
- stored by the most recent directory 'get'
- not normally required, since the get delivers the filename
into the op2 area specified on the get instruction |
x5200(128) |
- file status structure from most recent 'opn' file
- see the 'stat' structure documented on the next page
- if you want to access, you would opn files individually
rather than the usual 'opn all'
- not normally required, the file size & last modification
time are also stored in the file table in area 'z'
& the file size is also left in register 'z' |
x5328(128) |
- file status structure from most recent 'opn' directory
- same as above, but for file 'typ=DIR' (directory vs file)
|
x5456(128) |
- file status structure for the dirent entry in x5100(100)
- used by uvcopy to determine whether the dirent entry
is an ordinary file or a sub-directory (cc set <) |
See 'stat' & 'dirent' structures documented on next page --->
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
A1e. directory entry structure ($dirent = x5100(100)
directory entry structure ($dirent = x5100(100)
00-01 - inode#
02-03 - unused
04-07 - offset to disc directory entry
08-09 - length of this dirent structure
10-99 - filename, null-terminated, max 90
'stat' structure - stored by file opens ($fstat = x5200(max128)
00-01 - device#
00-00 - device# major
01-01 - device# minor
02-03 - inode#
04-05 - file mode
x'8000' - ordinary file
x'4000' - directory
x'2000' - character special
x'1000' - FIFO
x'6000' - block special
x'0800' - set user id
x'0400' - set group id
x'0200' - save swapped bit
x'01FF' - permission bits (rwxrwxrwx)
06-07 - link count
08-09 - owner user-id
10-11 - group id
12-15 - device# for special file
16-19 - file size
20-23 - last access time (seconds since 1970)
24-27 - last modification time
28-31 - last status change time
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
A2. uvcopy work area 'y' - system information
address | $symbol | item description
------- BEGINING dates/times when program execution began -------
y0(18) $datetime18 Begin date/time Not Edited
ccyymmddHHMMSS0mmm (18)
y0(14) $datetime14 Begin date/time Not Edited (14)
ccyymmddHHMMSS (14)
y0(8) $date8 system date when execution began
y8(6) $time6 system time HHMMSS
y14(4) $msecs4 milliseconds 4 digits (0mmm)
within current second
y0(8) $date1 same as $date8
y8(6) $time1 same as $time6
y20(23) $datetimems Begin date/time Edited y20(23)
'ccyy/mm/dd_hh:mm:ss_mmm'
y20(19) $datetime Begin date/time Edited y20(19)
y20(10) $date date edited 'ccyy/mm/dd'
y31(8) $time time edited 'hh:mm:ss'
y40(3) $msecs milliseconds 'mmm'
within current second
------- CURRENT dates/times -------
Note |
- Curent date/times (initially same as program Begin time)
- updated by several events & instructions
- file opens/closes, record gets/puts/updates
- instructions (tim, eoj, can, msg, ran)
|
y50(18) $datetime18c Current date/time Not edited
ccyymmddHHMMSS0mmm(18)
y50(14) $datetime14c Current date/time Not edited
ccyymmddHHMMSS (14)
y50(8) $date8c system date when execution began
y58(6) $time6c system time HHMMSS
y64(4) $msecs4c milliseconds 4 digits (0mmm)
within current second
y50(8) $date2 same as $date8c
y58(6) $time2 same as $time6c
y70(23) $datetimemsc Current date/time edited (23)
'ccyy/mm/dd_hh:mm:ss_mmm'
y70(19) $datetimec Current date/time edited (19)
'ccyy/mm/dd_hh:mm:ss'
y70(10) $datec date edited 'ccyy/mm/dd'
y81(8) $timec time edited 'hh:mm:ss'
y90(3) $msecsc milliseconds 'mmm'
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
A2a. work area 'y' - system information (continued)
address | $symbol | item description
y100(8) $version program version/date (8+2 nulls)
y110(19) $license license# (19+null)
y130(30) $sitename registered site name
y160(30) $regname registered person name
y190(30) $jobstamp jobstamp $JOBID:date:time
'jobid:yymmdd:HHMMSS:'
y220(50) $jobname uvcopy jobname (root name)
y250(15) $dtstamp date/time stamp ':yymmdd:HHMMSS:'
y280(20) $hostname unix HOST name
y300(10) executable program name (uvcopy)
y310(10) source program name (uvcopy.c)
y320(8) $isamtyp isam file type DISAM (MBPISAM & SCOISAM now obsolete)
y330(8) $isamext isam file extension null or '.dat' from env-var ISDATEXT
'.dat' expected on input files & created on output files
y338(1) $slash '/' for UNIX, '\' for MS-DOS
y340(10) $today
y350(17) $datdate alpha date stored by the 'dat' instruction
'day mth dd yyyy'
- day# of week (0-6 = Sun-Sat)
day - day of week (Sun-Sat)
mth - mth (Jan-Dec)
y356(11) $shortdate 'mth dd yyyy' ex: 'Jul 19 2000'
y370(5) $machine machine or OS type
LNX, HP, SUN, AIX, DOS
y380(20) $jobid value of ${JOBID} env-var
JOBID is UV convention for name of calling script
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
A2b. work area 'y' - system information (continued)
y400(6) $mmddyy date in mmddyy format
y410(6) $ddmmyy date in ddmmyy format
y420(18) $alphadate full alpha date ex: 'September 15, 2000'
y440(4) $caldate ccyymmdd in binary int
y444(4) $days1900 days since 1900 (for 'dat' conversion instruction)
y450(3) $bits accumulator bits S64/H64/H32 depending on compile option
y455(4) $lf64 indicator for Large File support 'LF64' or ' '
Note |
- dates/times in binary moved here in March 2020
|
y460(4b) $umils1 Begin job milliseconds (within curent second)
y464(8b) $utime1 Begin job unixtime (seconds since 1970)
y472(8b) $umics1 Begin job microseconds (within current second)
y480(8b) $utime2 Current unixtime (seconds since 1970)
y488(8b) $umics2 Current microseconds (within second)
y496(4b) $umils2 Current millisecnds (within second)
y500(50) $cwd current working directory
y550(50) $logname user's logon name
y600(50) $home user's HOME directory
y650(50) $mail user's MAILPATH
y700(50) $binpath pathname of executing program (uvcopy)
y750(250) $pfpath pathname for parameter file search
comma delimited multiple path names
Note |
- see details of PFPATH environmental variable for uvcopy
parameter file search in E1 of uvcopy1.doc |
Environmental Variables (vs uvcopy $variables)
See the 'env' & 'evt' instructions to retrieve any other specific environmental
variable or all environmental variables. Prior to April 1998 y400(100) was used
for $path, now removed because some users could have very long PATHs.
You can use the 'env' instruction to retrieve $PATH into a big work area.
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
A2c. work area 'y' - system information (continued)
msg reply & argument areas
y1000(100) $reply message reply area (for msgw instruction)
y1000(100) $arg0 (same as $reply)
y1100(100) $arg1 storage for command line argument #1
or for reply from 'msgwa1'
y1200(100) $arg2 storage for command line argument #2
or for reply from 'msgwa2'
-etc- -etc- - - - etc - - -
y1900(100) $arg9 storage for command line argument #9
or for reply from 'msgwa9'
y2000(300) $spaces blank area for misc use (clearing, comparing)
$blanks same as $spaces
y2300(100) $hscale scale to 100 as follows:
1...5...10...15...20... etc ...95.....
y2400(200) $tscale tens scale --> 10 20 etc (100 bytes)
scale for debug command 'c' & available to user
y2600(200) $uscale units scale -->012345678901234567890 etc (100 bytes)
scale for debug command 'c' & available to user
y3000(50) $uops user options (unprocessed string eg: q0i7 etc)
y3050(50) $uops2 user options (from cmdline or prompt vs default)
y3100(50) $rops run options (unprocessed string)
y3150(50) $rops2 run options (from cmdline or prompt vs default)
y3200(300) $zeros zero characters for clearing numeric char fields
y3500(256) $trtfns translate table convert filename puncts to underscores
y4100(100) $tbh1 tbl field headings 1 of 10 user assigned
etc etc argument; acum1; acum2; (max acum6;)
y4900(100) $tbh9 tbl field headings 9 of 10 user assigned
y5000(200) $pfname prmfile name (full path name)
y5000(200) $jobpath alternate name (full path name)
- same as $jobname if no path specified
y5200(200) $uvcmdline - uvcopy comamnd line
y5400(70) $ppcmdpath - (Parent Process) calling script path with directories
y5570(30) $ppcmd - (Parent Process) calling script command (basename)
y5600(100) $ppcmdargs - (Parent Process) calling script arguments
y5700(100) $ppcmdline - (Parent Process) calling script command line
- script basename + script arguments
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
A3. uvcopy work area 'z' - file control table
As of Nov98 each file control table entry required 1000 bytes the 'z' area
allows for 32 files fili1-8, filo1-8, filr1-8, fild1-8.
Most users need not be concerned with layout but it follows on the next page
(probably more for my benefit than for yours).
The File Control Table entries are the same size on 32 or 64 bit machines.
The pointers are 8 bytes (vs 4 bytes) on some machines such as DEC Alpha
but 4 byte fillers are used for 32 bit machines to maintain same layout.
This is controlled by compile time arguments, for example:
ccc uvcopy INT H32 DISAM <-- compile on 32 bit Intel
ccc uvcopy DEC H64 DISAM <-- compile on 64 bit DEC
The $fili1, $fili2, symbol addresses are recalculated, just in case of some
architectures/compilers are not allowed for.
See the File Control Table layout on the next page --->
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
A3a. work area 'z' - file control table
z0(180) - filename (max length increased from 80 to 180 May2003)
- the filename may be addressed via $symbols:
$fili1-$fili8, $filo1-$filo40, $filr1-$filr8, $fild1-$fild8
- following fields could be addressed via displacements & lengths
for example record size for output file #1 is at $filo1+124(4b)
z180(16) - file typ codes & options
z196(14) - date of last file modification (yyyymmddHHMMSS)
z210(1) - file keywords declared (0x01=fil,0x02=typ,0x04=rcs,0x08=isk)
z211(1) - file opened/closed 0x01/0x00
z212(6) - logical filename (fili1-8,filo1-8,filr1-8,fild1-8)
z220(4b) - hit counter (user may update via $fi1hits,etc)
z224(4b) - record size
z480(8b) - file size relocated/resized from 228(4b) to 480(8b)
z232(4b) - buffer size (from typ option b, 8K default)
z236(4b) - reads - 'get's if seqntl, 'red's if ISAM
z240(4b) - writes - 'put's if seqntl, 'wrt's if ISAM
z244(4b) - updates - 'upd' instructions (ISAM only)
z248(4b) - deletes - 'del' instructions (ISAM only)
z252(4b) - ISAM file total record count
z256(4b) - ISAM file deleted records (slot count - ISAM count)
z260(4b) - record slot count calculated, all file types
z264(4b) - slot size = rcs (+1 if typ ISF/RSR)
z268(4b) - remainder of fsize/rcs (errchk user convenience)
z272(4b) - ISAM file number of keys
z276(4b) - ISAM record# of most recent I/O
z280(4b) - file lock wait time accumulator (seconds)
z284(4b) - file descriptor for ISAM files
z288(4b) - file I/O return code
z292(4b) - ISAM file index buffer size
z296(104) - file option integers in sorted positions
z400(28) - file option characters in sorted positions
following 5 fields apply to typ=RSV/IDX Record/Indexed Sequential VARIABLE
z428(4b) - RSV/IDX maximum record size
z432(4b) - RSV/IDX minimum record size
z436(4b) - RSV/IDX indicator 0/1 for max rcsz <=4095 or >4095
z440(4b) - RSV/IDX record header size 2/4 bytes (max rcsz <=4095 /or >4095)
z444(4b) - RSV/IDX record trailing part (maxrcsz-minrcsz)
z448(8b) - DIR ptr from opendir - 8 or 4+4(dummy) if not 64 bit
z456(8b) - FILE pointer for UNIX system files
z464(8b) - pointer to buffer (acquired by malloc)
z472(4b) - handle from findfirst (WinDOS read directory)
z480(8b) - file size relocated/resized from 228(4b) to 480(8b)
z500(92) - ISAM file key alpha descriptions for user convenience
- (key1start,key1length,k2s,k2l,...etc...)
z592(280) - _finddata_t structure for WinDOS directory reads
- will overlay ISAM key storage (mutually exclusive)
z600(32) - 1st ISAM key binary specs (32 bytes allows 3 parts per key)
z600(320) - ISAM key specs for 10 keys * 32 = 320 bytes total
z998(2) - '->' marks end of FCT entry
z1000 - size of file control table entries as of Nov95
Note |
- File Control Table entries same size 32/64 bit machines
pointers 8 bytes (vs 4 bytes), but 4 byte fillers used if 32 bits
- The $fili1, $fili2, symbol addresses are recalculated
(in case of some architectures/compilers not allowed for) |
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
A3b. work area 'z' - file control table
The previous page documented the layout of each file control table entry.
These are 32 at 1000 bytes for a total of 19,200 bytes. You may address
fields within FCT entries by using $fil__ symbols + offsets on prior page.
z00000 - $fili1 input files
z01000 - $fili2
z02000 - $fili3
z03000 - $fili4
z04000 - $fili5
z05000 - $fili6
z06000 - $fili7
z07000 - $fili8
z08000 - $fild1 directories
z09000 - $fild2
z10000 - $fild3
z11000 - $fild4
z12000 - $fild5
z13000 - $fild6
z14000 - $fild7
z15000 - $fild8
z16000 - $filr1 random files
z17000 - $filr2
z18000 - $filr3
z19000 - $filr4
z20000 - $filr5
z21000 - $filr6
z22000 - $filr7
z23000 - $filr8
z24000 - $filo1 output files
z25000 - $filo2
z26000 - $filo3
z27000 - $filo4
z28000 - $filo5
z29000 - $filo6
z30000 - $filo7
z31000 - $filo8
z32000 - $filo9
z33000 - $filo10
z34000 - $filo11
z35000 - $filo12
- - - etc - - -
z63000 - $filo40
z64000 - end of file control table
The file control table entries for uxcopy & uxqrpg (vs uvcopy/uvqrpg)
were increased to 2000 bytes each (vs 1000 bytes each). Extra space was
required to store the FCD & KDB (File Control Description & Key Definition
Block) for Micro Focus IDXFORMAT3 files Indexed Sequential Variable files
These files are specified as 'typ=IDXf3' or 'typ=IDXf8' for uxcopy, uxqrpg,
uxcp,& uxsort.
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
A3c. ISAM key structure layout (keydesc & keypart=1)
ISAM key descriptions are stored at byte 600-919 of each file packet
within area 'z'. The keys for fili1 would be at z600(320) & the keys
for fili2 would be at z1600(320) since each file packet is 1000 bytes.
10 keys are allowed for each file & each key spec requires 32 bytes
which is allocated as follows:
00-01 - flags (bit coded as follows)
- z600(2b) for 1st key of 1st input file (fili1)
x'0000' - ISNODUPS
x'0001' - ISDUPS (option 'd' provided by uvcopy)
x'0002' - DCOMPRES (duplicate compresssion)
x'0004' - LCOMPRES (leading compresssion)
x'0008' - TCOMPRES (trailing compresssion)
x'000E' - COMPRES (all compresssions)
x'000F' - ISALL (all flags set)
02-03 - number of parts in key1 (of 10 max)
- z602(2b) for fili1
- uvcopy supports up to 3 parts per key
04-05 - displacement to 1st byte of key1 part1 within the record
- z604(2b) for fili1
06-07 - length of key1 part1
- z606(2b) for fili1
08-09 - key type for key1 part1
- z608(2b) for fili1
x'00' - character (supported by uvcopy)
x'01' - int,2=long,3=double,4=float,5=mint,6=mlong,7=string
x'80' - descending order
10-15 - dsplcmnt/length/type for part2 of key
16-21 - dsplcmnt/length/type for part3 of key
22-23 - total length of key1 (all 3 parts max)
- z622(2b) for key 1 of fili1
24-31 - record# of root node
- z624(8b) for fili1
32-63 - key2 of file1
- z632(32)
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
A4. uvcopy work area 'w' - bal subroutine work area
Area 'w' is used to store optional data from op2,op3,op4 of the
'bal' instruction in w0(200), w200(200), w400(200).
These areas are blank right filled for operands that are coded, but are
unchanged for any operands not coded.
bal subr1 - bal op2,op3,op4 optional
area 'w' unchanged if op2,op3,op4 omitted
bal subr2,a0(80),b0(80),c0(80) - op2,op3,op4 may be an area addresses
bal subr2,a0(80),'xxx','yyy' - or constants or any combination
Note |
- the effect of the above instruction is the same as if the bal
instruction was preceded by 'mvf' instructions: |
[ mvf w0(200),a0(80) ]
[ mvf w200(200),'xxx' ]
[ mvf w400(200),'yyy' ]
bal subr2
Note |
- op2 may be up to 4000 bytes (if op3 & op4 omitted)
- effect would be same as
|
[ mvf w0(4000),a0(4000) ]
bal subr2
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
B0. uvcopy $SYMBOLS
$symbols may be used to address special areas of the uvcopy program
work areas x,y,& z. $symbols are more meaningful & easier to code
since you don't have to remember the storage locations & lengths.
The uvcopy program substitutes the storage area, location, & length
for the $symbols when the instructions are read for the prmfile
& stored in memory for execution. There are 4 kinds of $symbols:
- $symbol addresses
- $symbol constants
- $symbol addresses, user defined
- ${environmental-variables}
- $symbol addresses - address special items in work areas x,y,& z
For example the following instructions are equivalent:
add $ca1,1 add 1 to counter set 'a' acum #1
add x200(4b),1 - the same, but not as convenient
- $symbol constants - may be coded within constant literals
For example you might setup a report heading as follows:
mvc h0(50),'ABC Ltd. A/R Overdue List $date $time '
uvcopy will substitute the current date & time for $date & $time
when the prmfile instruction is stored in the execution table
- user $symbols - the user may also assign $symbols to items such as
fields within user record layouts.
User $symbols can be coded at the begining of the prmfile or
stored in a file & loaded at startup.
For example you might assign $symbols to fields in your employee
master record & then reference them as follows:
lod=q0(48) - table loaded at begin program
$empnum =m0(8)
$empname =m20(30) - free format in max 48 byte entry
$hourrate =m50(8) - stored fixed format w '=' col 34
mvc b60(30),$empname - move name from master to detail
mpy b90(8),$hourrate - multiply detail hours by master rate
- ${environmental variables}
must be coded as shown with the braces ${...} for uvcopy to
distinguish from other '$' symbols.
You may use any env-var, system or user assigned (via exports)
fili1=${UVCOMP1}/filex,rcs=256,typ=ISF
filo1=${UVCOMP2}/filex,rcs=256,typ=ISF
.....
mvf h0(15),'${LOGNAME}' - store user-id
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
B1. uvcopy $symbol addresses - INDEX REGISTERS
$ra x0(4) - index register 'a'
... etc ...
$rz x100(4b) - index register 'z'
Note |
- see register details on pages 'H0' - H7
|
$rem x104(4b) - remainder of last divide
$pid x108(4b) - UNIX process-id
$ppid x112(4b) - UNIX parent process-id
$icnt x116(4b) - uvcopy instruction count (in current parameter file)
$cc x120(4b) - post-instruction condition code
- set by various instructions (cmc, cmn, get, red, etc)
- tested via skp< skp= skp>
$iserr x124(4b) - ISAM error number
- set by various ISAM instructions (get, red, upd, wrt, etc)
- ex: red sets to 111 if no record found
- $iserr not required, usually tested via skp? following red, etc
Note |
- follwing 3 fields for uvqrpg (vs uvcopy)
|
$linectr x176(4b) - line counter
$paagectr x180(4b) - page counter
$pagenum x184(8) - page counter edited page####
$bigend; x193(1) - B/L BigEnd/LittleEnd machine
BigEnd: Mainframe, Sun Sparc to version 9, Motorolla
LittleEnd - Intel & AMD chips used by many brands
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
B2. uvcopy $symbol addresses - COUNTERS
$ca1 x200(8b) - user counter set 'a' counter #1
... etc ...
$ca24 x392(8b) - user counter set 'a' counter #24
$cb1 x400(8b) - user counter set 'b' counter #1
... etc ...
$cb24 x592(8b) - user counter set 'b' counter #24
... etc ... for user counter sets c,d,e,f,h
$ci1 x1800(8b) - instruction counter set 'i' counter #1
... etc ...
$ci24 x1992(8b) - instruction counter set 'i' counter #24
Note |
- As of Dec 2007, counters are 8 bytes or 64 bits
- you usually don't care about $location since you will normally
use the $symbols & not the actual locations |
Note |
- counter sets a,b,c,d,e,f,g,h are completely available to the user
- counters in set i are instruction counters & are stored by various
instructions - see counter details later this section |
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
B3. uvcopy $symbols addresses - OPTIONS
$iopba = x2200(4b) - instruction options 'binary' storage for option 'a'
... etc ...
$iopbz = x2300(4b) - instruction options 'binary' storage for option 'z'
$iopca = x2304(1) - instruction options 'character' storage for option 'a'
... etc ...
$iopcz = x2329(1) - instruction options 'character' storage for option 'z'
$ropba = x2400(4b) 'run' options 'binary' storage for option 'a'
$ropbz = x2500(4b) 'run' options 'binary' storage for option 'z'
$ropca = x2504(1) 'run' options 'character' storage for option 'a'
$ropcz = x2529(1) 'run' options 'character' storage for option 'z'
$uopba = x2600(4b) 'user' options 'binary' storage for option 'a'
$uopbz = x2700(4b) 'user' options 'binary' storage for option 'z'
$uopca = x2704(1) 'user' options 'character' storage for option 'a'
$uopcz = x2729(1) 'user' options 'character' storage for option 'z'
- You probably will not have occasion to address the 'instruction'
option areas or the 'run' option areas, but the 'user' options
are very handy.
- Please see many examples in the pre-programmed jobs where user
options are assigned to items such as record sizes, stop counts, etc
- For example 'copyf1' in COPYjobs assigns option 'n' to a stop count
at startup & tests it within the get/put loop as follows:
uop=q1n99999 - assigns user option n to default 99999
(hi value 99999 to copy entire file to EOF)
- q1 option causes operator query for change ?
loop get fili1,a0(256) - get next record
add $ca1,1 - increment record counter (in get/put loop)
cmn $ca1,$uopbn ** rec ctr = stop count ? (** user option n)
skp= eof yes - goto eof
skp loop no - return to get next record
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
B4. uvcopy $symbols addresses - user PROCESS options
$popba x2800(4b) 'process' options 'binary' storage for option 'a'
$popbz x2900(4b) 'process' options 'binary' storage for option 'z'
$popca x2904(1) 'process' options 'character' storage for option 'a'
$popcz x2929(1) 'process' options 'character' storage for option 'z'
Process options are assigned entirely by the user.
Process options are created by the 'pop' instruction.
Sorts & converts the option string in op1 into process option storage
in area 'x' (see work area x layout).
'pop' might be used to process option strings designed into your records
(customer options,etc) - example follows:
pop a80(20) - sort & convert option string in 81-100
of area a (customer master record)
into the process option w/s in area x
cmc $popcb,'b' - test character option b present ?
skp= balfwd - might be 'b'alance forward vs open item
cmn $popbi,60 - test binary option i (interest days)
skp> intcalc
$lovalues = x2536(64) low values x'00's
$hivalues = x2736(64) low values x'00's
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
B5. uvcopy $symbols addresses - ALTERNATE INSTRUCTION options
$iopo0 = x3000(20) - alternate instruction option storage 'o0'
$iopo1 = x3020(20) - alternate instruction option storage 'o1'
... etc ...
$iopo9 = x3180(20) - alternate instruction option storage 'o9'
Note |
- As an example of how alternate instruction options might be used
please see the 'scan1' job in section SCANjobs.doc and find the
following code at startup time & within the get/put loop |
msgwy 'activate special pattern match characters y/n ?'
cmc $reply(1),'y' user requests pat mat chars ?
skp! 1
mvc $iopo1(1),'p' yes - store option 'p' for 'scn'
loop get fili1,a0(256) get next record
skp> eof
scno1 a0(256),d0($rn80) ** record match to search data ?
skp! loop no - return to get next record
put filo1,a0(256) yes - output matched records
skp loop return to get next record
Note |
- normally if we wanted to scan the record with the 'pattern' match
option active, we would simply write: |
scnp a0(256),d0($rn80) record match to search data ?
- however in this case, we want to let the operator decide at run time
whether to invoke pattern match or not & the 'o1' option on the 'scn'
instruction tells the instruction processor to use the options in
alternate instruction option area #1 rather than any options coded
on the instruction itself
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
B6. uvcopy $symbol addresses - translate tables
$trt = x3200(256) - translate table for trt instruction, originally
neutral (user may modify or copy & modify)
$trtneut = x3200(256) - same as $trt (alternate $symbol)
$trt256 = x3200(256) - same as $trt (alternate $symbol)
$trtsea = x3456(256) - translate table for trt instruction, to correct signs
of zoned numeric fields translated from EBCDIC to ASCII
$trtsae = x3712(256) - translate table for trt instruction, to correct signs
of numeric fields translated from ASCII to EBCDIC
$trtchr = x3968(256) - translate table for trt instruction, to convert data
to printable characters only.
x'00'-x'1F' & x'7F'-x'FF' translated to periods.
$trtper = x4224(256) - translate table to convert unprintable chars to periods
(similar to $trtchr above)
$trta2e = x4480(256) - ASCII to EBCDIC translate table for trt instrn
default table does not change values > x'80'
run option rop=t2 loads alternate table which
translates values > x'80' to EBCDIC blanks x'40's
$trte2a = x4736(256) - EBCDIC to ASCII translate table for trt instrn
$trtfns = y3500(256) - translate problem characters in filenames to underscores
- ! " $ & ` ( ) * , / < = > ? \ { | } ~
- used by jobs selectlf1,etc which create output filenames
by concat search patterns which may contain spcl chars
x5000(45) utsname structure for uname UNIX system call
$usysname x5000(9) - UNIX system software (ex: RedHat)
$unodename x5009(9) - UNIX network node name (ex: uvsoft)
$urelease x5018(9) - UNIX system release (ex: 3.2)
$uversion x5027(9) - UNIX system release version (ex: 2)
$umachine x5036(9) - UNIX machine (ex: i386)
Note |
- following documented for UNIX gurus, most users can bypass this topic.
|
$direcnt x5100(100) - system independent directory entry structure (dirent)
- see the 'dirent' structure documented on the next page
- stored by the most recent directory 'get'
- not normally required, since get delivers the filename
into the op2 area specified on the get instruction
$fstat x5200(128) - file status structure from most recent 'opn' file
- see the 'stat' structure documented on the next page
- if you want to access, you would opn files individually
rather than the usual 'opn all'
- not normally required, the file size & last modification
time are also stored in the file table in area 'z'
& the file size is also left in register 'z'
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
B7. uvcopy $symbol addresses - SPECIAL
$symbol | address | item description
------- BEGINING dates/times when program execution began -------
$datetime18 y0(18) Begin date/time Not Edited
ccyymmddHHMMSS0mmm (18)
$datetime14 y0(14) Begin date/time Not Edited (14)
ccyymmddHHMMSS (14)
$date8 y0(8) system date when execution began
$time6 y8(6) system time HHMMSS
$msecs4 y14(4) milliseconds 4 digits (0mmm)
within current second
$date1 y0(8) same as $date8
$time1 y8(6) same as $time6
$datetimems y20(23) Begin date/time Edited y20(23)
'ccyy/mm/dd_hh:mm:ss_mmm'
$datetime y20(19) Begin date/time Edited y20(19)
$date y20(10) date edited 'ccyy/mm/dd'
$time y31(8) time edited 'hh:mm:ss'
$msecs y40(3) milliseconds 'mmm'
within current second
------- CURRENT dates/times -------
Note |
- Curent date/times (initially same as program Begin time)
- updated by several events & instructions
- file opens/closes, record gets/puts/updates
- instructions (tim, eoj, can, msg, ran)
|
$datetime18c y50(18) Current date/time Not edited
ccyymmddHHMMSS0mmm(18)
$datetime14c y50(14) Current date/time Not edited
ccyymmddHHMMSS (14)
$date8c y50(8) system date when execution began
$time6c y58(6) system time HHMMSS
$msecs4c y64(4) milliseconds 4 digits (0mmm)
within current second
$date2 y50(8) same as $date8c
$time2 y58(6) same as $time6c
$datetimemsc y70(23) Current date/time edited (23)
'ccyy/mm/dd_hh:mm:ss_mmm'
$datetimec y70(19) Current date/time edited (19)
'ccyy/mm/dd_hh:mm:ss'
$datec y70(10) date edited 'ccyy/mm/dd'
$timec y81(8) time edited 'hh:mm:ss'
$msecsc y90(3) milliseconds 'mmm'
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
B7a. uvcopy $symbol addresses - SPECIAL
address | $symbol | item description
$version y100(10) program version/date (8+2 nulls)
$license y110(20) license#
$sitename y130(30) registered site name
$regname y160(30) registered person name
$jobstamp y190(30) jobstamp $JOBID:date:time
'jobid:yymmdd:HHMMSS:'
$jobname y220(50) uvcopy jobname (root name)
$dtstamp y250(15) date/time stamp ':yymmdd:HHMMSS:'
$hostname y280(20) unix HOST name
y300(10) executable program name (uvcopy)
y310(10) source program name (uvcopy.c)
$isamtyp y320(8) isam file type DISAM (MBPISAM & SCOISAM now obsolete)
$isamext y330(8) isam file extension null or '.dat' from env-var ISDATEXT
'.dat' expected on input files & created on output files
$slash y338(1) '/' for UNIX, '\' for MS-DOS
$today y340(10)
$datdate y350(17) alpha date stored by the 'dat' instruction
'day mth dd yyyy'
- day# of week (0-6 = Sun-Sat)
day - day of week (Sun-Sat)
mth - mth (Jan-Dec)
$shortdate y356(11) 'mth dd yyyy' ex: 'Jul 19 2000'
$machine y370(5) machine or OS type
LNX, HP, SUN, AIX, DOS
$jobid y380(20) value of ${JOBID} env-var
JOBID is UV convention for name of calling script
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
B7b. uvcopy $symbol addresses - SPECIAL
$mmddyy y400(6) date in mmddyy format
$ddmmyy y410(6) date in ddmmyy format
$alphadate y420(18) full alpha date ex: 'September 15, 2000'
$caldate y440(4) ccyymmdd in binaary int
$days1900 y444(4) days since 1900 (for 'dat' conversion instruction)
$bits y450(3) accumulator bits S64/H64/H32 depending on compile option
$lf64 y455(4) indicator for Large File support 'LF64' or ' '
Note |
- dates/times in binary moved here in March 2020
|
$umils1 y460(4b) Begin job milliseconds (within curent second)
$utime1 y464(8b) Begin job unixtime (seconds since 1970)
$umics1 y472(8b) Begin job microseconds (within current second)
$utime2 y480(8b) Current unixtime (seconds since 1970)
$umics2 y488(8b) Current microseconds (within second)
$umils2 y496(4b) Current millisecnds (within second)
$cwd y500(50) current working directory
$logname y550(50) user's logon name
$home y600(50) user's HOME directory
$mail y650(50) user's MAILPATH
$binpath y700(50) pathname of executing program (uvcopy)
$pfpath y750(250) pathname for parameter file search
comma delimited multiple path names
Note |
- see details of PFPATH environmental variable for uvcopy
parameter file search in E1 of uvcopy1.doc |
Environmental Variables (vs uvcopy $variables)
See the 'env' & 'evt' instructions to retrieve any other specific environmental
variable or all environmental variables. Prior to April 1998 y400(100) was used
for $path, now removed because some users could have very long PATHs.
You can use the 'env' instruction to retrieve $PATH into a big work area.
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
B7c. $symbol addresses - SPECIAL (continued)
$reply = y1000(100) reply data area for the 'msgw' instruction
$arg0 = y1000(100) - - - same as above - - -
$arg1 = y1100(100) data storage for command line argument #1 (arg1=xxx)
or reply data area for the 'msgwa1' instruction
-etc- --etc-- - - - etc - - -
$arg9 = y1900(100) data storage for command line argument #9 (arg9=xxx)
or reply data area for the 'msgwa9' instruction
$spaces y2000(300) blank area for misc use (clearing,comparing,etc)
$blanks same as $spaces
$lovalues x2536(64) low-values x'00's
$hivalues x2736(64) high-values x'FF's
$hscale y2300(100) scale to 100 as follows:
1...5...10...15...20... etc ...95.....
$tscale y2400(200) tens scale --> 10 20 etc (100 bytes)
scale for debug command 'c' & available to user
$uscale y2600(200) units scale -->012345678901234567890 etc (100 bytes)
scale for debug command 'c' & available to user
$uops y3000(50) user options (unprocessed eg: q0i7 etc) x'00' filled on right
$uops2 y3050(50) user options from cmd line or prompt (vs defaults)
$rops y3100(50) run options (unprocessed string) x'00' filled on right
$rops2 y3150(50) run options from cmd line or prompt (vs defaults)
$zeros y3200(300) zero characters for clearing numeric char fields
$trtfns y3500(256) translate table convert filename puncts to underscores
$tbh1 y4100(100) tbl field headings 1 of 10 user assigned
etc etc argument; acum1; acum2; (max acum6;)
$tbh1 y4900(100) tbl field headings 9 of 10 user assigned
$pfname y5000(200) prmfile name (full path name)
$jobpath y5000(200) alternate name (full path name)
same as $jobname if no path specified
$uvcmdpath y5200(200) $uvcmdline - uvcopy comamnd line
$ppcmdpath y5400(70) $ppcmdpath - (Parent Process) calling script path with directories
$ppcmd y5570(30) $ppcmd - (Parent Process) calling script command (basename)
$ppcmdargs y5600(100) $ppcmdargs - (Parent Process) calling script arguments
$ppcmdline y5700(100) $ppcmdline - (Parent Process) calling script command line
- script basename + script arguments
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
B8. uvcopy $symbol addresses - SPECIAL (continued)
$fili1 = z0(180) - name of input file #1
$fili2 = z1000(180) - name of input file #2
$fili3 = z2000(180) - name of input file #3
- - - etc - - -
$fili8 = z7000(180) - name of input file #8
$filo1 = z8000(180) - name of output file #1
$filo2 = z9000(180) - name of output file #2
$filo3 = z10000(180) - name of output file #3
- - - etc - - -
$filo40 = z63000(180) - name of output file #8
$filr1 = z16000(180) - name of random file #1
$filr2 = z17000(180) - name of random file #2
$filr3 = z18000(180) - name of random file #3
- - - etc - - -
$filr8 = z23000(180) - name of random file #8
$fild1 = z24000(180) - name of directory file #1
$fild2 = z25000(180) - name of directory file #2
$fild3 = z26000(180) - name of directory file #3
- - - etc - - -
$fild8 = z31000(180) - name of directory file #8
32000 - total size of File Control Table
$fi1hits = z0220(4b) - hit counter for input file #1
$fi2hits = z1220(4b) - hit counter for input file #2
$fi3hits = z2220(4b) - hit counter for input file #3
$fo1hits = z8220(4b) - hit counter for output file #1
$fo2hits = z9220(4b) - hit counter for output file #2
$fo3hits = z10220(4b) - hit counter for output file #3
$fr1hits = z16220(4b) - hit counter for random file #1
$fr2hits = z17220(4b) - hit counter for random file #2
$fr3hits = z23220(4b) - hit counter for random file #3
$fd1hits = z24220(4b) - hit counter for directory file #1
$fd2hits = z25220(4b) - hit counter for directory file #2
$fd3hits = z31220(4b) - hit counter for directory file #3
- the uvcopy program does not update the hit counters
- the user may assign meanings to them & update them as desired
- they are a convenient way of counting things such as the number
of pattern matches within the file, etc
- they are automatically displayed with the EOF statistics
& on file progress reports (see file option 'm')
- File Control Table entries should be same size on 32 & 64 bit machines
pointers are 8 bytes (vs 4 bytes), but filler 4 bytes inserted
- The values above are re-calculated when the uvcopy program is
initiated to ensure $fili1, $fili2, etc symbols will be correct.
- The $fili1, $fili2, etc symbols will correctly address the
begining of each entry & you can use offset addressing to get
to items of interest.
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
B9. uvcopy $symbol CONSTANTS
$symbol constants - may be coded within constant literals. For example
you might setup a report heading as follows:
mvc h0(50),'ABC Ltd. A/R Overdue List $date $time '
See many available date/time $symbols begining on page 'B7'.
Here are just the 2 ($date & $time).
$date = y0(8) - current date when uvcopy began execution yyyymmdd
$time = y8(6) - current time when uvcopy began execution hhmmss
uvcopy will substitute the current date & time for $date & $time
when the prmfile instruction is stored in the execution table.
Important to realize that filenames are not yet available at this
time & if you want to show a filename you might do the following:
mvf h50(60),'A/R file = fff $date'
repf h50(60),'fff',$fili1
'fff' is used as a pattern-id by the 'repf' to insert the actual
filename. You can not use $fili1 directly in the constant string
because it would not be recognized by uvcopy at instruction storage
time, as per $date'
Note the 'f' option (of 'repf') causes uvcopy to determine the
replacement length by the 1st null at the end of the filename.
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
B10. uvcopy $symbols - USER ASSIGNED
The user may assign $symbols to items such as fields within record layouts.
User $symbols can be coded at the begining of the prmfile or stored in
a file & loaded at startup.
For example you might assign $symbols to fields in your employee master
record & then reference them as follows:
lod=q0(48) - table loaded at begin program
$empnum =m0(8)
$empname =m20(30) - free format in max 48 byte entry
$hourrate =m50(8) - stored fixed format w '=' col 34
mvc b60(30),$empname - move name from master to detail
mpy b90(8),$hourrate - multiply detail hours by master rate
The user $symbols must be loaded into area 'q' either from embedded
data in the prmfile or from a previously prepared table file.
Please see the next page for a complete example:
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
B10a. $symbols - user assigned (continued)
sample $symbol 'lod'ing & referencing
# symbols - uvcopy prmtr file to illustrate $symbols
# - input file is customer master to be listed
fili1=cusmas,rcs=80,typ=RSF
filo1=cuslist,rcs=80,typ=LSTt
lod=q0(48) # load $symbols in area 'q'
$cusrec =a0(80)
$cusnum =a0(8)
$status =a8(2)
$name =a10(20)
$adrs =a30(20)
$city =a50(20)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#June2009 - free format stored in max 48 byte entry with '=' in col 34
opn all
loop get fili1,$cusrec
skp> eof
cmc $status,'de'
skp= loop
mvc p0(8),$cusnum
mvc p10(20),$name
mvc p32(20),$adrs
mvc p54(20),$city
put filo1,p0(80)
skp loop
eof cls all
sysv1 'lp $filo1 '
eoj
The table of $symbols may also be 'lod'ed from a file
You could replace the 'lod' above with:
lod=qq0(48),custmas,c # load $symbols from custmas file in fild7
Then the $symbols $cusrec -thru- $city would be removed from the
prmfile & stored in a separate file. These files must be stored
in a directory defined by 'fild7', for example:
fild7=uvsymbols,rcs=80,typ=DIR
The 2nd 'q' of qq0(48) is a register that allows loding area q
with $symbols from multiple files
Operand 3 ('c' above) is optional & would change the area originally
coded in the $symbol file. These options allow multiple $symbol files:
lod=qq0(48),custmas,a
lod=qq0(48),products,b
lod=qq0(48),salesdtl,c
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
B11. uvcopy ${environmental variables}
You may use any environmental variable that has been defined via the
standard UNIX 'export' command (either by the system or by the user).
You might use these within filenames, constants, or on data lines loaded by
the 'lod' instruction. For example:
filo1=tmp/${LOGNAME}.tmp,rcs=80,typ=LSTt
#=======================================
#A. - define output filename with your login ID
mvf h88(20),'${LOGNAME}' - store userid in area h
#=============================
#B. - copy your login-name into an area (maybe a page heading)
# - But the code below might be even better
#C. load data into area h (report headings for the output file)
lod=h0(80)
ABC Company Expense list for items over $99
Run by: ${LOGNAME} Date: $datetime
Branch: ${BRANCH} Options: ${OPTIONS}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Notes
- You must code environmental variables using the ${...} convention
so uvcopy can recognize them vs internal $symbols such as $datetime.
- It is easier to format report headings, etc using method C. than B.
You don't have to figure out the byte addresses for inserting constants.
- The table loaded in area 'h' above could be dumped to the output
report file via the 'wtb' instruction:
wtbe filo1,h0(80),h0(80)
The 'e' option (of wtbet1) excludes writing the end of table marker
line (of tildes) to the output file.
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
C0. uvcopy OPTIONS - 6 kinds
- run options - specified via the 'rop=' function
(within the parameter file or on the command line)
- may also be specified via 'export UVCOPYROP='
- applies to the entire run
- meanings are dedicated & preassigned by uvcopy
- example: rop=d for debug mode
- user options - specified via the 'uop=' function
(within the parameter file or on the command line)
- applies to the entire run
- meanings are assigned by the user
- example: uop=s1 might mean spool output (vs s0 display)
uop=p2 might mean 2 pages of labels desired
- tested by the user (not by the uvcopy program as rop)
example: cmn $uopbs,1 spool output ?
- file options - appended to the typ spec of file declarations
- applies to that particular file
- example: typ=LSTt (t option truncates trailing blanks)
- instruction options - appended to individual instructions
- applies only to that instruction
- example: trlq1 (q1 inhibits translate within quotes)
- alternative instruction option areas
- invoked by the 'o' instruction option
- for example 'o1' means to use the instruction options
in alternative instrn option storage #1 $iopo1 x2020(20)
rather than any options coded on the instruction itself
example: scno1 b0(80),$reply($rr40)
- process options
- for user assignment only
- the 'pop' instruction will sort & convert user assigned
option strings into the process option storage areas
in area x (see above)
- might be used with an options field in in a customer
master record, etc
example: pop m90(10) process options in mstr 91-100
testing: cmc $popca,'a' process option 'a' set ?
cmn $popba,100 process option 'a' > 100 ?
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
C0a. OPTION CODING RULES
examples: rop=abc2d4e512f1000...x7yz
- Options must be 1 contiguous string with no blanks
(except in quotes).
- Valid options are the 26 lower case letters.
- The letter options may be specified in any sequence.
- Each letter used should only be specified once in the string.
- The option letter may be followed by a numeric value which is often
bit coded for suboptions - a7 includes a1+a2+a4.
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
C1. uvcopy 'rop' - declare uvcopy RUN options
Run options are used to declare options that modify the operation of of the
uvcopy program. Run options (rop) are tested only by the uvcopy program itself
vs user options (uop) which are usually tested by user instructions.
'rop' may be declared in the parameter file, on the command line,
or at the prompt caused if 'rop=q1' is specified in the prmfile.
You may also use 'export UVCOPYROP=...' to override Run options coded in jobs.
a999 |
- start,end,& elapsed time are reported by default if rop a0 (unspcfd)
or if elapsed time > rop a# seconds |
b999 |
- bypass count, number of records to be bypassed on 1st get to
sequential file input (also see option 'c' stop count) |
c999 |
- record process stop count (might be thought of as a 'c'opy count).
- number of records to be processed from sequential file input
before signalling an early EOF. |
d |
- set debug mode; will display each instruction before execution
& allows user to set breakpoints & display areas.
(see complete debug documentation further below) |
d2 |
- diagnostics, verify instructions, but do not execute
- returns non-zero status if errors detected
|
e1 |
- Ebdic input file, translates RDW error data
|
e2 |
- allow re-enter for instruction format errors
- applies only to interactive uvcopy jobs uvfix1/uvfixA
|
g1 |
- enable interupt (usually '^C' or the DELETE key)
- will report current I/O record counts & allow close or continue
- disabled by default since 'uvcopy's within scripts might be zombied
- enable when you run uvcopy from command line by appending ',rop=e1'
|
i1 |
- inhibit startup msg #1 (version, date, prmfile name)
- inhibit startup msg #2 (copyright, rgstrn#, name)
|
i2 |
- inhibit EOJ display start-time, end=time, elapsed-time
|
i4 |
|
i7 |
- inhibit all the above messages
|
i8 |
- inhibit the prompt for ?filename changes
- caused by prefix '?' on fili1=?filename, filo1=?filename, etc
|
i16 |
- inhibit prompt for options & report disposition
- also inhibits user option prompt for option changes (same as uop=q0)
|
i31 |
- inhibit all msgs except prompts for EOF stats & sort status
|
i32 |
- inhibit uvcopy EOF statistics msgs (record counts, etc)
|
i63 |
|
i64 |
- inhibit msg including mssgw wait for reply
|
i127 |
- inhibit all msgs above (dont use unless all coding proven correct)
|
i95 |
- inhibit all msgs except EOF record counts
|
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
C1a. 'rop' - uvcopy RUN options - continued
j99999 |
- instruction storage area, default size is 64,000 bytes which is
room for about 500 instructions & you will need to increase
for big parameter files (allow about 120 bytes per instruction)
- you can wait until you get an error message & then increase it
|
k99999 |
- constant storage pool for instruction constants
- default size is 32,000 may increase if the total of your constants
exceeds this value (will get error message) |
m64 |
- megabytes of memory to be used by internal sort (sxo,sxg,sxs,sxp)
- default 64 megs, no point increasing unless you have files > 6.4 gigs
|
n1 |
- inhibit wait for reply on ALL prompts soliciting operator input
- intended for unattended night shifts
- could append on each "uvcopy xxxx,rop=n1"
- could code 'export UVCOPYROP=n1' at begining of a night shift script
- or put in profile of night shift to inhibit all prompts all scripts
|
q1 |
- causes prompt for 'rop' option changes & additions
- same as for 'uop' (see next page)
- option change prompts inhibited by rop=i16 or uop=i16 (same as uop=q0)
|
r |
- Report Disposition options
|
r1 |
- prompt operator for Report Disposition at End of Job
- operator may enter desired command: vi,cat,more,uvlp12,etc
(or for Windows/DOS: edit,type,more,print,etc) |
r# |
- the digit identifies the output file# to be reported 1-8 (filo1-filo40)
- prompting the operator is the default
- see option 'x' below to specify the desired command with no prompt
|
s0 |
- create packed sign output (op1) same as last input (op2)
(default if option s not declared) |
s1 |
- create packed decimal signs as x'_C' (vs default x'_F')
|
s2 |
- create packed decimal signs as x'_F' (vs default x'_C')
- numeric instrns (mvn,add,etc) may have options s0/s1/s2
which would over-ride the global run options s0/s1/s2 |
Note |
- Micro Focus COBOL requires x'_F' signs for pic 9 comp-3 fields,
but x'_C' signs for pic S9 comp-3 fields.
- this applies to linked programs, '.int's work either way
|
t0 |
- load default ASCII to EBCDIC translate table
neutral (no change) for characters > x'80' |
t1 |
- use codepaage 1141 to translate EBCDIC to ASCII
- may code on the 'tra' instruction (trat1)
- OR export UVCOPYROP=t1
|
t2 |
- loads alternate ASCII to EBCDIC translate table
characters > x'80' translated to EBCDIC blank x'40' |
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
C1b. 'rop' - uvcopy RUN options - continued
u10 |
- no of tables (tbl instructions) max allocated - default is 10
|
u50 |
- may increase as required (each table 360 bytes)
|
v4000 |
- no of table entries in total for all tables - default 4000
|
v8000 |
- may increase as required (each entry only 8 bytes).
|
w1 |
- for the 'dtf' instruction (convert Delimited To Fixed field)
- inhibit removal of control chars < x'20'
when removing trailing blanks in each field |
x |
- Report Disposition Command defaults
|
x1 |
|
x2 |
- 'head' - displays 1st 10 lines of output file
|
x4 |
- 'more' - displays files 1 screen at a time
|
x8 |
- 'cat' - displays entire file on screen (for small files)
|
x16 |
- 'uvlp12' - VU utility/script to laser print at 12 cpi with page hdngs
|
x32 |
- 'uvlp12L' - same but Landscape vs Portrait
|
x64 |
- 'uvlp16' - laser print at 16 cpi (get 120 chars on 8 1/2 wide)
|
y70 |
- set Year2000 window for field type 'y' on sort keys
& also for option 'y' on compare instructions 'cmcy' & 'cmny'
- option 'y' assumes 1st 2 bytes of field is the year (no century)
- 'rop=y70' means that years 70-99 = 1970-1999, 00-69 = 2000-2069
|
z1 |
- option 'z1' specifies sliding windows, for example in 1998
'rop=y70z1' window value would be 98+70 = 168-100 = 68
meaning years 68-99 = 1968-1999, 00-67 = 2000-2067 |
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
C2. uvcopy 'uop' - declare USER run options
User options are assigned & tested by the user only (except options 'q' & 'i').
uop=p2s0 - 'p2' might mean 2 pages of output desired
- 's0' might mean display on screen (vs spool 's1')
--- --- (might test as in following example)
cmn $uopbs,1 - spool or display ?
skp< display
--- ---
Note that user options may be specified in 3 places:
1 - defaults in the parameter file (prior to fili/filo declaration)
uop=q1a1b2c3 - q1 will prompt allowing change to a,b,c
2 - on the command line, for example:
uvcopy prmfilex,uop=q0 - this turns off the prompt
3 - at the prompt caused by the 'q1' option in the prmfile
a1b2c3 - reply just the options you wish to change
Any repeated option letter values will replace preceding values.
uop option 'q'
option 'q1' specified on the 'uop' function causes a prompt at run
initiation time to allow the operator to override the defaults
uop=q1p2s0 - q1 causes oprtr query at run init
- null reply accepts the defaults
Alternatively 'uop=q0' is often specified on the command line to inhibit
the prompt from the 'uop=q1....' line in the parameter file, especially
when the job is being repeated for all files in the directory via the
uvcopyx script. Option change prompts also inhibited by rop=i16 or uop=i16.
uop option 'i'
i1 |
- inhibit startup msg #1 (version, date, prmfile name)
- inhibit startup msg #2 (copyright, rgstrn#, name)
|
i2 |
- inhibit EOJ display start-time, end=time, elapsed-time
|
i4 |
|
i7 |
- inhibit all the above messages
|
i8 |
- inhibit the prompt for ?filename changes
- caused by prefix '?' on fili1=?filename, filo1=?filename, etc
|
i16 |
- inhibit prompt for options & report disposition
- also inhibits user option prompt for option changes (same as uop=q0)
|
i31 |
- inhibit all msgs except prompts for EOF stats & sort status
|
i32 |
- inhibit uvcopy EOF statistics msgs (record counts, etc)
|
i63 |
|
i64 |
- inhibit msg including mssgw wait for reply
|
i127 |
- inhibit all msgs above (dont use unless all coding proven correct)
|
i95 |
- inhibit all msgs except EOF record counts
|
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
C2a. Run options & User options (rop & uop)
export UVCOPYROP - override coded options
You can 'export UVCOPYROP=...' to override any rop=... coded in uvcopy jobs.
If you export UVCOPYROP at the shell prompt it will be effective until you
logoff or export again with different options or "" to reset to null.
example #1 - for debugging
Normally you turn on debug mode by appending 'rop=d' on the uvcopy command line
uvcopy xxxx,rop=d <-- turn on Debug mode for 1 uvcopy job
=================
But, what if you are running a script containing the 'uvcopy xxxx' & you do
not want to have to modify the script & then reset after debugging ?
You can use environmental variable 'UVCOPYROP=d1' to turn on debug mode for
all subsequent uvcopy jobs.
export UVCOPYROP=d <-- set debug mode for all subsequent uvcopy jobs
================== (until logoff or export UVCOPYROP="")
scriptxx.ksh <-- run scripts calling uvcopy jobs
============ - uvcopy jobs will run in debug mode
--> g <-- enter 'g' (debug 'go' command) if 1st uvcopy is not desired job
example #2 - inhibit wait for prompt reply
export UVCOPYROP=n1 <-- inhibits waiting for reply on all prompts
===================
You might use this to inhibit wait for reply for unattended night shifts.
You could insert at begining of a night shift script, OR you could code
in the profile of the night shift login.
Do not code in scripts that could be run by operator, since it is better
to prompt the operator when present (vs night shift no operator check logs).
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
C2b. Run options & User options (rop & uop)
example #3 - turn off various prompts
This is to inhibit prompts for various identified prompts, versus the above
'export UVCOPYROP=n1' which inhibits the wait for ALL prompts.
uvcopy jobs are often written with prompts for filename change/confirm or
option changes/confirm. These may be useful if you are running the job for
one file at a time, but annoying if you are using scripts uvcopyx or uvcopyxx
to repeat the job for all files in the directory.
Filename prompts are caused by coding leading '?' on fili1=?... & filo1=...
within the job & option prompts are caused by coding 'uop=q1...'.
For example 'cobmap1' (convert COBOL copybook to record layout) prompts for
filenames & options. When running cobmap1 for 1 file at a time, you can inhibit
the prompts by coding filenames on the command line & by coding uop=q0.
uvcopy cobmap1,fili1=cpys/copybook1,filo1=maps/cobmap1,uop=q0i7
===============================================================
- coding filenames & uop=q0 inhibits prompts for filenames & options
- coding uop=i7 inhibits the uvcopy info lines (with version etc)
but retains the EOF record count stats (could inhibit all with i63)
To convert all files in the directory you could use script 'uvcopyx' as follows:
uvcopyx cobmap1 cpys maps uop=q0i31
===================================
- coding uop=q0i31 on cmd line inhibits prompts & msgs for all but EOF stats
If you were going to run several 'uvcopyx' scripts & did not want to have to
code 'uop=q0i31' on the commands you could:
#1. export UVCOPYROP=q0i31 <-- turn off uvcopy prompts
====================== (until logoff or export UVCOPYROP="")
#2. uvcopyx cobmap1 cpys maps <-- run multiple uvcopyx scripts with no prompts
=========================
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
C3. uvcopy file typ codes & options
This is a review of the file 'typ' codes detailed in uvcopy1.htm#F3 - F3b
typ=LST |
- Line Sequential file, records Terminated by LFs
|
typ=RSF |
- Record Sequential Fixed records (no LineFeeds)
- mainframe sequential files
|
typ=RST |
- Record Sequential fixed records Terminated by linefeeds
- the LF would be in the last byte of the stated rcsz
(ie - within the record, not outside as for LST) |
typ=RSR |
- Record Sequential Relative (Micro Focus COBOL compatible)
- actual record size is 1 greater than declared
- extra byte x'0A' if valid, x'00' if deleted
|
typ=RUF |
- UNIBOL file type (probably obsolete)
|
typ=DBT |
- DataBase Table for 'uycopy' version of uvcopy created in 2008
to access SQL DataBase/Tables SQLdemo.htm#Part_2. |
typ=RSV |
- Record Sequential Variable files compatible with Micro Focus COBOL
|
typ=ISF - Indexed Sequential Fixed records (D-ISAM for Micro Focus COBOL)
typ=IDXf1 - same as typ=ISF if using 'uvcopy' (vs uxcopy)
- 'uxcopy' uses Micro Focus file handler (vs D-ISAM for uvcopy)
- must use 'uxcopy' for typ=IDXf3 & typ=IDXf8
typ=IDXf3 |
- Indexed Sequential Variable files compatible with Micro Focus
- Indexed files have 2 parts filename.dat & filename.idx
|
typ=IDXf8 |
- Indexed Sequential Variable files compatible with Micro Focus
- Indexed files have 1 part filename.dat (both data & index)
|
typ=RDW |
- 'Record Descriptor Word' variable length files
- 4 byte record prefix with 2 byte binary record size & 2 unused nulls
- option typ=RDWz2 for 2 byte binary only (2 nulls omitted)
- option typ=RDWn4 for 4 byte Numeric digits (vs binary)
|
typ=STL |
- STandard Language file system (used by AIX CBOL)
|
typ=STLs |
- STL Sequential files (input & output)
|
typ=STLi |
- STL Indexed files (input only)
|
typ=STLr |
- STL Relative record files (input only)
|
File typ=STL Indexed & Relative is provided for input files only. You can copy
them to output file types (LSTt,RSF,RST,RSV,RDW,ISF,IDXf1,& STLs Sequential).
See STL examples on page 'F9'
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
C10. uvcopy 'file typ' options
File typ options may be appended to the 3 byte file typ code
- lower case letters a-z with numeric suffixes - for example:
fili1=dat1/vendormas2,rcs=80,typ=LSTb2c2 <-- b2 drop blank lines
#======================================= - c2 convert unprintables to periods
filo1=tmp1/vendormas3,rcs=80,typ=RDWz4 <-- z4 4 byte record-size prefixes
#=====================================
We will discuss the options in groups that apply to each file type. First we will
discuss file types that apply to TEXT files, since they are the most common.
The groups are as follows:
C11. |
file typ=LST... options for text files |
C12. |
file typ=XXX... options for multiple file types |
C13. |
file typ=RDW... options unique to typ=RDW files |
C14. |
file typ=RSV... options unique to typ=RSV/RSR |
C15. |
file typ=ISF... options for Indexed files |
C16. |
file typ=IDX... options for variable Indexed files |
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
C11. file TYP OPTIONS - for group typ=LST
options for file typ=LST... (text files)
c1 |
- convert any unprintable chars to blanks
|
c2 |
- convert any unprintable chars to periods
|
c4 |
|
c8 |
|
c16 |
- minimize remove trailing blanks, nulls, LFs
- c16 minimize set by any LST unless LSTt4 both in/out
|
c32 |
- also blank CR on scanback if c16/0x100000 set
|
c64 |
- getlin1 NEW force stop read on formfeed x'0C'
|
c128 |
- putlin1 determine length by 1st null vs last non-blank
- you are unlikely to need any of c16,c32,c64,c128.
|
d1 |
|
d2 |
|
d4 |
|
d8 |
- delete arg4 (tilde '~')
- d1,d2,d4,d8 not used on fili typ=LST..., only on getd...
|
e1 |
|
e2 |
|
e4 |
|
e8 |
- convert arg4 (tilde '~')
- e1,e2,e4,e8 not used on fili/filo typ=LST..., only on gete...
|
t1 |
- stop read on CR <-- 't' options for Input file typ=LSTt#
|
t2 |
- stop read on LF <-- DEFAULT t2 stop read on LF
|
t4 |
- stop read on LF & save length to write same length on output typ=LSTt4
|
t8 |
|
t1 |
- terminate write with CR <-- 't' options for Output file typ=LSTt#
|
t2 |
- terminate write with LF <-- DEFAULT t2 stop write on LF
|
t4 |
- write same length as input & terminate LF if t4 or CR/LF if t5
|
t8 |
- terminate write with tilde '~'
- used only for output by uvsort/uvcp/uvcopy
- not used on fili typ=LST..., only on gett... for filo
|
- option 'm' only for uvcopy getm#/putm# instrns
m1 - minimize remove trailing blanks,nulls,LFs
m2 - scanback also remove trailing CR x'0D'
m4 - getlin1 NEW uvcopy getm4 FORCE stop read on x'0C'
m8 - putlin1 determine length by strlen vs arg3 reclth
m1-m4 - apply only to uvcopy getm# (not fili_=LST...)
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
C11a. file typ options - for group typ=LST
options for file typ=LST... Examples
fili1=dat1/test100,typ=LST...,rcs=80 #<-- file declare typ=LST...
get file,recordarea[,fillchar][,arg4char]
- fillchar defaults to ' ' space x'20'
- arg4char defaults to '~' tilde x'7E'
get fili1,a0 <-- normal get instruction
gets2 fili1,a0 <-- default option 's2' stop read on LF
filo1=tmp1/test100,typ=LST...,rcs=80 #<-- file declare typ=LST...
put file,recarea,fillchar,arg4(tilde) <-- format
put filo1,b0(80),' ','~' <-- op3,op4 defaults
put filo1,b0(80) <-- normal usage
putt2 filo1,b0(80) <-- default t2 LF terminate
Notes re options for typ=LST...
- You normally need no options for typ=LST, since the defaults are what you
would expect for text files - stop read on LineFeed x'0A' & append LF x'0A'
on output writes (after the last non-blank).
- File typ options (like most Vancouver Utility options) are "binary" and
may be combined. For example, typ=LSTt3 would terminate output records
with both a CR & an LF x'0D' + x'0A' (MSDOS file).
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
C12. options common to multiple file typ groups
C11. |
file typ=LST... options for text files |
C12. |
file typ=XXX... options for multiple file types <-- This page |
C13. |
file typ=RDW... options unique to typ=RDW files |
C14. |
file typ=RSV... options unique to typ=RSV/RSR |
C15. |
file typ=ISF... options for Indexed files |
C16. |
file typ=IDX... options for variable Indexed files |
file typ options applicable to MULTIPLE FILE TYPES
a |
- append to the file's existing contents (vs default erasing existing contents)
|
b1 |
- reduce multi consecutive blank lines to 1 blank line
|
b2 |
|
h1 |
- wait on locked file, retries every 10 seconds until lock released
(when other process closes the file)
- retry time is gradually increased to every 5 minutes after 30 mins
- displays waiting message showing total wait time
- you would use option 'h1' with EXCLUSIVE lock ('l0' or not coded)
- typ=ISFh1l1 would not make sense, since it will never get a lock
- See file lock test results in separate section uvlocks.htm
|
j1 |
- translate filename to lower case (before opening)
|
j2 |
- translate filename to UPPER case (before opening)
|
j4 |
- translate any extension to the opposite case
|
Option 'j' useful when you are processing all files in directory (with uvcopyx)
And you want the output files in a different case than input files.
l_ |
- file locking options for DISAM indexed files
& for UNIX Sequential files as of January 1999
- see more discussion & test/demo's in uvlocks.doc (follows uvcopy5)
|
l0 |
- EXCLUSIVE (default) RDlock+WRlock
- other jobs cannot access, unless they specify READONLY for ISAM
or NO-locking for non-indexed sequential files.
- always use for output files (building new ISAM files).
|
l1 |
- READONLY
- multiple jobs could read same file if all jobs specify RDlock
- open error if another job has opened with WRlock (or Exclusive)
OR use option 'h1' to wait until other jobs with WRlock/Exclock close |
l8 |
- NO locking, used only for Sequential files (not Indexed)
- For non-indexed files, only lock options l0, l1, l8 apply.
|
m# |
- file progress messages every m# records
|
m1000000 |
- default is every million records
|
Note |
- EOF elapsed time stats are reported if > 5 seconds
- no option to change this (as of Oct 2018)
|
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
C12a. options common to multiple file typ groups (continued)
o0 |
- default displays EOF statistics for all file types
|
o1 |
- inhibit the basic EOF stats line for all file types
|
o2 |
- inhibit the 1 line ISAM summary statistics
|
o4 |
- requests the detailed key statistics lines
showing key start,length,type for each key |
n1 |
- inhibit errmsg if data exceeds record length specified for typ=LST
- ie, if LineFeed x'0A' not found before specified rcs=...
- causes over-length records to be split into 2 records.
- better to increase record-size to avoid splitting records
|
p___ |
- permissions to be given to the file when closed
|
p777 |
- would set read,write,execute permission for owner,group,& others
- when omitted, the system defaults apply (umask in /etc/profile)
|
s1 |
- inhibit $filename expansion stopping on a '.' period, for example:
fili1=dat1/sales.txt,rcs=80,typ=LST
filo1=tmp1/$fili1,rcs=80,typ=LSTs1 #<-- note option 's1' on typ=LSTs1
- by default 'tmp1/$fili1' would expand to 'tmp1/sales' ('.txt' dropped)
- typ=LSTs1 inhibits stop on '.', allowing expansion to 'tmp1/sales.txt'
|
u |
- UNIX system file unbuffered (open/read vs fopen/fread)
- required for 9 track tape reads on 2145-03
especially for unlabeled tapes where block size is unknown
(see job t9copy2 in section TAPEjobs.doc) |
w2 |
- Warning prompt if output file exists
- may overwrite, change name, or cancel
|
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
C13. file typ options - group typ=RDW
C11. |
file typ=LST... options for text files |
C12. |
file typ=XXX... options for multiple file types |
C13. |
file typ=RDW... options unique to typ=RDW files <-- This page |
C14. |
file typ=RSV... options unique to typ=RSV/RSR |
C15. |
file typ=ISF... options for Indexed files |
C16. |
file typ=IDX... options for variable Indexed files |
file typ options unique to typ=RDW files
n4 |
- typ=RDW: specifies 4 byte record-size prefix Numeric digits
- vs default binary 2 bytes + 2 bytes null
- also see typ=RDW & options z2/z4/z8
|
t |
- controls record padding & truncation for typ=RDW files
|
t0 |
- typ=RDWt0 - default blank fills
|
t1 |
- typ=RDWt1 - null fills to end of record
|
t2 |
- typ=RDWt2 - scans back to last non-blank or non-null
- to shorten output record |
t3 |
- typ=RDWt3 - same as RDWt2
- since either nulls or blanks are truncated
- RDWt3 might apply to mainframe SORT conversion of OUTREC FIELDS=(1,80,100)
- (1,80,100) missing length from 100,___ means move remainder of var lth record
- would generate uvsort moves "mvco=0(80)0,mvco=80(0)100"
- length (0) causes uvsort to move remainder of var lth record
|
z4 |
- RDW variable length files with 4 byte record prefixes (default)
(typ=RDW defaults to typ=RDWz4)
- 4 byte record prefix with 2 byte binary record size & 2 unused nulls
- record size in prefix is the total record size including the prefix
- 2 byte record size is 'BIG-END' binary (like mainframe or SUN,AIX,DEC)
- 'little-end' machines (Intel,AMD) need to switch ends to perform math
|
z2 |
- option 'z2' for 2 byte prefixes (vs 4 byte default above)
- unusual, but some FTP programs use
|
z8 |
- option 'z8' same as RDWz4, but bypasses any BDW prefixes
|
z1 |
- little-end binary vs default Big-end binary, combine with z2/z4/z8
- z2/z4/z8 Big-end binary (default), specify z3/z5/z9 for little-end binary
|
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
C14. file typ options - group typ=RSV/RSR
C11. |
file typ=LST... options for text files |
C12. |
file typ=XXX... options for multiple file types |
C13. |
file typ=RDW... options unique to typ=RDW files |
C14. |
file typ=RSV... options unique to typ=RSV/RSR <-- This page |
C15. |
file typ=ISF... options for Indexed files |
C16. |
file typ=IDX... options for variable Indexed files |
file typ options unique to typ=RSV & typ=RSR
g_ |
- for typ=IDX/RSV MF COBOL ISAM variable length Indexed/Sequential files
|
g4 |
- get active data records only (default)
|
g2 |
- get deleted data records only
|
g6 |
- get both active & deleted data records
- option 'g' in this uvcp is similar to record display option 'v'
in the uvhd display utility (v1=filehdr,v2=deleted,v4=data,v8=all) |
q8 |
- round up typ=RSV slot size to a nultiple of 8 (vs default 4)
- use with option v (typ=RSVvq8), may be required if recsize >4095
- see option v in alpha sequence below
|
r1 |
- for typ=RSRr1 Relative files (MicroFocus COBOL compatible)
- drop record if extra byte = x'00'
|
v9999 |
- minimum record size option for typ=IDX & typ=RSV files
For example: 'typ=IDXv400,rcs=5000' v400 declares minimum size 400
while rcs=5000 declares the maximum size 5000.
- if option v not specified or specified with no value on typ=IDX or typ=RSV,
all data records will be fixed size rcs=____, but with variable length
record headers. |
v#y4 |
- also see type 'y4' below to determine record size by scanning back
from max size to the last nonblank/nonnull beyond min size |
v#q8 |
- q8 roundup output record size (pad x'20's) to multiple of 8 (vs 4)
- may be required if record size > 4095
|
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
C15. file typ options - group typ=ISF/IDXf1
file typ options - Indexed Files (Fixed-Length)
f# |
|
f1 |
- fixed length Indexed records, compatible with C-ISAM, same as typ=RSF
|
f3 |
- variable length Indexed files (file size < 2 gig)
|
f8 |
- variable length Indexed files (allowing file size > 2 gig)
- IDXf3 & IDXf8 could be fixed records in variable format
|
g_ |
- for typ=IDX/RSV MF COBOL ISAM variable length Indexed/Sequential files
|
g4 |
- get active data records only (default)
|
g2 |
- get deleted data records only
|
g6 |
- get both active & deleted data records
- option 'g' in this uvcp is similar to record display option 'v'
in the uvhd display utility (v1=filehdr,v2=deleted,v4=data,v8=all) |
i# |
- copy ISAM file keys from input fili#
|
i1 |
- coded on the output file type, for example filo1 typ=ISFi1
|
i8 |
would copy ISAM keys from the fili1 previously declared. |
k# |
- key of reference for an ISAM input file
typ=ISFk2 would cause reading in sequence by key #2 |
p# |
- parts in multi-part keyed files
|
l0 |
- EXCLUSIVE (default) RDlock+WRlock
- other jobs cannot access, unless they specify READONLY for ISAM
or NO-locking for non-indexed sequential files.
- always use for output files (building new ISAM files).
|
l1 |
- READONLY
- multiple jobs could read same file if all jobs specify RDlock
- open error if another job has opened with WRlock (or Exclusive)
OR use option 'h1' to wait until other jobs with WRlock/Exclock close |
l2 |
- AUTOLOCK (applies only to ISAM files)
- only 1 record locked at 1 time in this file
- records locked by the 'red' instruction & unlocked by whatever instruction follows
(might be 'upd' to update the record) |
l4 |
- MANULOCK (applies only to ISAM files)
- assumes the programmer will handle locking manually
using the 'lck' uvcopy instruction ('islock' DISAM function)
- Use this option if you want to open 2 paths for the same file
(fili1 & filr1 for the same filename with typ=ISFl4) |
Note |
- You must code 'typ=ISFl4' (MANULOCK) on the ISAM file declaration
to use the locking options on ISAM read & update instructions
('redm5l4' to read key= with lock & 'updl4' to update & release the lock) |
s4 |
- detailed ISAM file key statistics (in addition to record counts)
typ=ISFs4 will display key start byte & length for each key |
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
C16. file typ options - group typ=IDXf#
file typ options - Variable-length INDEXED files
Note |
- you must use 'uxsort' (vs uvsort) to process IDXFORMAT3 & IDXFORMAT8
- options v,x,y apply mostly to uxsort
- but option v might be used with uvsort for file typ=RSV
|
IDXf1 |
- fixed length Indexed records, compatible with C-ISAM, same as typ=RSF
|
IDXf3 |
- variable length Indexed files (file size < 2 gig)
|
IDXf8 |
- variable length Indexed files (allowing file size > 2 gig)
- IDXF3 & IDXf8 could be fixed records in variable format
|
v9999 |
- minimum record size option for typ=IDX & typ=RSV files
For example: 'typ=IDXv400,rcs=5000' v400 declares minimum size 400
while rcs=5000 declares the maximum size 5000.
- if option v not specified or specified with no value on typ=IDX or typ=RSV,
all data records will be fixed size rcs=____, but with variable length
record headers. |
v#y4 |
- also see type 'y4' below to determine record size by scanning back
from max size to the last nonblank/nonnull beyond min size |
v#q8 |
- q8 roundup output record size (pad x'20's) to multiple of 8 (vs 4)
- may be required if record size > 4095
|
y |
|
y1 |
- Fixed Length records, all records forced to size spcfd by rcs=____
- default for if option 'v' NOT specified (w or w/o min recsize)
|
y2 |
- Variable Length records
- default if option 'v' IS specified (w or w/o min recsize value)
- min recsize specified by option 'v', max recsize by rcs=____
|
y4 |
- determine the record size for each record by scanning back from
max size to last non-blank or non-null beyond the min size |
y8 |
- fixed length records in variable length format
- in case you want to copy a variable length file & output all records
as the max size specified on rcs=___ (but in variable length format |
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
D0. uvcopy INSTRUCTION options - 3 kinds
- instruction options - that may be coded on any instruction
- instruction options - that apply to 'repeatable' instructions
- instruction options - that apply to various individual instructions
D1. INSTRUCTION OPTIONS - that may be coded on any instruction
These options are common to multiple instructions & are handled by the
instruction processor (not by the instruction itself).
o_ |
- specify options for the current instruction, specified elsewhere,
in addition to any options declared on the instruction itself.
- o1...o9 options have lower priority & may be overridden by options
coded on directly on the instruction (following the o1/o9). |
o1 |
- would invoke the instrn options previously stored in
alternate instruction storage area #1 (of areas 0-9)
- allows you to setup options desired via operator queries at begin job
ex: the scan/rep jobs in SCANjobs & REPjobs use this to allow the
operator choice of scan by pattern or not (scno1 becomes scnp or scnn) |
u1 |
- update the op1 register after execution of current instruction
- adds the length of op1 to the op1 register (if any coded)
|
u2 |
- update the op2 register after execution of current instruction
- adds the length of op2 to the op2 register (if any coded)
|
u4 |
- if op1 displacement is indexed, shorten op1 length by op1 displacement
register contents to stay within the op1 area |
u8 |
- if op2 displacement is indexed, shorten op2 length by op2 displacement
register contents to stay within the op1 area |
z1 |
- clear the op1 register (if any) before execution of instruction
|
z2 |
- clear the op2 register (if any) before execution of instruction
|
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
D1a. examples of using options applicable to any instruction
mvuz3a2 bx0(80),ay0,' pic ' - move a to b until we find ' pic '
- option z3 clears rgstrs x & y
before the move begins
- z3 means z1 (op1) + z2 (op2)
- on completion x will hold the displacement
of ' pic ' or 80 if not found
- option a2 updates the op2 rgstr (y)
to point beyond the found pattern ' pic '
mvcu1 bx0(9),' picture ' - replaces ' pic ' with ' picture '
- option u1 updates the op1 rgstr (x)
with the op1 length (adds 9)
mvc bx0(80),ay0 - completes the move of a to b
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
D2. uvcopy INSTRUCTION OPTIONS - that apply to numeric instructions
The options described below apply only to the following instructions:
mvn,add,sub,mpy,div,pac,unp,edt,vnf
x99 |
- repeat option (multiple executions)
- the instruction will be repeated the specified number of times
incrementing the operands by the op1 & op2 lengths specified
- to perform operations on multiple same size contiguous fields
with 1 instruction (add multiple corresponding, crossfoot, etc) |
x99 |
- also applies to anc,orc,xor,shf
|
d1 |
- convert invalid digits to '0' zeros
- applies to numeric instructions with operands of type 'z' (zoned)
|
j0/j9 |
- optional with the 'repeat' option
- changes the op1 increment from the default (op1 length) to
whatever is specified on this 'j' option
- would specify j0 to crossfoot multi op2 fields into 1 op1 field
- would specify j(2*fieldlength) to process every other field (etc)
|
k0/k9 |
- optional with the 'repeat' option
- changes the op2 increment from the default (op2 length) to
whatever is specified on this 'k' option
- would specify k0 to move or add 1 op2 value into multiple op1 fields
- would specify k(2*fieldlength) to process every other field (etc)
|
c1/c2 |
- clear left nibble/right nibble on field type 'k' (Burroughs comp)
- type 'k' fields may start on 1/2 byte boundaries
- c1 zeros the left nibble, c2 removes the right nibble, c3 both
- intended for use on op2 to create unpacked output byte aligned
|
s2 |
- store packed decimal signs as x'_F' (vs default x'_C')
- all numeric instrns (mvn,add,sub,mpy,div,etc) have this option
- if you want x'_F' signs generated for all packed fields, specify
run option rop=s2 to save coding option s2 on all numeric instrns |
Note |
- Micro Focus COBOL requires x'_F' signs for pic 9 comp-3 fields,
but x'_C' signs for pic S9 comp-3 fields.
- this applies to linked programs, '.int's work either way
|
anc,orc,xor,shf
x99 |
- repeat option also applies to anc,orc,xor,& shf
- the instruction will be repeated the specified number of times
incrementing the operands by the op1 & op2 lengths specified
- to perform operations on multiple same size contiguous fields
- options 'j' & 'k' could be used with anc,orc,xor,shf (but unlikely)
|
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
D2a. uvcopy INSTRUCTION OPTIONS - that apply to numeric instructions
examples of options for numeric instructions
addx12 b160(5p),a100(5p) - adds the 12 5 byte packed fields in a101-160
to the 12 5 byte packed fields in b161-120
addx36i0 b0(4b),a000(5p) - adds the 36 5 byte packed fields in a101-280
to the 4 byte binary field in work area b0(4b)
- the 'i0' option prevents op1 from being
incremented, to get the cross-foot effect
addx12j10 b40(5p),a100(5p) - adds to the 12 x 5 byte packed fields b41-b100
from every 2nd 5 byte field in 101-220
- option 'j10' causes op2 to be incremented
by 10 vs the op2 length of 5
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
D3. uvcopy INSTRUCTION OPTIONS - for various individual instructions
a_ cat__ |
- concatenate op2 data onto op1 data
|
a1 cata1 |
- insert 1 blank after op2 appended onto op1
|
a2 cata2 |
- insert 1 LF after op2 appended onto op1
|
a4 cata4 |
- insert a 2nd LF after op2 appended onto op1
|
a8 cata8 |
- insert a NULL after op2 appended onto op1
|
a1 edta1 |
- left adjust edited output in op1 area
|
a_ mvu__ |
- move op2 data tp op1 until op3 data pattern detected
|
a1 mvua1 |
- add the search data length to the op1 register
|
a2 mvua2 |
- add the search data length to the op2 register
|
a4 mvua4 |
- add the search data onto op1
|
a1 scna1 |
- add the scan length to any explicitly coded register in op1
|
a_ rep__ |
- replace a specified search data pattern with an alternate
|
a1 repa1 |
- allow for 1 leading blank in search patterns
- to avoid non-matches at the begining of the search area
|
a2 repa2 |
- allow adjacent data patterns with 1 leading & 1 trailing blank
- adjacent patterns following 1st match would otherwise be missed
|
a_ rpt__ |
- replace data via a table of search/replace patterns
|
a1 rpta1 |
- allow for 1 leading blank in search patterns
|
a2 rpta2 |
- allow adjacent data patterns with 1 leading & 1 trailing blank
|
a_ rts__ |
- search a table replacing 1 string with an alternate
|
a1 rtsa1 |
- allow for 1 leading blank in search patterns
|
a2 rtsa2 |
- allow adjacent data patterns with 1 leading & 1 trailing blank
|
a vhx |
- convert to vertical hexadecimal (characters, zones, digits)
|
a vhxa1 |
- translate characters from EBCDIC to ASCII before replacing
un-printables with periods |
b_ msgb_ |
- blank the op1 message area after displaying the message
- use only when op1 is a data area (not when a constant)
|
b_ cat__ |
- concatenate op2 data onto op1 data
|
b1 catb1 |
- insert 1 blank before op2 appended onto op1
|
b2 catb2 |
- insert 1 LF before op2 appended onto op1
|
b4 catb4 |
- insert a 2nd LF before op2 appended onto op1
|
b8 catb8 |
- insert a NULL before op2 appended onto op1
|
b_ putb_ |
- blank record area after put
|
b1 putb1 |
- clear record area to nulls all x'00's
|
b2 putb2 |
- clear record area to blanks (same as b with no digit)
|
b_ relb# |
- set file ptr to relative byte# within the file
|
b scnb |
- inhibit multi-blank bypass
- multi-blank bypass speeds up various search/replace instructions
- also applies to: scn, sct, sts, rep, sst, tts, rpt, rts
|
warning |
- you must specify option 'b' when scanning for 1 or more
blanks or when the pattern is preceded by more than 1 blank |
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
D3a. INSTRUCTION OPTIONS - for various individual instructions (continued)
b sctb |
- inhibit multi-blank bypass on scan an area by table of patterns
|
b stsb |
- inhibit multi-blank bypass on scan a table by a table of patterns
|
b repb |
- inhibit multi-blank bypass on replace 1 pattern by 1 alternate
|
b rptb |
- inhibit multi-blank bypass on replace by table of pattern pairs
|
b rtsb |
- inhibit multi-blank bypass on replaces in data table by pat table
|
b_ rtb__ |
- read lines from a file & store to a table
- drop any blank lines (don't store in the table)
|
b_ wtb |
- write lines from a table to a file
- drop any blank lines (don't write to the file)
|
b_ fix |
- create fixed fields from delimited string
- insert 1 blank before data in each fixed field
- insert 1 blank after data in each fixed field
- insert 1 blank before & after data in each fixed field
|
b_ var |
- create variable length delimited string from multiple fixed fields
- scan backward to remove any trailing blanks from each field
|
c_ cat |
- concatenate op2 nonblank data onto op1 nonblank data
- scans op1 area backward to last nonblank & appends op2 data
- also scans op2 area forward to 1st nonblank
before appending to op1 data |
c_ msgwa1c |
- 'c' option will inhibit the prompt/reply if arg1 was
specified on the command line |
c1 getc1 |
- convert any unprintable chars to blanks
|
c2 getc2 |
- convert any unprintable chars to periods
|
c4 getc4 |
|
c8 getc8 |
|
c1 putc1 |
- convert any unprintable chars to blanks
|
c2 putc2 |
- convert any unprintable chars to periods
|
c4 putc4 |
|
c8 putc8 |
|
c rtb |
- read a table file into memory
- drop any comment lines ('#' in col 1 & ' ' blank in col 2)
- don't load the comment lines into the memory table
|
c_ rep |
- replace 1 pattern with an alternate in 1 area
|
c_ repc1 |
- replace only if the match begins in the 1st column of data
|
c_ rptc1 |
- replace using table of multi pats/alts (only if match in col 1)
|
c_ rtsc1 |
- replace in data table 1 pat with 1 alt (only if match in col 1)
|
c_ sctc1 |
- search area using a table of multi-pats (only if match in col 1)
|
c_ mvnc_ |
- packed field 1/2 byte field alignment for Burroughs COBOL comp-3
- this is uvcopy field type 'k' (vs field type 'p')
|
c1 mvnc1 |
- field starts in low order nibble of 1st byte
|
c2 mvnc2 |
- field ends in high order nibble of last byte
- also applies to: add, sub, mpy, div, pac, edt
|
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
D3b. INSTRUCTION OPTIONS - for various individual instructions (continued)
d1 getd1 |
|
d2 getd2 |
|
d4 getd4 |
|
d8 getd8 |
|
d_ rtbd |
- display data while reading a file into a table
|
d_ wtbd |
- display data while writing a table to a file
|
d scnd |
- allow ';' in search pattern to match any 1 of: a blank,
period, comma, semicolon,or right paren - to prevent unintended
matches to a pattern that could be part of longer words.
- also applies to: sct, sts, rep, sst, tts, rpt, rts, mvu
|
d scnd |
- (d as above) scan op1 for the op2 pattern
|
d sctd |
- (d as above) scan op1 using a table of multiple patterns
- the ';' can occur in any entry of the table
|
d stsd |
- (d as above) scan a table for match to the op2 pattern
|
d repd |
- (d as above) search 1 area replacing 1 pattern with an alternate
- ';' in replacement will be replaced by actual character present.
|
d rptd |
- (d as above) search 1 area replacing by table of multi-patterns
|
d rtsd |
- (d as above) search a table replacing 1 pattern with alternate
|
d mvud |
- (d as above) move op2 to op1 until op3 pattern detected
|
d srt |
- internal sort (tables, record arrays, etc)
|
d1 srtd1 |
- drop duplicate entries except 1st of a set
|
d2 srtd2 |
- drop duplicate entries except last of a set
|
d_ sqf |
- squeeze blank fields from multiple contiguous same size fields
|
d1 sqfd1 |
- d1 option removes duplicate non-blank fields
|
e1 gete1 |
- convert CR's to blanks (DEFAULT)
|
e2 gete2 |
|
e4 gete4 |
- convert arg4 chars to blanks
|
e8 gete8 |
- convert NULL's to blanks
- applies only to file typ 'LST' (text files with LFs)
|
e1 mvue1 |
- update the rgstr explicitly coded in op1 (vs store in rgstr x)
|
e2 mvue2 |
- update the rgstr explicitly coded in op2 (vs store in rgstr y)
|
Note |
- 'mvu' always 'stores' move length in rgstr x (for op1) & y (for op2)
|
Note |
- options 'e1/e2' update (add) to any existing value in any explicitly
coded registers in op1/op2 |
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
D3c. INSTRUCTION OPTIONS - for various individual instructions (continued)
e1 opne1 |
- do not end the job if the open fails (default)
- but return with cc set < (vs = if ok)
|
e rtbe |
- exclude the end of table marker when reading a file into memory
(normally '~~' is stored in col 1&2 of the last table entry)
- Note that any existing '~~' entry at the end of the table is
not stored & that the '~~' entry will be generated by default
unless you specify option 'e' to exclude |
e1 scne1 |
- update any explicitly coded register in op1
|
Note |
- 'scn' always 'stores' the scan length in rgstr x
- option 'e1' updates ie 'adds' to any existing value in any explicitly
coded register in op1 |
e wtbe |
- excludes the end of table marker from being written to a file
when writing a table from memory to an output file |
e_ sete_ |
- error message & wait for operator reply (set, red, wrt, upd)
|
e1 sete1 |
- errmsg if set/red/wrt/upd instructions fails (for specified key)
|
e2 sete2 |
- also wait for reply (null to continue, or interupt to kill job)
|
e3 sete3 |
- options e1/e3 can save testing condition code after set,red,wrt,upd.
|
e ...e_ |
- also apply to: red, wrt, upd
|
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
D3d. INSTRUCTION OPTIONS - for various individual instructions (continued)
f sqzf |
- squeeze first byte of op1 if = op2 squeeze byte
(vs reducing leading sqz bytes to 1 as between words) |
f# sxof# |
- no of sort work files for uvsort (default 32)
- sets max no of sortwork files to 50
- defaults to 100 (the max) as of May 2003
|
f_ repf_ |
- inspect op1 data replacing any matches to op2 with op3
- option 'f' modifies the fixed/default op3 length specified
|
f1 repf1 |
- length of replacing data (op3) determined by first NULL
- often used for filename replacements ($fili1, etc)
|
f2 repf2 |
- length of replacing data (op3) determined by first TILDE
|
f4 repf4 |
- length of replacing data (op3) determined LAST NON-BLANK
|
f7 repf7 |
- 'f7' (1+2+4) would search for all 3 situations in that order
|
f_ rts |
- search/replace table entries within specified columns
|
f_ rtsf_ |
- option f same as for 'repf' above
|
f_ trl |
|
f1 trlf1 |
- translate to lower, then translate 1st char of each word to UPPER
|
f_ var |
- create variable length delimited string from multiple fixed fields
- scan forward to remove any leading blanks from each field
|
g ...g1 |
- length of scan pattern (op2) will be determined by first NULL
- length of scan pattern (op2) will be determined by first TILDE
- length of scan pattern (op2) will be determined by last non-blank
- 'g7' (1+2+4) would test for all 3 situations in order listed above
(null/tilde in 1st byte or all blanks would be nomatch) |
g_ scng_ |
- (g as above) scan op1 area for a match to the op2 pattern
|
g_ repg_ |
- (g as above) scan op1 replacing any matches to op2 with op3
|
g_ stsg_ |
- (g as above) scan table entries for a specified pattern
|
g_ rtsg_ |
- (g as above) scan table entries replacing 1 pattern with alternate
|
g_ insg_ |
- (g as above) insert op2 into op1
|
g_ cntg_ |
- (g as above) count op2 pattern in op1 area
|
h lodh |
- translate table entry hex representation to true hex
as data is being loaded into memory |
h scnh1 |
- inhibit scan if 1st byte of the op2 pattern is a tilde
|
h1 scnh1 |
- return with condition code > (not equal)
|
h2 scnh2 |
- return with condition code = (equal)
|
h scth1 |
- inhibit scan if 1st byte of 1st entry in table is a tilde
|
h1 scnh1 |
- return with condition code > (not equal)
|
h2 scth2 |
- return with condition code = (equal)
|
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
D3e. INSTRUCTION OPTIONS - for various individual instructions (continued)
i scni |
- case insensetive to the scan op2 data pattern
- translates op1 to all lower case (in working storage)
so you should code your op2 (usually a constant)
in lower case |
i scti |
- case insensetive to the sct op2 table data patterns
- you must code your table patterns in all lower case
|
i tsti# |
- increment for op1 data search
- defaults to 'l' (see below) which defaults to 1
|
i dati# |
- input format for date conversion instruction
i1=calendar(yyyymmdd), i2=julian(yyyyjjj), i4=days-since-1900 |
i mvni1 |
- inhibit sign test for zoned numeric fields
- mvn selects & right adjusts only the numeric digits
but normally allows for signs in the zones of the units digit
- for example if area a contains 'occurs 20 times'
mvn $ca1,a7(4) - would load 205- into $ca1
mvnt1 $ca1,a7(4) - would load 20 into $ca1
- also note that the negative sign test is on the x'40' bit to
allow it to work for data generated for either Microfocus
cobol (x'70' neg) or MBP cobol (x'40' neg) |
i mvni2 |
- inhibit '-' sign recognition
- inhibit recognition of both '-'signs & zoned signs
- options i1 & i2 apply to all numeric instructions
(add, sub, mpy, div, edt, xft, etc) |
note |
- option 'i' on mvn was option 't' prior to April 2003
- changed because option 't' used on tbl which affected sign pickup
|
j |
- op1 increment override for repeatable instructions
- used with 'x' option (for mvn,add,sub,mpy,div,edt,etc)
|
k |
- op2 increment override for repeatable instructions
- used with 'x' option (for mvn,add,sub,mpy,div,edt,etc)
|
k setk# |
- select key# in an ISAM file
|
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
D3f. INSTRUCTION OPTIONS - for various individual instructions (continued)
l msgl# |
- extra line spacing for messages (also see option t after op2)
- insert 1 blank after op1 msg & before op2 msg (if any)
- insert 1 LF after op1 msg & before op2 msg (if any)
- insert 2nd LF after op1 msg & before op2 msg (if any)
- insert 1 LF before op1 msg (space before)
|
l putl? |
- (for typ=LST files - Line sequential or text files)
- inhibit writing linefeed [LF] at end of record
- allow LineFeeds in data (don't stop writing on 1st LF)
- allows writing multiple text lines with 1 put
|
l set |
- set file ptr in the op1 ISAM file to the op2 key
- set file ptr based on the # of bytes vs full key
|
l tstl# |
- test subfields of # bytes long (vs default 1 byte)
- also see option 'i' for op1 data search increment
(defaults to 'l' but may be specified separately) |
m anc |
- 'and' each op1 byte with the 1st (only) byte in op2
- op2 mask is multi-bytes (vs default of 1 byte)
|
m1 getm1 |
- minimize by remove trailing blanks & nulls
|
m1 putm1 |
- minimize record by removing trailing blanks/nulls
- usually invoked by option 't' on the file type (typ=LSTt)
|
m mvum |
- multiple 1 byte search patterns (vs 1 multi-byte pattern)
|
m orc |
- 'or' each op1 byte with the 1st (only) byte in op2
- op2 mask is multi-bytes (vs default of 1 byte)
|
m setm# |
- set file ptr mode in an ISAM file
- # is a code indicating begin file, end file, => key, etc
(or may use condition codes set=> for keys)
- see details in instruction guide (part 2 of uvcopy doc)
|
m redm# |
- set file ptr mode & read a record in an ISAM file
|
m rptm1 |
- replace only the 1st match found (vs all matches)
|
m rtsm1 |
- replace only the 1st match found (vs all matches)
|
m rtbm1 |
- read table into memory from a file
- only 1 end-of-table marker required (vs 2 default ~~)
|
m sxo |
- open (initialize) the sort facility
- request 4000k (4 meg) of memory for the sort
(vs the default of 2000k) |
m wtbm1 |
- write table to a file from memory
- only 1 end-of-table marker required (vs 2 default ~~)
|
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
D3g. INSTRUCTION OPTIONS - for various individual instructions (continued)
n putn |
- inhibit output if op2 rec area all blank
|
n scn |
- normally scans for the 1st occurrence of the spcfd pattern
- option 'n' may specify the occurrence number desired
- would scan for the 3rd occurrence of the specified pattern
|
n stsn# |
- (n option same as for 'scn' above)
- search table entries for a specified pattern
|
n srt |
- internal table entry sort
- (default) number of entries determined only by the op3 count
|
n srtn1 |
- number of entries determined by the 1st entry encountered
with '~~' in 1st 2 bytes |
n srtn2 |
- tilde fill the entry at the end of the table (before sorting)
- use with option 'n1' (ie n3) when sort key does not begin in 1st
byte of each entry & when option 't' is used to sort blanks high |
_ wtb |
- write table entries out to a file
|
n wtbn1 |
- generate sequence# in cols 1-4, space in col 5,& shift data
over to begin in column 6 in output records
- operand 5 may specify a starting sequence# (default 1)
|
o |
- alternate option storage (o1 specifies $iopo1 special area)
- allowed on all instructions (see begining this sub-section)
- any options following o_ option overrides matching o_ options
|
c/n/j datcn |
- date conversion instruction (ex: datcn calendar to numberofdays)
c=calendar(yyyymmdd), j=julian(yyyyjjj), n=days-since-1900
- prior to 1998, dat used o1/o2/o4 to specify c/j/n
|
p ...p |
- activate pattern match characters in the op2 search pattern
(@ = any alpha, # = any numeric, etc - see sub-section G1)
- (p as above) scan 1 area for 1 pattern
- (p as above) scan 1 area using a table of multiple patterns
- (p as above) scan 1 area replacing 1 pattern with 1 alternate
- (p as above) move op2 to op1 until op3 pattern detected
- (p as above) compare op1 to op2 (fixed length, no scan)
- (p as above) scan a table for 1 pattern
- (p as above) scan a table replacing 1 pattern with 1 alternate
|
p# |
- inhibit pattern match for 1st # bytes (use direct compare)
- ex: scnp1 a0(80),'##' scans for actual '#' followed by any digit 0-9
|
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
D3h. INSTRUCTION OPTIONS - for various individual instructions (continued)
q1 ...q1 |
- inhibit detection of search pattern in single quotes
|
q2 ...q2 |
- inhibit detection of search pattern in double quotes
|
q3 ...q3 |
- inhibit detection of search pattern in single or double quotes
|
fixq_ (q_ as above) fix fields specified bytes apart based on pattern
mvuq_ (q_ as above) move until the op3 pattern is detected
repq_ (q_ as above) search op1 replacing op2 with op3
rptq_ (q_ as above) search op1 replacing using a table of patterns
rtsq_ (q_ as above) search a table replacing 1 pattern with 1 alternate
scnq_ (q_ as above) scan op1 area for 1st match to op2 pattern
sctq_ (q_ as above) scan op1 for 1st match to a table of patterns
stsq_ (q_ as above) scan a table for 1st match to op2 pattern
trlq_ (q_ as above) translate to lower case
truq_ (q_ as above) translate to UPPER case
r scnr |
- scan op1 from right to left (vs left to right default)
|
r sqzr |
- squeeze right (vs the default squeeze left)
|
s_ gets_ |
- stop read options for typ=LST files
|
s1 gets1 |
|
s2 gets2 |
- stop read on LF (DEFAULT)
|
s4 gets4 |
|
s8 gets8 |
|
s_ puts_ |
- stop write options for typ=LST files
|
s1 puts1 |
|
s2 puts2 |
- stop write on LF (DEFAULT)
|
s4 puts4 |
|
s8 puts8 |
|
s reps |
- allow special pattern match characters in replacement data
example - rep b0(80),'@#@#@#','@#@ - #@#'
- inserts constants within data patterns
this inserts ' - ' in CDN postal codes: V5P3V8 to V5P - 3V8 |
s rpts |
- allow special pattern match characters in replacement data
example: ###-###-~~~~~~~~(###) ###-~~~~~~
- this would convert tel#s from AAA-XXX-NNNN to (AAA) XXX-NNNN
|
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
D3i. INSTRUCTION OPTIONS - for various individual instructions (continued)
s mvn |
- same as mvns0 (unspecified defaults to s0)
|
s mvns0 |
- create packed sign output (op1) same as last input (op2)
also validate and if not C/F, create as x'_C' |
s mvns1 |
- create packed decimal signs as x'_C' (vs default x'_F')
|
s mvns2 |
- create packed decimal signs as x'_F' (vs default x'_C')
|
s mvns4 |
- same as 's0' (copy output sign from last input)
but validation will create as x'_F' if invalid (not C/F) |
s mvns8 |
- leave packed sign as is (may be invalid)
|
s mvns16 |
- inhibit storing input sign on this instruction
for use on next output (on this or next instruction) |
Note |
- all numeric instrns (mvn,add,etc) have these options
- Also see the global 'run options' (rop=s0/s1/s2/s4)
- these instruction options s0/s1/s2/s4 over-ride run options
- Micro Focus COBOL requires x'_F' signs for pic 9 comp-3 fields,
but x'_C' signs for pic S9 comp-3 fields.
- this applies to linked programs, '.int's work either way
|
s pac |
- for sign control in zone of units digit
- default switches zone & digit with no test/conversion
- if x'4_' bit present, set sign to x'_D', else x'_C'
- if x'4_' bit present, set sign to x'_D', else x'_F'
- OK MF & MBP since both have x'40' bit (MF x'70', MBP x'40')
|
s unp |
- for sign control in zone of units digit
- default switches zone & digit with no test/conversion
- if x'_D' set zone to x'4_', else set zone to x'3_' (MBP COBOL)
- if x'_D' set zone to x'7_', else set zone to x'3_' (Micro Focus)
|
t env |
- get the environmental variable specified by op2
into op1 which is blank filled by default
- null terminate the value stored in op1
|
t evt |
- get & table all environmental variables into the op1 area
each entry having the length defined by op2
- null terminate each entry
- follow last valid entry with an entry of all tildes '~'s
|
t_ gett_ |
- terminate options for file typ=LST
- inserts terminator when storing record in memory
|
t0 get |
|
t1 gett1 |
|
t2 gett2 |
|
t4 gett4 |
|
t8 gett8 |
|
t_ putt_ |
- terminate options for writing file typ=LST
|
t1 putt1 |
|
t2 putt2 |
- terminate with LF
- default for UNIX (& WinDOS), if no option d on file type
|
t4 putt4 |
|
t8 putt8 |
- terminate with stopc char
|
Note |
- don't confuse option 't' on put with option 't' on file typ=LSTt
- option t on LSTt truncates trailing blanks (same as option m1 on putm1)
|
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
D3j. INSTRUCTION OPTIONS - for various individual instructions (continued)
t msgt |
- terminates op1 & op2 msg parts as follows (also see msgl option)
- appends 1 blank to msg data
- appends 1 an extra LF to msg data (double space)
- inhibit the default 1 LF at end of msg data
- inhibit the default NULL at end of msg data
|
t mvf |
- move op2 data to op1 area for length of op1
& then fill any remaining op1 area with the op3 fill character
- then fill op1 area backwards until last nonblank reached
- null terminate op1 in the last byte with x'00'
|
t srt |
- internal sort (tables, record arrays, etc)
|
t srt |
- default will sort blank keys low & not truncate the table
|
t srtt1 |
- sort blank keys high - by inserting '~' in 1st byte of key
which is then removed after all entries sorted |
t srtt2 |
- inhibit removal of '~' in 1st byte of keys (at end of sort)
- code as 't3' (t1+t2) - t3 would be unusual ??
- The only codes that make normal sense are 't1' or 't7'
|
t srtt4 |
- convert the blank (or '~' in 1st byte of key) entries
to tilde filled entries (effectively shortening the table)
- other instructions such as 'wtb' (write out table)
are terminated by the 1st entry with '~~' in 1st 2 bytes
- code as 't7' (t4+t2+t1)
|
t1 vnft3 |
- option 't1' (of vnft3) may be coded on 1st vnf in uvcopy job
- to initialize area t & register t to build the field error report
|
t2 vnft2 |
- option 't2' acumulates errors in area 't' for dump at EOJ
|
u |
- applies to all instructions
|
u1 |
- update the op1 register by op1 length after executing instruction
|
u2 |
- update the op2 register by op2 length after executing instruction
|
u4 |
- shorten op1 length by op1 dsplcmnt register to stay within op1 area
|
u8 |
- shorten op2 length by op2 dsplcmnt register to stay within op1 area
|
v1 mvfv1 |
- expand any $symbols while moving op2 to op1
|
v1 msgv1 |
- expand any $symbols before displaying output
|
v1 repv1 |
- expand any $symbols while replacing op2/op3 patterns
|
v1 rtsv1 |
- expand any $symbols while replacing op3/op4 patterns
|
v1 sysv1 |
- expand any $symbols before executing system command
|
Note |
- option v1 implemented in June/99 on msg,mvf,rep,rts,sys
- operand area must be large enough to hold expanded values
- $symbol expansion also includes counters $ca## & registers $r_
|
Note |
- ${symbols} expanded on all functions and instructions
as of November 2002. Prior to Nov2002 ${symbols} were expanded
only on msg,mvf,rep,rts,sys instructions if option v2 present. |
v sxo |
- open the sort
- inhibit the verbose option of the sort
default displays % complete on merge phase
but only if more than 1 pass required |
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
D3k. INSTRUCTION OPTIONS - for various individual instructions (continued)
v lodv1 |
- expand uvcopy $symbols ($jobname, $date, $time, etc)
in the data being loaded (until '~~' end of data marker reached)
- expand UNIX env-var ${symbols}, ${LOGNAME}, ${HOME}, etc
- expand both uvcopy $symbols & UNIX env-var ${symbols}
- note that ${symbols} are always expanded on functions & instructions
but option v2 is required to expand in the data loaded by 'lodv2'. |
w cmc |
- compare character
- modify window default (50) for the 'y' option (see below)
- window 30 means years 30-99=19xx, years 00-29=20xx
|
w cmn |
- compare numeric
- modify window default (same as for cmcw)
|
w msgw |
- wait for operator reply to message
|
w scn |
- scan op1 for the op2 pattern
- default scans the entire op1 area for the op2 pattern
- match only on the 1st word (or part of) encountered
- words counted by 1 leading blank + non-blank
- would match only on or within the 2nd word in op1
- could use 'w0' if you knew 1st byte of op1 were non-blank
|
w1 sysw1 |
- redirect sys output to file for readback to workareas
- store 9 lines max in w1000(100),w2000(100),...,w9000(100)
- isolate 9 words for each line w1100(100),w1200(100),...,w1900(100)
|
w2 sysw3 |
- convert 1st line words w1100-w1900 to counters $ci1-$ci9
- numerics in word1 w1100(100) converted to ctr $ci1
- numerics in word2 w1200(100) converted to ctr $ci2, etc
|
x |
- applies to repeatable instructions (mvn,add,sub,mpy,div,edt)
- see more detail at begin this sub-section.
|
y cmc |
- compare character
- year 2000 windowed compare for date fields (2,3,4,5,or 6 bytes)
- assumes 1st 2 bytes are the year (without century)
- default window is 50 meaning: 50-99 = 19xx, 00-49 = 20xx
|
y cmn |
- compare numeric
- year 2000 windowed compare for date fields (6 digit values only)
- assumes 1st 2 digits are the year (without century)
- default window is 50 meaning: 50-99 = 19xx, 00-49 = 20xx
|
y msgwy |
- force a y/n response from the operator
|
z1/z2 |
- clear op1/op2 registers before instruction executed
- applies to any instruction
- see more detail at begin this sub-section.
|
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
E1. uvcopy ALTERNATE INSTRUCTION OPTIONS
$iopo0 = x2000(20) - alternate instruction option storage 'o0'
$iopo1 = x2020(20) - alternate instruction option storage 'o1'
... etc ...
$iopo9 = x2180(20) - alternate instruction option storage 'o9'
Note |
- As an example of how alternate instruction options might be used
please see the 'scan1' job in section SCANjobs.doc and find the
following code at startup time & within the get/put loop |
msgwy 'activate special pattern match characters y/n ?'
cmc $reply(1),'y' user requests pat mat chars ?
skp! 1
mvc $iopo1(1),'p' yes - store option 'p' for 'scn'
loop get fili1,a0(256) get next record
skp> eof
scno1 a0(256),d0($rn80) record match to search data ?
skp! loop no - return to get next record
put filo1,a0(256) yes - output matched records
skp loop return to get next record
Note |
- normally if we wanted to scan the record with the 'pattern' match
option active, we would simply write: |
scnp a0(256),d0($rn80) record match to search data ?
- however in this case, we want to let the operator decide at run time
whether to invoke pattern match or not & the 'o1' option on the 'scn'
instruction tells the instruction processor to use the options in
alternate instruction option area #1 rather than any options coded
on the instruction itself
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
F1. uvcopy user PROCESS options
Process options are assigned entirely by the user.
Process options are created by the 'pop' instruction.
Sorts & converts the option string in op1 into process option storage
in area 'x' (see work area x layout).
'pop' might be used to process option strings designed into your records
(customer options,etc) - example follows:
pop a80(20) - sort & convert option string in 81-100
of area a (customer master record)
into the process option w/s in area x
cmc $popcb,'b' - test character option b present ?
skp= balfwd - might be 'b'alance forward vs open item
cmn $popbi,60 - test binary option i (interest days)
skp> intcalc
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
G1. uvcopy PATTERN MATCH CHARACTERS & option 'p'
Option 'p' may be specified on the following instructions to activate
pattern match characters in the search patterns.
scnp op1,'search-pattern'
repp op1,'search-pattern','replacement'
mvup op1,op2,'search-pattern'
The pattern match characters may occur anywhere in the search-pattern.
@ - any alpha (lower or upper case)
> - upper case alpha (x'41' - x'5a')
< - lower case alpha (x'61' - x'7a')
# - any numeric (x'30' - x'39')
& - any alphanumeric character
? - any printable character including blank (x'20' - x'7e')
! - any non-blank printable character (x'21' - x'7e')
% - any punctuation (any non alphanumeric printable char)
^ - any control character (x'00' - x'1f')
* - previous character may repeat 0,1,or more times
pattern match examples
----------------------
scnp a0(80),'@#@ *#@#' - scan for the canadian postal code
6 chars of alternating alpha/numeric
possibly with 0,1,or more blanks
in the middle
scnp b0(80),' pic?* 9' - probably scanning cobol source lines
for pic 9, pic 9, picture 9, etc
mvup b0(80),a0,'%' - move area a to area b until any
punctuation is found (,;:./etc)
repp b0(80),c'%',c' ' - replace all punctuation with blanks
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
H0. uvcopy INDEX REGISTERS
index register usage summary
$ra - $rs - entirely available for the user
- no system instruction will ever modify these registers.
$rt - available to the user, except when using 'vnf' (Verify Numeric Field)
- see 'vnf' on the next page or details at uvcopy3.htm#vnf
$ru,$rv,$rw - used by some instructions (see next page).
$rx,$ry,$rz - used by many instructions for various purposes.
A usage summary by instruction follows (here in uvcopy2.doc).
See instruction details in uvcopy3.htm
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
H1. uvcopy index registers - RESERVED (u,v,w,x,y,z)
register 't' - 'z' usage by instruction
$rt vnft3 - vnf uses register 't' to build the field error report
- initialized to 0 by option 't1' on 1st vnf in uvcopy job
vnft2 - option 't2' acumulates errors in area 't' for dump at EOJ
- incremented by 80 for each error stored
$ru opn - will hold the record size after open input (all file types)
- you do not need to code this on the 'get's to an ISAM file
but you would need to code on the 'put's to a sequential
file if you are converting ISAM to sequential.
- This value will be correct for valid ISAM input files, but
may not be correct for other file types if rcs=XXX were
not declared correctly on the 'fili_/filr_ functions
$ru rep - will hold the dsplcmnt of the last match in op1
or the end of op1 if no matches
tst - will hold the dsplcmnt of the 1st non-match in op1
or the end of op1 if all matches
rpt - will hold the displacement of the last match found
in the data (or end of op1+1) if no matches found
cnt - will hold the displacement of the 1st nonblank in op1
$rv opn - will hold the slot size after open input (all file types)
- slot size is 1 greater for typ=ISF & typ=RSR
red - $rv will hold record length after read on file typ=IDXf3/f8
rpt - will hold the displacement of the last match found
in the table (or the table end marker) if no matches found
Note |
- As of June 2007, $rv is used for the output record length
- if the op2 length on the 'put' instruction is omitted
- assuming $rv has the record size from the previous 'get' instruction
- So, we changed $rv to $rw for 'cnt' & 'cmc' (see below)
- we removed $rv used on 'rpt' to store dsplcmnt of last match in table
|
$rw rpt - will hold the length of the last replacement data
(or 0 if no matches found)
- $ru + $rw would be the displacement of the 1st byte of data
beyond the replacement data.
sct - will hold the length of the data matched
(or 0 if no matches found)
cnt - will hold the displacement of the last nonblank in op1
cmc - will hold the displacement to the 1st non-matching byte
or to the 1st byte beyond op1 if nomatch found
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
H1a. index registers - RESERVED (x,y,z,u,v,w)
$rx - heavily used by many instructions
usually to hold displacements of search patterns found
cat - rgstr 'x' will point to the 1st blank on the right hand side
cnt - holds the displacement in op1 of the 1st match found to op2
env - length of value stored for environmental variable
fix - will point to the 1st blank entry
or end of op1 if all fields non-blank
lok - holds the displacement of the matching table entry
or of the end of table marker entry (~ col 1) if nofind
msgw - holds the length of the reply data
mvu - holds the dsplcmnt in op1 where the search pattern
would go if the move had continued (or end op1 if nofind)
rep - holds the dsplcmnt of the 1st replacement made
or the end of op1 if no replacements made
rpt - (replace by table) rgstr x will hold the dsplcmnt of the
1st replacement made or the end of op1 if no replacements made
scn - holds the dsplcmnt of the matching pattern found
or the end of op1 if nomatch is found
sct - (scan by table) rgstr x will hold the dsplcmnt of the
1st match in op1 (the data search area)
srt - rgstr x will point to the 1st entry with '~~' in 1st 2 bytes
of the key, OR to the end of the table if '~~' not found.
- will always point to the end of the table if option 'n1'.
sqf - will point to the 1st blank entry
sqz - rgstr 'x' will point to the 1st fill character on the right
sqzr - rgstr 'x' will point to the 1st data character on the left
tst - holds the dsplcmnt of the 1st match in op1
or the end of op1 if nomatches
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
H1b. REGISTER USAGE SUMMARY BY INSTRUCTION (continued)
$ry - used by several instructions
cnt - holds the displacement in op1 of the last match found to op2
mvu - holds the dsplcmnt in op2 where the search pattern
was found (or end of op2 if nofind)
rpt - (replace by table) rgstr y will hold the dsplcmnt of the
1st match in the table (or end of table if no matches)
sct - (scan by table) rgstr y will hold the dsplcmnt of the
1st match in op2 (the table of search patterns)
srt - rgstr y will point to the 1st blank entry
(or 1st entry with '~' in 1st byte of key if option t1)
tst - holds the dsplcmnt of the 1st match in op2
or the end of op2 if no matches
$rz opn - will hold the file size for the file last opened
get - will hold the record length for the last record read
or 0 if end of file, or error
- applies to all file types including typ=RSV & typ=IDXf3/IDXf8
- record length also stored in $rv
(same as 'red' instruction on typ=IDXf3/IDXf8 files)
put - record length for the last record written (or -1 if error)
- for IDXf3v/IDXf8v variable length files, the record length
will be taken from $rv if op2 length is omitted
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
H2. uvcopy INDEX REGISTERS - EXPLANATION & EXAMPLES
Index regsisters provide some very powerful programming techniques &
I will explain them here for those readers that have not been exposed
to this important concept.
INDEX REGISTERS example #1 - loading tables
-------------------------------------------
example #1 |
- assume we wish to load the 1st 40 bytes of each record in
file #1 into area 'b' translating the 1st 10 bytes of each
entry to UPPER case
- might be creating a table of 10 byte keys & 30 byte arguments
which would be later looked up with the 'lok' instruction |
solution 1a: rtb fili2,b0(40),b0(40)
- this is the easiest solution, but does not translate the 1st
10 columns to UPPER case as requested
solution 1b: loop get fili2,a0 # get current record
skp> eof2 # check for end-of-file
tru a0(10) # tranlate 1st 10 cols to UPPER
mvc bi0(40),a0 # move 1st 40 bytes into area'b'
# depending on dsplcmnt in rgstr 'i'
add $ri,40 # add 40 to register 'i'
skp loop # return to get next record
eof2 ---
- this assumes register 'i' is initially 0 which it would be if
you had not used it prior to this point, else precede loop with
mvn $ri,0 # clear register 'i'
- you can see that register i will increase by 40 each time around
the loop thus storing the records at displacements of:
0,40,80,120,160,200,240,etc until eof
- it is quite common to use the same register as the area, in which
case the above would become:
mvc bb0(40),a0
add $rb,40
- you should avoid using index registers x,y,or z in loops such as this
since register x,y,& z are set by default by various instructions
that you may want to use within the loop
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
H3. uvcopy INDEX REGISTERS - loading & looking up tables
illustration for examples #1 & #2
dsp 0 10 30 40
000 DOODAD00 doodad - small 00000500
040 DOODAD01 doodad - large 00000750
080 GADGET00 gadget - small 00002500
120 GADGET01 gadget - large 00002750
160 THINGME0 thingme - universal 00001250
200 WIDGET00 widget - small 00000500
240 WIDGET01 widget - medium 00000750
This is the table of product codes, descriptions,& prices that is used
in examples #1 & #2.
40 bytes of each table file record are loaded into area 'b' in ex #1
& some fields within the table could be addressed as follows:
b0(40) - would address the entire 1st entry
b0(10) - would address the product code of the 1st entry
b10(20) - would address the description of the 1st entry
b30(8) - would address the price of the 1st entry
b40(40) - would address the entire 2nd entry
b50(20) - would address the description of the 2nd entry
However the point of this discussion is to show you a better way of
addressing table entries - using index registers
We could load entries into the table using a loop & the following instrns:
mvc bb0(40),a0 - move 40 bytes of area 'a' (input record)
to area 'b' (table) indexed by rgstr 'b'
add $rb,40 - incrmnt register b by 40 bytes
to allow for the next entry
Note that rgstr b values will be 0,40,80,120,etc as entries are loaded.
We could look-up the table in a similar fashion using an instruction loop
including the following instructions (& not worrying about nofinds):
loop cmc bb0(10),a0 - test product# of current tbl entry in area 'b'
skp= found using rgstr 'b', to 1st 10 bytes of area 'a'
add $rb,40 - up rgstr 'b' to next entry
skp loop (would then repeat loop)
found mvc c50(20),bb10 - move description from the found table entry
to cols 51-70 of area 'c' (an output record)
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
H4. uvcopy INDEX REGISTERS example #2 - looking up tables
problem#2 |
- given the table that was loaded in example #1 (into area b)
- the table entries are 40 bytes each as follows:
01-10 - table lookup key (might be product#)
11-40 - table data (might be product description)
- a sales detail input file is read into area 'c' and contains
a product# in cols 11-18 |
required |
- validate the product# in the sales detail records by looking
up the product table
- if valid move the product description from the table to cols
51-80 of the sales detail records |
solution 2a:
lok b0(40),c10(10) lookup table by prod#
skp! 1 (if nofind skip next instrn)
mvc c50(30),bx10 store description if prod# ok
- the easiest solution is to use the table lookup 'lok' instruction
which sets the condition code = if a matching key is found &
leaves register 'x' pointing to the 1st byte of the matching entry
- for example if we had a match on the 4th entry register 'x' would
hold the displacement to that point: 3 x 40 = 120 bytes
- bx10 would address area b + rgstr x contents (120 bytes) + 10 bytes
= 130 bytes up in area b (the description in the 4th entry)
solution 2b:
mvn $rb,0 clear register b
# begin loop to test each table entry for product# match
loop cmc bb0(10),c10 current entry match ?
skp= match yes - skip out of loop
add $rb,40 no - up table to next entry
cmc bb0(1),'~' reached table end marker ?
skp! loop no - repeat loop
can 'product# nofind - cancel job'
--- (a little drastic perhaps)
# matching entry found - move product dscrptr to dtl record
match mvc c50(30),bb10 move dscrptr via rgstr b + 10
- solution 2b is not as simple as 2a, but illustrates a technique
that might be used if the table key (argument) is not first
in each entry as is required by the table lookup 'lok' instruction
- note that we have used register 'b' in this solution rather than 'x'
which is automatically set by the 'lok' instruction in solution 2a
because register x is set by various instructions that we might
want to use within a loop such as this
- please see example #3 in section uvcopy4.doc for a complete solution
to a similar problem of sales detail validation, pricing,& extension
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
H5. uvcopy INDEX REGISTERS example #3 - scanning & replacing
example#3 |
- mass changes to cobol source programs
- assume we wish to change all 'comp-3' fields to 'comp-4'
as shown by the example below: |
before: 05 sale-quantity pic 9(7) comp-3 value 0.
after : 05 sale-quantity pic 9(7) comp-4 value 0.
^------------------ column #41
solution 3a: rep b0(80),'comp-3','comp-4'
- this is the easiest solution, but does not use registers
- note that 'comp-3' is quite distinctive & we probably don't need
to ensure that we are in fact processing a cobol picture stmnt.
- in other cases you may need by a preceding scan for 'pic' and
leave 1 blank before & after the patterns to ensure you don't
match parts of words.
solution 3b: scn b0(80),'comp-3' # scan cols 1-80 for 'comp-3'
skp! 1 # skip next instrn if cc not equal
mvc bx0(6),'comp-4' # replace 'comp-3' with 'comp-4'
- the 'scn' instruction will store the displacement of the found
pattern in register 'x' by default & the 'mvc' instruction will
move 'comp-4' over top of 'comp-3' at the displacement in 'x'.
- for example suppose 'comp-3' is present begining at column #41
then register 'x' would hold displacement value of 40 which is
column 40 since uvcopy addresses are always zero relative
problem 3c |
- to illustrate a point let us now restrict the scan to only
columns 8-72 (the cobol text statement area) |
solution 3c: scn b7(65),'comp-3' # scan cols 8-72 for 'comp-3'
skp! 1 # skip next instrn if cc not equal
mvc bx7(6),'comp-4' # replace 'comp-3' with 'comp-4'
- now if 'comp-3' started in column 41 the displacement in register x
would be 33 after the 'scn' instruction & the effective address
on the 'mvc' instruction would be 7 + 33 = 40 which is column 41
solution 3d: scn b7(65),'comp-3' # scan cols 8-72 for 'comp-3'
skp! 1 # skip next instrn if cc not equal
mvc bx12(1),'4' # replace only the '3' with '4'
- this solution changes only the '3' of 'comp-3' to '4'
op1 bx12(1) addresses only 1 byte at column 46 since
x = 33 + explicit displacement 12 = 45 which is col 46
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
H6. uvcopy INDEX REGISTERS - example #4 - mvu
problem |
- mass changes to cobol source programs
- assume we wish to insert 'sync' on all 'comp-4' pictures
as illustrated below: |
before: 05 sale-quantity pic 9(7) comp-4 value 0.
after: 05 sale-quantity pic 9(7) comp-4 sync value 0.
****
solution 4a:
rep b0(80),'comp-4',comp-4 sync'
- this is the easiest solution but does not illustrate
registers as will solution 4b below
using the 'mvu' instruction (move until)
solution 4b:
1 mvu c0(80),b0,'comp-4'
2 skp! ovr
3 mvc cx0(11),'comp-4 sync'
4 mvc cx11(80),by6
after 1: 05 sale-quantity pic 9(7)
^x
after 3: 05 sale-quantity pic 9(7) comp-4 sync
^x+11
after 4: 05 sale-quantity pic 9(7) comp-4 sync value 0.
- 'mvu' (move until - moves op2 to op1 until op3 found in op2)
by default sets the displacement of the found search pattern
in register x (op1) & register y (op2) for example,
if 'comp-4' starts in column 41, then:
- rgstr y will = 40, the displacement within op2 (area b)
of the found search pattern
- rgstr x will = 40, the displacement within op1 (area c)
where the found data would go if the move had continued
3 mvc cx0(11),'comp-4 sync'
- this instruction will move 'comp-4 sync' to columns 41-51
since register 'x' holds 40 which is a displacement
(bytes preceding) within the area (area c in this case)
4 mvc cx11(80),by6
- this instruction will complete the move of the remaining
data in area b ('value 0.' in this case) to area c
- cx11 will address column 52 = 40(rgstr x) + 11 = 51
which is the displacement to column 52
- by6 will address column 46 = 40(rgstr y) + 6 = 46
which is the displacement to the 'comp-4' in area b
- the extra length of cx11(80) wont matter (moves blanks)
& ensures entire record move is completed
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
H6a. INDEX REGISTERS - example #4 - mvu (continued)
solution 4c |
- uses specified registers (c & b in this case) vs the default
registers (x & y)
- uses options to maintain the displacements current in the
registers vs having to keep track of them manually |
1 mvuz3e3a7 cc0(80),bb0,'comp-4'
2 skp! ovr
3 mvcu1 cc0(6),' sync '
4 mvc cc0(80),bb0
after 1: 05 sale-quantity pic 9(7)
^cc0
after 3: 05 sale-quantity pic 9(7) comp-4 sync
^cc0
after 4: 05 sale-quantity pic 9(7) comp-4 sync value 0.
1 mvuz3e3a7 cc0(80),bb0,'comp-4'
z3 - pre-clears whatever registers are coded in op1 & op2
e3 - updates the explicitly coded rgstrs (vs dflt x & y)
- option e 'adds' to any existing value in the register
vs 'replacing' any existing value
a7 - (a4 + a2 +a1)
a4 - moves the target search pattern to op1 vs stopping
the move with the register pointing to it
a2 - updates the op2 register over the target pattern
a1 - updates the op1 register over the (moved) target
3 mvcu1 cc0(6),' sync '
u1 - updates the op1 register over the moved data
so the next move can use cc0 (vs cc6)
4 mvc cc0(80),bb0
- completes the move of input area b to output area c
- extra length wont matter (moves blanks) & ensures
that the record move is completed
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
H7. uvcopy LENGTH INDEXING
Length indexing is less frequently required than displacement indexing
(just discussed) but there are some situations where it is invaluable.
Please consider the 'scan1' job in section SCANjobs where length indexing
is used to specify the length of the pattern being scanned for.
#1. msgwn 'enter the search pattern'
#2. mvc d0(80),$reply save pattern in area 'd'
#3. mvn $rn,$rx save pattern length in rgstr 'x'
(msgw leaves lth in rg x which is temp)
---
#4. scn a0(256),d0($rn80) scan record in 'a' for pattern in 'd'
whose length is in rgstr 'n'
- 'msgw' solicits the search pattern from the operator.
- 'mvc' moves the search pattern from $reply (which might be required for
another msgw) to area 'd' (which is not used for anything else)
- 'mvn' moves the length of the reply data to register 'n' from register 'x'
where msgw stored the reply length, but register 'x' is temporary
& could be stored by many other instructions.
- The 'scn' instruction is on page 2 of the scan1 job within the record
get loop (vs the 1st 3 instructions which are program initialization)
scn scans the current record in area 'a' for the search pattern in 'd'
whose length is held in register 'n'
- The '80' of ($rn80) specifies the maximum length to be used should
register 'n' hold a value that is greater then this maximum
The register is specified as '$rn' not just 'n' as it would be in
displacement indexing because alpha letters within the (length)
& without the '$r' prefix would be interpreted as the data type
(n8 = 8 bytes numeric, p8 = 8 bytes packed, etc)
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
I1. uvcopy USER & INSTRUCTION COUNTERS
Counter sets 'a' thru 'h' ($ca0 thru $ch24) are entirely for the user,
no system instruction will ever modify these counters.
Counter set 'i' ($ci0 - $ci24) are instruction counters & are modified
by various instructions to hold counts that are usually byproducts.
Counter usage is also documented with each instruction in uvcopy3.doc.
instruction counter SUMMARY by INSTRUCTION
$ci1 - heavily used by many instructions
cnt - counts the op2 pattern matches
fix - the number of op2 separators found
rep - number of replacements made
rpt - number of replacements made
rtb - counts the lines read & loaded into the table
tst - op1 character (or subfield) matches by op2
evt - count of environmental values stored
$ci2 cnt - counts alpha characters
tst - counts the number of non-matches
$ci3 cnt - lower case alpha characters
$ci4 cnt - upper case alpha characters
$ci5 cnt - numeric digits
$ci6 cnt - alphanumeric characters
$ci7 cnt - printable characters
$ci8 cnt - printable nonblank characters
$ci9 cnt - punctuation characters
$ci10 cnt - control chars 0x00-0x1f & 0x7f-0xff
$ci11 - count of single quotes
- used by several instructions
cnt, rep, scn, trl, tru
$ci12 - count of double quotes
- used by several instructions
cnt, rep, scn, trl, tru
$ci13 cnt - word count
$ci16 get - BDW current size
$ci17 get - RDW current size
$ci18 get - RDW accumulated size within current BDW
$ci19 get - RDW record count in BDW
$ci21 tbl - holds the table entry count (total for current table)
$ci22 tbl - holds the hit/match count for the current argument
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
J0. uvcopy DEBUGGER
uvcopy DEBUGGER - Contents
J1. |
Debugging uvcopy jobs - Run OPtion rop=d |
|
Listing of $UV/pf/demo/fixUSstates1.csv uvcopy job to demo debugging |
J2. |
Debug demo session#1 - using uvcopy fixUSstates1 & testfile USstates.csv |
|
uvcopy fixUSstates.csv,rop=d - USstates.csv to fixed-field |
J3. |
Debug Command Summary (group1) - Display Data-Areas, Counters, Registers |
|
'd' (or 'p') to Display (or Print) Data Areas (a,b,c...x,y,z) |
|
'a' (or 'c') to display Accumulators (or Counters) |
J4. |
Debug Command Summary (group2) - Breakpoints & Gotos |
|
b# tag - store break-point tags b1,b2,b3 for gotos g1,g2,g3,g4,g5 |
|
b1/b2/b3/b4/b5 tag - set breakpoint tags for corresponding gotos g1/g2/g3/g4/g5 |
|
b1/b2/b3/b4/b5 - - clear breakpoint if tag spcfd as '-' |
|
g# - execute until reaching an instruction with label matching b# |
|
g1/g2/g3/g4/g5 - executes until finding a label matching stored b1/b2/b3/b4/b5 |
|
g - executes until finding a label matching any 1 of b1/b2/b3/b4/b5 |
|
g1/g2/g3/g4/g5 tag - store this tag in b1/b2/b3/b4/b5 & execute until we find it |
|
g tag - ERROR: tag Allowed only with g1/g2/g3/g4/g5 |
|
G - executes until the end of the job, close files,& exit uvcopy |
|
s1 - set Subrtn display mode, shows instructions between bal & ret |
|
s0 - set Subrtn suppression, don't show instructions between bal & ret (default) |
J5. |
Debug demo session#2 - uvcopy extendsales1,rop=d |
J6. |
I/O files for extendsales1 uvcopy job (to demo debugging). |
|
dat1/productmaster - tabled in memory |
|
dat1/salesitems - INPUT file |
|
dat1/salesextended - OUTPUT extended with product price & dscrptn ** |
J7. |
debug session#2 --> uvcopy extendsales1,rop=d |
|
- null entries to step thru instructions for 1st record cycle |
|
- d (or p) to Display (or Print) Data Areas (a,b,c...x,y,z) |
|
- a (or c) to display Accumulators or Counters (after 1st record) |
J8. |
p8 p0(50) - to display 1st 8 records in table area 'p' (50 bytes each) |
|
r - to display Registers |
J9. |
g3 man90 - to store label 'man90' in brkpt g3 & go to it |
|
c - to display counters (total for all records) |
|
G - to Goto EOJ (close files & end job) |
J10. Debug session#3 to demo Breakpoints & Gotos
- see J4 above for summary of Breakpoint & Goto commands
J11. |
debug session#4 - demo using only 'goto's without setting breakpoints |
J12. |
debug session#4 - Why product# ERRORs cause description '~~~~~~~~~' |
J13. |
Debug Command 'x' to Display Hexadecimal data |
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
J1. 'DEBUGGING' uvcopy parameter files - run option 'd'
Most uvcopy programs will not require the debug option, but it can be useful for
for larger complex programs especially if using index registers and program loops.
Debug mode is invoked by appending ',rop=d' to the command line. You may
also set debug mode via 'export UVCOPYROP=d' (for uvcopy jobs within scripts).
In debug mode, uvcopy will display each instruction before execution & wait for
an operator command. See the "Command Summary" on pages 'J3' & 'J4'.
But first we will present a sample debug session to give you a good idea of debugging.
We will demo the debug option using $UV/pf/demo/fixUSstates.csv listed below,
& then executed with the debug option on the next page.
# fixUSstates.csv - convert dat1/USstates.csv to tmp1/USstates.fix
# - convert csv fields to space-filled 20 byte fixed-fields
#
# ----- sample INPUT 1st 3 records -----
# abr,state,state-pop,capital,capital-pop
# AL,Alabama,4908620,Montgomery,205764,
# AK,Alaska,734002,Juneau,31275,
#
# ----- sample OUTPUT 1st 3 records -----
# abr state state-pop capital capital-pop
# AL Alabama 4908620 Montgomery 205764
# AK Alaska 734002 Juneau 31275
#
rop=r1 # EOF option prompt to view output file (vi,cat,more,head,etc)
fili1=?dat1/USstates.csv,typ=LST,rcs=4096
filo1=?tmp1/USstates.fix,typ=LST,rcs=4096
@run
opn all open files
# begin loop to get & put records until EOF
getrec get fili1,a0 get record into area 'a'
skp> EOF (cc set > at EOF)
mvc b0(4096),a0 move in-area 'a' to out-area 'b'
#-----------------------------------
fix b0(20),a0(100),6,',' convert csv to fixed-fields 20 apart
#-----------------------------------
putrec put filo1,b0 write to out-file from area 'b'
add $ca1,1 count records for EOF msg
return skp getrec return to get next record
#
EOF cls all close files
msgv1 '$ca1 records converted to fixed-field from $fili1 to $filo1'
eoj end job
uvcopy fixUSstates.csv <-- run demo job to convert USstares.csv to fixed-field
====================== - without debugging (omitting ',rop=d' from uvcopy command)
- see below to run with debugging (by appending ",rop=d")
Note |
- You can run these demos, enter suggested debug commands,& match your results
- login as uvadm OR yourself if you have copied $UV/demo/* to your $HOME/demo/...
|
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
J2. Debugging uvcopy jobs - Run OPtion rop=d
Debug session#1 - prior to command summary
uvcopy fixUSstates.csv,rop=d - run demo job to convert USstares.csv to fixed-field
============================ - 'rop=d' causes uvcopy to display each instruction
& wait for operator command
- 'null entry' executes next instruction
0 opn all open files
debug>
152 getrec get fili1,a0 get record into area 'a'
debug>
352 skp> EOF (cc set > at EOF)
debug>
504 mvc b0(4096),a0 move in-area 'a' to out-area
debug>
656 fix b0(20),a0(100),6,',' convert csv to fixed-fields 2
debug>
880 putrec put filo1,b0 write to out-file from area '
debug>
1080 add $ca1,1 count records for EOF msg
debug>
1232 skp getrec return to get next record
debug> p a0
1 2 3 4 5 6 7 8 9 100
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
----->abr,state,state-pop,capital,capital-pop
debug> p b0
1 2 3 4 5 6 7 8 9 100
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
----->abr state state-pop capital capital-pop
debug> a <-- 'a' to display accumulators
accumulators: ca1=1,
debug> r <-- 'r' to display registers
registers: u=4096,v=39,x=100,z=92,
debug> G <-- 'G' to Goto EOJ
20201109:472804:fixUSstates.: EOF fili01 rds=51 size=1916: dat1/USstates.csv
20201109:472804:fixUSstates.: EOF filo01 wrts=51 size=4423: tmp1/USstates.fix
51 records converted to fixed-field from dat1/USstates to tmp1/USstates
uvcopy fixUSstates.csv start 2020/11/09_11:46:08 end 11:47:28 elapsed 001_19_700
EOJ, Output File written to: tmp1/USstates.fix
----- enter: vi,cat,more,lp,uvlp13,etc (default null) --> head -3
abr state state-pop capital capital-pop
AL Alabama 4908620 Montgomery 205764
AK Alaska 734002 Juneau 31275
- we entered nulls to step until we reach "skp getrec" (end of 1st loop for 1st record)
- then entered 'a' to display accumulators "ca=1" from "add $ca1,1" for 1st record
- then entered 'r' to display registers
- then entered 'G' to Goto EOJ, without displaying instruction
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
J3. Debug Command Summary (group1) - Display Data
Here is the Debug Command Summary, in 2 groups (Display DATA & Breakpoints/Gotos).
You can try these out using the demo jobs listed on the preceding & following pages.
Display data areas, accumulators, registers
d/p |
- 'd' Display data area, or 'p' Print a data area
|
p a0(100) |
- print(display) area 'a' from byte 0 - 99 (100) bytes default
- print area may be any 1 of 'a' - 'z'
|
p a |
- same as above since displacement defaaults to 0 & length to 100
|
p b100(100) |
- print area 'b' bytes 100-199 (max line width 100 bytes)
|
p5 c0(100) |
- print 5 lines c0(100,c100(100),c200(100),c300(100),c400(100)
|
pe e0 |
- Display area e0(100) translating Ebcdic to ascii
|
px4 x0 |
- Display area x0(100),x100(100),x200(100),x300(100) in hexadecimal
- 3 line groups: line1 character, line2 hex zones, line3 hex digits
- characters on line1 with unprintable bytes replaced by periods
|
a/c |
- 'a' display Accumulators, or 'c' Counters (synonym)
|
c |
- display counters, non-zero acums in bank 'a' $ca0-$ca24 (default)
Example: counters: ca1=100,ca2=25,ca4=4, |
c b |
- display non-zero acums in bank 'b' $cb0-$cb24 example:
----- etc - 9 banks (a-i) of 25 acums ----- |
c i |
- display non-zero acums in bank 'i' $ci0-$ci24 example:
Example: cb1=300,cb2=2300000,
- Note: 9 banks (a-i) of 25 acums each
|
r |
- display Registers (in decimal, only non-zero registers)
Example: registers: a=20000,b=84,d=20,s=1,u=50,v=200,x=50,z=80, |
------- Display Data,Counters,Registers EXAMPLEs based on fixUSstates.csv (page 'J1') -------
p a0
1 2 3 4 5 6 7 8 9 100
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
----->abr,state,state-pop,capital,capital-pop
p b0
1 2 3 4 5 6 7 8 9 100
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
----->abr state state-pop capital capital-pop
a <-- 'a' to display accumulators
accumulators: ca1=1,
r <-- 'r' to display registers
registers: u=4096,v=39,x=100,z=92,
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
J4. Debug Command Summary (group2) - Breakpoints & Gotos
Breakpoints
null entry |
- single step, execute the instruction on display, then
- then display the next instruction & prompt for a command
or null to continue executing 1 at a time. |
b# tag |
- store break-point tags b1,b2,b3,b4,b5 for gotos g1,g2,g3,g4,g5
|
b1/b2/b3/b4/b5 tag |
- store breakpoint tags for gotos g1/g2/g3/g4/g5
|
b1/b2/b3/b4/b5 - |
- clear breakpoint if tag spcfd as ' -'
|
------- Breakpoint examples based on fixUSstates.csv (page 'J1') -------
b1 getrec - set Breakpoint#1 on the instruction with label 'getrec'
b2 putrec - set Breakpoint#2 on the instruction with label 'putrec'
b3 EOF - set Breakpoint#3 on the instruction with label 'EOF'
Breakpoints are set using the labels on uvcopy instructions. The examples above
are based on the uvcopy job listed on page 'J1' & the debug session on page 'J2'.
Max 5 breakpoints at any 1 time, but you may redefine.
Gotos
g# |
- execute until reaching an instruction with label matching b#
|
g1/g2/g3/g4/g5 |
- executes until finding a label matching stored b1/b2/b3/b4/b5
|
g |
- executes until finding a label matching any 1 of b1/b2/b3/b4/b5
|
g1/g2/g3.g4/g5 tag |
- store this tag in b1/b2/b3/b4/b5 & execute until we find it
|
g tag |
- ERROR: tag Allowed only with g1/g2/g3/g4/g5
|
G |
- executes until the end of the job, close files,& exit uvcopy
|
------- Goto examples based on fixUSstates.csv (page 'J1') -------
g2 <-- execute until reaching label 'putrec' (stored in b2 above)
g <-- execute until label matching any 1 of tags stored in b1/b2/b3/b4/b5
g3 EOF <-- replaces any existing b3 tag with 'EOF'
& executes until we find it
Sub-Routine display instructions or Suppress
s1 |
- set Subrtn display mode, shows instructions between bal & ret
|
s0 |
- set Subrtn suppression, will not show instructions between bal & ret
- the default is 's0' to inhibit showing subroutine instructions
|
Display Data-Areas, Counters, Registers
At any breakpoint, you may display areas,counters,registers as shown on prior page
p a0 |
- display areas relevant to current breakpoint
1 2 3 4 5 6 7 8 9 100
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
abr,state,state-pop,capital,capital-pop |
c a |
- display counters, non-zero acums in bank 'a' $ca0-$ca24 (default)
counters: ca1=100,ca2=25,ca4=4, |
r |
- display Registers (in decimal, only non-zero registers)
registers: a=20000,b=84,d=20,s=1,u=50,v=200,x=50,z=80, |
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
J5. Debug demo#2 - uvcopy extendsales1
$UV/pf/demo/extendsales1 - 2nd job to demo debugging
# extendsales1 - demo uvcopy table load (rtb) & table lookup (lok)
# - load product master file into memory table at begin job
# - extend sales items by looking up product master for price & dscrptn
# - see documentation at https://uvsoftware.ca/uvcopy3.htm#rtb
#Note - also used to demo uvcopy debugging, see https://uvsoftware.ca/uvcopy2.htm#J1
#
# uvcopy extendsales1,fili1=dat1/salesitems,fili2=dat1/productmaster,filo1=tmp1/salesextended
# ===========================================================================================
# uvcopy extendsales1,rop=d - same as above (files default as shown)
# ========================= - ',rop=d' to debug, displays instructions before executing
# ** sample 1st record from input salesitems,productmaster,& output salesextended **
# 1 2 3 4 5 6 7 8
# 12345678901234567890123456789012345678901234567890123456789012345678901234567890
# cust# date invoice# product qty
# 130140 20200802 IN001001 BBQ010 000010
# 1 2 3 4
# 1234567890123456789012345678901234567890
# Product# Description unit-price
# BBQ010 BAR-B-Q 0019500
# 1 2 3 4 5 6 7 8
# 12345678901234567890123456789012345678901234567890123456789012345678901234567890
# cust# date invoice# product qty price extended product description
# 130140 20200802 IN001001 BBQ010 000010 0019500 000195000 BAR-B-Q
#
rop=r1 # EOF option prompt to view output file (vi,cat,more,etc)
fili1=?dat1/salesitems,rcs=80,typ=LST # sales item file
fili2=?dat1/productmaster,rcs=80,typ=LST # product master file
filo1=tmp1/salesextended,rcs=100,typ=LST # output items extended w price/dscrptn
@run
opn all open all files
rtb fili2,p0(50),p0(50) read product master into memory area 'p'
# ===
# begin loop: read sales items, extending with price & dscrptn from table lookup
man20 get fili1,a0 read next sales item record
skp> man90 (cc set > at EOF)
man22 mvc b0(80),a0 copy input to output area
lokz1 pp0(50),pp0(6),a25(6) lookup table by product code
# ===
skp= man26 (cc unequal if nomatch)
man24 msg 'ERROR - product code not found',a25(6)
man26 mvn b40(7),pp30(7) price from table
mvn b48(9),pp30(7) price to amount for extension
mpy b48(9),b32(6) master price * item qty = amount
man28 mvc b58(16),pp10 product dscrptn from table
add $ca1,b48(9) accumulate total sales for EOF msg
man30 put filo1,b0 write output
skp man20 return to get next record
# EOF - close files & end job (rop=r1 prompts to show output file)
man90 cls all
msgv1 'Total sales = $ca1 in $filo1'
eoj
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
J6. Debug demo#2 - uvcopy extendsales1
Here are the I/O files for the above extendsales1 uvcopy job (to demo debugging).
This job was used to demo the 'rtb' instruction (documented at uvcopy3.htm#rtb),
by tabling a product master file, then looking it up by product# to extend a
sales item file using the product master price & description.
dat1/productmaster - to be tabled in memory
Product# Description unit-price
1 2 3 4
1234567890123456789012345678901234567890
========================================
BBQ010 BAR-B-Q 0019500
HAM010 CLAW HAMMER 0000950
HAM020 BALL HAMMER 0001200
HAM035 JACK HAMMER 0029500
SAW011 HAND SAW 0001975
SAW012 RIP SAW 0002500
SAW051 POWER SAW 0008500
dat1/salesitems - INPUT file
cust# slsmn date invoice# product quantity
1 2 3 4
1234567890123456789012345678901234567890
========================================
cust# date invoice# product qty
130140 20200802 IN001001 HAM035 000010
139923 20200802 IN001002 SAW011 000020
139923 20200802 IN001003 HAM020 000030
250825 20200804 IN001104 BBQ010 000040
250825 20200804 IN001004 SAW099 000050
401210 20200816 IN001005 SAW051 000060
dat1/salesextended - OUTPUT extended with product price & dscrptn
cust# slsmn date invoice# product quantity price amount product-dscrptn
1 2 3 4 5 6 7 8
12345678901234567890123456789012345678901234567890123456789012345678901234567890
================================================================================
cust# date invoice# product qty price extended product description
130140 20200802 IN001001 HAM035 000010 0029500 000295000 JACK HAMMER
139923 20200802 IN001002 SAW011 000020 0001975 000039500 HAND SAW
139923 20200802 IN001003 HAM020 000030 0001200 000036000 BALL HAMMER
250825 20200804 IN001104 BBQ010 000040 0019500 000780000 BAR-B-Q
250825 20200804 IN001004 SAW099 000050 0000000 000000000 ~~~~~~~~~~~~~~~~
401210 20200816 IN001005 SAW051 000060 0008500 000510000 POWER SAW
uvcopy salesextend,rop=d <-- execute uvcopy job to demo 'rtb' & 'lok'
======================== - ',rop=d' to debug (display instructions before executing)
- see the uvcopy job listed on the previous page.
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
J7. Debugging uvcopy jobs (rop=d)
debug session#2 using $UV/pf/demo/extendsales1
Please refer to uvcopy job listing on page 'J5' & the I/O files on 'J6' above.
We will single step (null entries) to end of 1st loop processing 1st instruction.
Then display the relevant I/O data areas, registers & accumulators.
uvcopy extendsales1,rop=d
=========================
0000 opn all open all files
debug> 0152 rtb fili2,p0(50),p0(50) read product master into memory
debug> 0376 man20 get fili1,a0 read next sales item record
debug> 0576 skp> man90 (cc set > at EOF)
debug> 0728 man22 mvc b0(80),a0 copy input to output area
debug> 0880 lokz1 pp0(50),pp0(6),a25(6) lookup table by product code
debug> 1056 skp= man26 (cc unequal if nomatch)
debug> 1360 man26 mvn b40(7),pp30(7) price from table
debug> 1512 mvn b48(9),pp30(7) price to amount for extension
debug> 1664 mpy b48(9),b32(6) master price * item qty = am
debug> 1816 man28 mvc b58(16),pp10 product dscrptn from table
debug> 1968 add $ca1,b48(9) accumulate total sales for EO
debug> 2120 man30 put filo1,b0 write output
debug> 2320 skp man20 return to get next record
debug> p a0 <-- display the 1st INPUT record (in area 'a')
1 2 3 4 5 6 7 8
123456789012345678901234567890123456789012345678901234567890123456789012345678901
----->130140 20200802 IN001001 HAM035 000010
debug> p b0 <-- display the 1st OUTPUT record (in area 'b')
1 2 3 4 5 6 7 8 9 1
12345678901234567890123456789012345678901234567890123456789012345678901234567890
----->130140 20200802 IN001001 HAM035 000010 0029500 000295000 JACK HAMMER
debug> c
counters: ca1=295000,
- At the end of the 1st record cycle, ca1 contains $amount 2,950.00 from 1st record
shown above & repeated below to define the location of $amount in 48(9)
130140 20200802 IN001001 HAM035 000010 0029500 000295000 JACK HAMMER
================================================<-48(9)->==============
- $ca1 is accumulated by the 'add' instruction at the end of each record cycle
add $ca1,b48(9) accumulate total sales for EOF msg
==================
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
J8. Debugging uvcopy jobs (rop=d)
debug session#2 (extendsales1) - continued
debug> p8 p0(50) <-- display the product lookup file (tabled in memory by rtb)
- 'rtb' tabled 40 byte records as 50 byte entries to simplify addresses
- 'lok' looks-up the table by product# key to get description & price
1 2 3 4
12345678901234567890123456789012345678901234567890
0000-->BBQ010 BAR-B-Q 0019500
0050-->HAM010 CLAW HAMMER 0000950
0100-->HAM020 BALL HAMMER 0001200
0150-->HAM035 JACK HAMMER 0029500
0200-->SAW011 HAND SAW 0001975
0250-->SAW012 RIP SAW 0002500
0300-->SAW051 POWER SAW 0008500
0350-->~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
debug> r
registers: p=150,u=100,v=38,x=150,z=70,
- 'rtb' tabled 40 byte records as 50 byte entries to simplify addresses
- 'lok' looks-up the table by product# key to get description & price
lokz1 pp0(50),pp0(6),a25(6) lookup table by product code
============================
- 'lok' sets register 'p' - 2nd 'p' in op1 'pp0(50)' - 1st 'p' is area 'p'
- 1st record product# a25(6) = 'HAM035' matches table entry at displacement 150,
- so: register 'p' is set to 150, and we can get:
- the price from area 'p' + $rp (150) + 30 dsplcmnt to price in table records
- the description from area 'p' + $rp + 10 dsplcmnt to dscrptn in table records
- so we can: store price, calc extended amt,& store description as follows:
mvn b40(7),pp30(7) price from table
mpy b48(9),b32(6) master price * item qty = am
man28 mvc b58(16),pp10 product dscrptn from table
===================
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
J9. Debugging uvcopy jobs (rop=d)
debug session#2 (extendsales1) - continued
debug> g3 man90 <-- goto man90 (label at EOF)
2472 man90 cls all
debug> c <-- display counters at EOF
counters: ca1=1785500,
- extended amounts accumulated in $ca1 to display EOF Total (as shown below)
debug> G
ERROR - product code not found SAW099
20201119:044903:extendsales1: EOF fili01 rds=6 size=234: dat1/salesitems
20201119:044903:extendsales1: EOF fili02 rds=7 size=266: dat1/productmaster
20201119:044903:extendsales1: EOF filo01 wrts=6 size=416: tmp1/salesextended
Total sales = 1660500 in tmp1/salesextended
uvcopy extendsales1 start 2020/11/19_11:04:35 end 11:04:49 elapsed 000_14_125
EOJ, Output File written to: tmp1/salesextended
----- enter: vi,cat,more,lp,uvlp13,etc (default null) --> cat
130140 20200802 IN001001 HAM035 000010 0029500 000295000 JACK HAMMER
139923 20200802 IN001002 SAW011 000020 0001975 000039500 HAND SAW
139923 20200802 IN001003 HAM020 000030 0001200 000036000 BALL HAMMER
250825 20200804 IN001104 BBQ010 000040 0019500 000780000 BAR-B-Q
250825 20200804 IN001004 SAW099 000050 0000000 000000000 ~~~~~~~~~~~~~~~~
401210 20200816 IN001005 SAW051 000060 0008500 000510000 POWER SAW
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
J10. debug session#3 to demo Breakpoints & Gotos
The previous Debug session on page 'J7' illustrated stepping thru the job & displaying
Data-Areas, Counters,& Registers, but did not illustrate Breakpoints & Gotos.
Please also refer backto page 'J5' which listed all instructions in extendsales1
(vs just those executed in the debug session on page 'J7').
uvcopy extendsales1,rop=d
=========================
0 opn all open all files
debug> b1 man20
debug> b2 man24
debug> b3 man30
debug> g1 <-- goto tag 'man20' (breakpoint 'b2 man20' above)
376 man20 get fili1,a0 read next sales item record
debug> g3
2120 man30 put filo1,b0 write output
debug> p a0 <-- display 1st INPUT record (in area 'a')
1 2 3 4 5 6 7 8 9 1
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
----->130140 20200802 IN001001 HAM035 000010
debug> p b0 <-- display 1st OUTPUT record (in area 'b')
1 2 3 4 5 6 7 8 9 1
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
----->130140 20200802 IN001001 HAM035 000010 0029500 000295000 JACK HAMMER
Note |
- We are now at the end of the 1st record cycle at tag 'man30'
please see tag 'man30' on the listing of extendsales1 on page 'J5'
- We now want to investigate the "ERROR - product code not found"
caused by product code 'SAW099' on record #6 in dat1/salesitems listed on 'J6' |
debug> g2 <-- goto tag 'man24' (breakpoint 'b2 man24' above)
1208 man24 msg 'ERROR - product code not found',a25(6)
debug> g3 <-- goto tag 'man30', which will be the end of the ERROR record#6
ERROR - product code not found SAW099
2120 man30 put filo1,b0 write output
debug> p a0 <-- display INPUT record#6 causing the ERROR
- product code SAW099 not found in the productmaster (tabled in memory)
1 2 3 4 5 6 7 8 9 1
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
----->250825 20200804 IN001004 SAW099 000050
debug> p b0 <-- display OUTPUT record#6 (ERROR will omit price, amopunt, description)
1 2 3 4 5 6 7 8 9 1
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
----->250825 20200804 IN001004 SAW099 000050 0000000 000000000 ~~~~~~~~~~~~~~~~
debug> c <-- display accums at end of ERROR record#6
counters: ca1=1150500, <-- total of 1st 5 good records
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
J11. debug session#3 demo Breakpoints & Gotos - Continued
debug> g5 man90 <-- goto man90 (tag at EOJ to close files)
- did not setup 'b5 man90' at begin debug
2472 man90 cls all
debug> c <-- display accums at EOF (total missing $amt of ERROR record#6)
counters: ca1=1660500, <-- total of 1st 5 & 7th records
debug> G <-- Goto EOJ (end of program)
20201119:244201:extendsales1: EOF fili01 rds=6 size=234: dat1/salesitems
20201119:244201:extendsales1: EOF fili02 rds=7 size=266: dat1/productmaster
20201119:244201:extendsales1: EOF filo01 wrts=6 size=416: tmp1/salesextended
Total sales = 1660500 in tmp1/salesextended
uvcopy extendsales1 start 2020/11/19_17:22:33 end 17:24:42 elapsed 002_09_013
EOJ, Output File written to: tmp1/salesextended
debug session#4 - demo using only 'goto's without breakpoints
Session#4 will show you do not need to set brkpts with 'b# tagxx'; you can use
goto for both setting brkpts & going to them. You must code 'g# tagxx' on 1st use
but can subsequently code just the 'g#' to goto that tagxx. Use 'b#' brkpts when
you want to plan ahead on big programs, use 'g# brkpts' for more specific bugs.
Question - Why did invalid product code 'SAW099' cause description '~~~~~~~~~~~~~~~~' ?
Session#2 on page 'J8' explained how the 'lok' (table lookup instruction)
sets register 'p' to the matching entry in the productmaster tabled in memory.
Here are just the relevant instrns.
lokz1 pp0(50),pp0(6),a25(6) lookup table by product code
skp= man26 (cc unequal if nomatch)
man24 msg 'ERROR - product code not found',a25(6)
man26 ... - omitting less relevant instrns
mvc b58(16),pp10 product dscrptn from table
man30 put filo1,b0 write output
We know the bad product code is record#6, which causes the 'lok' instrn
to set condition code unequal & executes the 'man24 msg ERROR...' instrn.
So we can use 'g1 man24' to go directly to the problem record#6, bypassing
the 1st 5 good records that do not execute the 'man24 msg ERROR' instrn.
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
J12. debug session#4 - Why product# ERRORs cause description '~~~...'
debug session#4 - investigate '~~~' description if bad product#
uvcopy extendsales1,rop=d
=========================
0 opn all open all files
debug> g1 man24 <-- go directly to man24 where ERROR detected
- bypasses 1st 5 records that have no ERROR
1208 man24 msg 'ERROR - product code not found',a25(6)
debug> g2 man28
ERROR - product code not found SAW099
1816 man28 mvc b58(16),pp10 product dscrptn from table
debug> <-- null entry to execute 'mvc b58(16),pp10' (description)
- so we can examine the output record & the registers
1968 add $ca1,b48(9) accumulate total sales for EOJ
debug> p b0 <-- display output record#6 with bad product code 'SAW099'
1 2 3 4 5 6 7 8 9 1
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
----->250825 20200804 IN001004 SAW099 000050 0000000 000000000 ~~~~~~~~~~~~~~~~
debug> r <-- display the Registers to see WHY description '~~~~~~~~~~~~~~~~' ?
registers: p=350,u=100,v=38,x=350,z=38,
- Here is the productmaster tabled in memory with displacments for each entry.
0000-->BBQ010 BAR-B-Q 0019500
0050-->HAM010 CLAW HAMMER 0000950
0100-->HAM020 BALL HAMMER 0001200
0150-->HAM035 JACK HAMMER 0029500
0200-->SAW011 HAND SAW 0001975
0250-->SAW012 RIP SAW 0002500
0300-->SAW051 POWER SAW 0008500
0350-->~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Note the '~~~...' end of table marker is at displacemnt 350 = register 'p=350'
- because the 'lok' lookup instrn ends the search on the '~~~...' marker
which is at displacment 350 & 'man28 mvc b58(16),pp10' moves the '~~~...'
- the 1st 'p' of 'pp10' is area 'p', the 2nd 'p' is register 'p' (value 350).
debug> g1 <-- could search for any more ERRORs (at tag man24)
- do not need to code 'g1 man24' (already assigned)
- will goto EOF/EOJ since only the 1 ERROR in this file
20201120:150104:extendsales1: EOF fili01 rds=6 size=234: dat1/salesitems
20201120:150104:extendsales1: EOF fili02 rds=7 size=266: dat1/productmaster
20201120:150104:extendsales1: EOF filo01 wrts=6 size=416: tmp1/salesextended
Total sales = 1660500 in tmp1/salesextended
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
J13. Debug Command 'x' to Display Hexadecimal data
Display area 'x' Reserved for Registers, Counters, etc
You can skip this page if not interested in the binary bits of how stuff works.
You don't really need to know this sicne you can address registers by their
symbolic name example: $ra for register 'a' vs x0(4b) where actually stored.
And you can address counters by thier symbolic names example, for example:
$ca1 vs x208(8b) where actually stored.
You can see the detailed layout of area 'x' at uvcopy2.htm#A1.
Here is just the 1st few Registers & Counters:
absolute | symbolic | item
address | address | description
x0(4b) $ra index register 'a'
x4(4b) $rb index register 'b'
x8(4b) $rc index register 'c'
... ... ...
x100(4b) $rz index register 'z'
x200(8b) $ca0 user counter set 'a' counter# 0
x208(8b) $ca1 user counter set 'a' counter# 1
... ... ...
x392(8b) $ca24 user counter set 'a' counter# 24
x1800(8b) $ci0 instruction counter i0
... ... ...
But, you can display area 'x' if desired, for example, here is the 1st 300 bytes of area 'x'
at label 'man90' (EOF) from 'extendsales1' shown on page 'J5'.
px3 x0(100) - display area 'x' in hexadecimal - area 'x' reserved for Registers, Accumulators, etc
1 2 3 4 5 6 7 8 9 100
0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
0000-->................................................................................d...&...............
0000000000000000000000000000000000000000000000000000000000009000000000000000000060002000000090000000
0000000000000000000000000000000000000000000000000000000000006000000000000000000040006000000060000000
0100-->F...........X.......G...:...................................(................................L......
40000000000058000000410031001000000000000000E10001000F00E0002000900000000000000000000000000004000000
600000000000804000007B00AB001000000000000000C30009000A008300810000000000000000000000000000000C000000
0200-->........X...........................................................................................
0000000058000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000080400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
- Registers are 4 bytes binary, $ra at x0(4b), $rb at x4(4b), $rc at x8(4b), etc... $rz at x100(4)
- see above $rp at byte 60 = 9*16=144 + 6*1=6 = 144+6 = 150 (dsplcmnt to 4th entry in product table
- better to use 'r' displays all non-zero registers, Example: registers: p=150,u=100,v=38,x=150,z=70,
- Counters are 8 bytes binary, $ca0 at x200(8b), $ca1 at x208(8b), etc... $ca24 at x192(8b)
- see above $ca1 at 0208 = x'588004', big-end = x'048058' = (4*65536 = 262,144 + 8*4096 = 32,768
+ 5*16 = 80 + 8*1 = 8) = 295,0000 decimal
debug> r
registers: p=150,u=100,v=38,x=150,z=70,
debug> c
counters: ca1=295000,
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
K1. analyze uvcopy usage of areas, registers,& counters
'uvcopystat1' analyzes uvcopy code, table summarizing usage of areas, registers,
& counters. This is handy when you want to modify a uvcopy job that you wrote
some time ago.
Here is the listing of 'uvcopystat1' which includes operating instructions &
sample report for the 'chkdig10' job (also listed further below).
# uvcopystat1 - analyze uvcopy code
# - usage of: areas, registers,& counters
#
# uvcopy uvcopystat1,fili1=pf/demo/chkdig10,filo1=tmp/chkdig10
# ============================================================
#
# ** sample reports **
#
# uvcopystat1 2010/05/12_07:55:25 areas - pf/util/chkdig10
# tbl#001 pg#001 -argument-
# line# count % area
# 1 7 35 a
# 2 1 5 b
# 3 7 35 c
# 4 2 10 d
# 5 3 15 e
# 20*100 *TOTAL*
#
# uvcopystat1 2010/05/12_07:55:25 areas+regs - pf/util/chkdig10
# tbl#002 pg#001 -argument-
# line# count % area+register
# 1 1 50 ai
# 2 1 50 bi
# 2*100 *TOTAL*
#
# uvcopystat1 2010/05/12_07:55:25 registers - pf/util/chkdig10
# tbl#003 pg#001 -argument-
# line# count % register
# 1 1 25 $re
# 2 3 75 $ri
# 4*100 *TOTAL*
#
# uvcopystat1 2010/05/12_07:55:25 counters - pf/util/chkdig10
# tbl#004 pg#001 -argument-
# line# count % counter
# 1 3 23 $ca0
# 2 4 30 $ca1
# 3 6 46 $ca2
# 13*100 *TOTAL*
#
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
rop=r1 # prompt for report disposition at EOJ
fili1=?uvcopyxx,typ=LST,rcs=256
filo1=tmp/$fili1,typ=LSTt,rcs=256
@run
opn all
#
# begin loop to get uvcopy code line, analyze,& table
man20 get fili1,a0 get next line
skp> man90
cmc a0(1),'#' comment ?
skp= man20
#
# squeeze & fix depending on tag present or not
man22 mvc b0(80),a0
sqzc1l1 b0(30),' ' presume no tag
cmc a0(1),' ' no tag ?
skp= 1
sqzc1 b0(30),' ' squeeze for tag
fix c0(20),b0(30),3,' ' separate tag/opcode/operands on ' 's
fix c200(20),c40(20),3,',' split operands on ','s
mvc c40(60),c200 aesthetic alignment
#
cmcp c40(2),'@#' op1 area ?
skp= area1
cmcp c40(3),'@@#' op1 area+register ?
skp= areg1
cmc c40(2),'$r' op1 register ?
skp= reg1
cmc c40(2),'$c' op1 counter ?
skp= ctr1
skp man40
#
area1 tblt1 c40(1),'area'
skp man40
#
areg1 tblt2 c40(2),'area+register'
skp man40
#
reg1 tblt3 c40(3),'register'
skp man40
#
ctr1 tblt4 c40(5),'counter'
skp man40
#
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
# analyze operand 2
man40 cmcp c60(2),'@#' op2 area ?
skp= area2
cmcp c60(3),'@@#' op2 area+register ?
skp= areg2
cmc c60(2),'$r' op2 register ?
skp= reg2
cmc c60(2),'$c' op2 counter ?
skp= ctr2
skp man20
#
area2 tblt1 c60(1),'area'
skp man20
#
areg2 tblt2 c60(2),'area+register'
skp man20
#
reg2 tblt3 c60(3),'register'
skp man20
#
ctr2 tblt4 c60(5),'counter'
skp man20
#
# EOF - dump tables to output file
man90 tbpt1s2 filo1,'areas - $fili1'
tbpt2s2 filo1,'areas+regs - $fili1'
tbpt3s2 filo1,'registers - $fili1'
tbpt4s2 filo1,'counters - $fili1'
cls all
eoj
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
K2. analyze uvcopy usage of areas, registers,& counters
chkdig10 - input to uvcopystat1 (above)
# chkdig10 - calc check digit for Canadian Social Insurance Number
# - SIN# is 9 digits, modulus 10, weights 121212120
# - if 8 digits keyed, calc chkdig & display
# - if 9 digits keyed, calc chkdig & compare to 9th digit
# - display results & ok/bad status & request another # or 'q' to quit
@run
loop msg 'calc/verify check digit - CDN SIN# mod10 wts 121212120'
msgwn 'enter # (8 digits to calc, 9 digits to check, "q" to end)'
mvc a0(10),$reply save in w/s
cmc a0(1),'q' quit ?
skp= eoj yes - goto end job
cmc a9(1),'0' 10 digits entered ?
skp< calc
msg 'ERROR: number too long, only 8 or 9 is valid'
skp loop
# clear accumulator & registers
calc mvn $ca1,0 clear counter a1 for sum of products
mvn $ri,0 clear rgstr 'i' index for digits & wts
# calc sum of the products
mvc b0(9),'121212120' setup weights
lup1 mvn $ca0,ai0(1) store current digit for mpy
mpy $ca0,bi0(1) cur digit * cur weight
mvn e0(2),$ca0 cnvrt product to 2 digits zoned
add $ca1,e1(1) accumulate units digit
add $ca1,e0(1) also accum tens digit if any
add $ri,1 inc rgstr a for phn#
cmn $ri,9 9 digits complete ?
skp< lup1
# calc: check digit = (10 - units digit of sum of products)
mvn $ca2,10 setup constant 10 for subtract
mvn d0(1),$ca1 isolate units digit from counter
sub $ca2,d0(1) subtract units digit of sum of products
cmn $ca2,10 chkdig 0 ? (10-0 = 10)
skp! 1
mvn $ca2,0 yes - make chkdig 0 (not 10)
# setup msg, insert data, then modify depending on calc, good, bad
mvc c0(40),'check digit of 987654321 is x '
mvc c15(9),a0 insert phn# entered by oprtr
mvn c28(1),$ca2 insert calculated check digit
# if only 8 digits keyed, display number & calculated check digit
cmc a8(1),' ' 9th digit keyed ?
skp> chk
skp msg go display & end job
# 9 digits keyed - compare & issue good or bad msg
chk cmn a8(1),$ca2 entered 9th digit = calculated chkdig ?
skp! bad
mvc c31(2),'ok' modify msg to ok
skp msg go display & endjob
# miscompare - modify msg to bad, display,& endjob
bad mvc c31(7),'*NOT* x'
mvn c37(1),a8(1) insert user# chkdig
msg msg c0(40) display msg (+ ok or bad)
skp loop return to solicit another #
eoj eoj
Goto:
Begin this document ,
End this document ,
UVSI Home-Page
Visitor Counters for ThisYear and LastYear