uvcopy2.doc CONTENTS - work areas, options, match chars, registers, debugging

uvcopy documentation continued from uvcopy1.doc

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' - table entry pointer storage
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)
C4.   file TYP options, append on TYP codes (example 'td3' of typ=LSTtd3)
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)
  instruction counter summary by instruction
J1. DEBUGGING uvcopy jobs
J2.   DEBUGGER COMMANDS
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)

  1. logical: mvc,mvf,mvr,mvp,cat,clr,edt,anc,orc,xor,shf
  2. arithmetic: mvn,add,sub,mpy,div,pac,unp,xft
  3. comp/test/skip: cmc,cmn,skp,nop,tst,tsb,mwb
  4. sequential I/O: opn,cls,get,put,rel,rtb,wtb
  5. Indexed I/O: set,red,wrt,upd,del,lck,ulk
  6. message&control: msg,can,eoj,tim,wat,bal,ret,bcr
  7. translation: tra,tre,trl,tru,trt,hxc,chx,vhx
  8. scan&replace: scn,rep,mvu,sct,rpt,sts,rts
  9. squeeze-insert: sqz,sqf,jus,cnt,ins,ctr
  10. conversion: fix,var,dlm,und,swp,dat,rfm
  11. special: sys,lok,pop,fxt,env,evt,vnf,xxa,xxb,xxc
  12. sort: sxo,sxp,sxs,sxg,sxc,srt
  13. 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 4096 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 4096 bytes & may be increased via the 'was'
    function, was=a8000b16000 would assign 8000 bytes to a & 16000 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 4096 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(4b)      $rem      remainder of last divide
 x108(4b)      $pid      UNIX process-id
 x112(4b)      $ppid     UNIX parent process-id
 x116(4b)      $icnt     uvcopy instruction count
 x120(4b)      $cc       post-instruction condition code
                         set by various instructions (cmc,cmn,get,etc)
                         tested by skp< skp= skp>
 x124(4b)      $iserr    ISAM error number (set by get,red,upd,wrt,etc)
                         ex: red sets to 111 if record not found
 x128(4b)                ISAM status code 1 (D-ISAM)
 x132(4b)                ISAM status code 2
 x136(4b)                ISAM most recent I/O function #
 x140(4b)                ISAM current record number
 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 L32/L64 (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)
 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(max116)

 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

 y0(8)      $date1     system date when execution began 'ccyymmdd'
            $ccyymmdd  same as $date
 y2(6)      $yymmdd    date in 6 digits
 y8(6)      $time1     system time in seconds since 1970 (UNIX time)
 y16(4b)    ---------  UNIX time (seconds since 1970) when execution began
 y20(10)    $date      program execution start date edited 'ccyy/mm/dd'
 y31(8)     $time      program execution start time edited 'hh:mm:ss'
 y20(19)    $datetime  system date/time edited 'ccyy/mm/dd_hh:mm:ss'
                       stored when program execution began
            $datetime1 same as $datetime
 y40(8)     $date2     current system date & time returned by the 'tim' instrn
                       - initially same as program execution time
                       - also updated by 'sys' & file closes
 y48(6)     $time2     system time in seconds since 1970 returned by 'tim'
                       - initially same as program execution time
                       - also updated by 'sys' & file closes
 y56(4b)               UNIX time (seconds since 1970) stored by tim,msg,EOF
 y60(19)    $datetime2 current system date & time edited 'ccyy/mm/dd_hh:mm:ss'
                       stored by 'tim' 'sys' & file closes
 y80(4)     $version   program version# (0206 etc)
 y85(2)     $license   license agreement# 1a,1b,etc
 y90(9)     $regno     program registration# yymmdd##a
 y100(30)   $sitename  registered site name
 y120(20)   $regname   registered recipient person name
 y150(15)   $dtstamp   date/time stamp ':yymmdd:HHMMSS:'
 y170(30)   $jobstamp  ${JOBID}/date/time stamp 'JOBID:yymmdd:HHMMSS:'
                       (jobid will be jobname if $JOBID undefined)

y200(50) $jobname prmfile name (root name) 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

Goto:   Begin this document End this document UVSI Home-Page

A2a. work area 'y' - system information (continued)

address | $symbol | item description

 y350(17)   $adate     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

environmental 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.

 y400(6)    $mmddyy      date in mmddyy format
 y410(6)    $mmddyy      date in mmddyy format
 y420(18)   $longdate    full alpha date ex: 'September 15, 2000'
 y450(3)    $longbits    accumulator bits S64/H64/H32 depending on compile option
 y455(4)    $lf64        indicator for Large File support 'LF64' or ' '
 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)
 y800(200)  $pfpath      pathname for parameter file search
                         colon delimited multiple path names
Note
  • see details of PFPATH environmental variable for uvcopy
    parameter file search in E1 of uvcopy1.doc

Goto:   Begin this document End this document UVSI Home-Page

A2b. 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
 y2800(200) $rscale     register scale -->a   b   c   d   e   f   g   etc
                        scale for debug command 'r' & available to user
                        displayed automatically when debug user displays
                        area x (xx0 to xx150)
 debug>    --->a   b   c   d   e   f   g   h   i   j   k   l   m   n   o   p
               3100000000000000000000000000000000000000000000000000000000000000
               A200000000000100000000000000000030003000000000000000000000000000
 debug> registers: a=4662,d=256,i=3,j=3,u=31,y=3,z=20,
 y3000(100)  $uops      user options (unprocessed string eg: q0i7 etc)
 y3150(50)   $rops      run options  (unprocessed string)
 y3200(300)  $zeros     zero characters for clearing numeric char fields
 y3500(200)  $pfname    prmfile name (full path name)
                      - same as $jobname if no path specified

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:

  1. $symbol addresses
  2. $symbol constants
  3. $symbol addresses, user defined
  4. ${environmental-variables}
  5. $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
  1. $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

  1. 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
  1. ${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####

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'
        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 ?

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)
 $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
            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

 $date1     y0(8)        date when uvcopy began execution yyyymmdd
 $ccyymmdd  y0(8)
 $yymmdd    y2(6)        date in 6 digits yymmdd
 $time1     y8(6)        time when uvcopy began execution HHMMSS
 $date      y20(10)      date when execution began 'yyyy/mm/dd'
 $time      y31(8)       time when execution began 'hh:mm:ss'
 $datetime  y20(19)      date/time when execution began 'yyyy/mm/dd_hh:mm:ss'
 $datetime1              same as $datetime
 $date2     y40(8)       date stored by tim,msg,EOF  yyyymmdd
 $time2     y48(6)       time stored by tim,msg,EOF  HHMMSS
 $datetime2 y60(19)      date/time stored by tim,msg,EOF 'yyyy/mm/dd_hh:mm:ss'
 $version   y80(4)       uvcopy program version# 1.15, etc
 $sitename  y100(30)     registered site name (licensee)
 $regname   y130(20)     registered recipient person name
 $dtstamp   y150(15)     date/time stamp ':yymmdd:HHMMSS:'
 $jobstamp  y170(30)     ${JOBID}/date/time stamp 'JOBID:yymmdd:HHMMSS:'
                         (jobid will be jobname if $JOBID undefined)
 $jobname   y200(50)     job-name or parameter file name (root filename)
 $hostname  y280(20)     unix HOST name
 $isamtyp   y320(8)      ISAM file handler linked to uvcopy
                         - 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
 $adate     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'

Goto:   Begin this document End this document UVSI Home-Page

B7a. $symbol addresses - SPECIAL (continued)

 $machine = y370(5)     machine or OS type
                        (LNX, HP, SUN, AIX, DOS)
 $longbits= y375(5)     accumulator length code H32/S64/H64, depending on
                        compile option (see install.doc vol 1)
 $jobid   = y380(20)    ${JOBID} environment variable
                        UV convention for name of calling script
                        (must export JOBID=xxxxxx in calling script)
          = y400(100)   $PATH environment variable
Note
  • ${PATH} disabled as of April 1998 (problem if very long PATH)
  • can use 'env' instruction into a big work area
 $mmddyy  = y400(6)      date in mmddyy format
 $ddmmyy  = y410(6)      date in ddmmyy format
 $longdate= y420(18)     full alpha date ex: 'September 15, 2000'
 $cwd     = y500(50)     current working directory
 $logname = y550(50)     $LOGNAME environment variable
 $home    = y600(50)     $HOME environment variable
 $mail    = y650(50)     $MAIL environment variable
 $binpath = y700(50)     pathname of executing program (uvcopy)
 $pfpath  = y800(200)    pathname for parameter file search
                       - PFPATH colon delimited as of May 2003
                       - replacing PFPATH1, PFPATH2, PFPATH3, PFPATH4
 $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

Goto:   Begin this document End this document UVSI Home-Page

B7b. $symbol addresses - SPECIAL (continued)

 $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
 $rscale   y2800(200)  register scale -->a   b   c   d   e   f   g   etc
                       scale for debug command 'r' & available to user
                       displayed automatically when debug user displays
                       area x (xx0 to xx150)
 debug>    --->a   b   c   d   e   f   g   h   i   j   k   l   m   n   o   p
               3100000000000000000000000000000000000000000000000000000000000000
               A200000000000100000000000000000030003000000000000000000000000000
 debug> registers: a=4662,d=256,i=3,j=3,u=31,y=3,z=20,
 $uops     y3000(100)   user options (unprocessed eg: q0i7 etc)
                        x'00' filled on right
 $rops     y3100(50)    run options  (unprocessed string)
                        x'00' filled on right
 $zeros    y3200(300)     zero characters for clearing numeric char fields
 $pfname   y3500(200)   job-name or prmfile name (full path name)
                        - same as jobname if no directories specified

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

Goto:   Begin this document End this document UVSI Home-Page

B9. uvcopy $symbol CONSTANTS

 $date    = y0(8)    - current date when uvcopy began execution
                     - character format yyyymmdd
 $time    = y8(6)    - current time when uvcopy began execution
                     - character format hhmmss
 $dttm    = y20(19)  - date & time when program execution began
                       character format 'yyyy/mm/dd_hh:mm:ss'

$dtstamp = y150(15) date/time stamp ':yymmdd:HHMMSS:'

 $jobstamp= y170(30)   jobid/date/time stamp 'jobid:yymmdd:HHMMSS:'
                       (jobid will be jobname if $JOBID undefined)
 $jobname = y200(50)       job-name or parameter file name (root filename)
 $jobpath = y3500(200)     job-name or prmfile name (full path name)
 $jobid   = y380(20) - from environmental variable export JOBID=????
                     - Van Util JCL converter defines JOBID in scripts
                       that might call uvcopy
                     - defaults same as uvcopy jobname if undefined
 $jobid   = y380(20) - UPPER or lower case
       mvc   h0(50),'ABC Ltd.  A/R Overdue List  $date  $time '
      mvf   h50(60),'A/R file = fff $date'
      repf  h50(60),'fff',$fili1

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
       lod=qq0(48),custmas,c   # load $symbols from custmas file in fild7
       fild7=uvsymbols,rcs=80,typ=DIR
       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

  1. You must code environmental variables using the ${...} convention so uvcopy can recognize them vs internal $symbols such as $datetime.

  2. 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.

  3. 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

  1. 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

  2. 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 ?

  3. file options - appended to the typ spec of file declarations - applies to that particular file - example: typ=LSTt (t option truncates trailing blanks)

  4. instruction options - appended to individual instructions - applies only to that instruction - example: trlq1 (q1 inhibits translate within quotes)

  5. 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)

  6. 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
  1. Options must be 1 contiguous string with no blanks (except in quotes).

  2. Valid options are the 26 lower case letters.

  3. The letter options may be specified in any sequence.

  4. Each letter used should only be specified once in the string.

  5. 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.

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)
e1
  • Ebdic input file, translates RDW error data
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'
h2
  • halt at end of uvcopy job, until operator presses enter
i1
  • inhibit uvcopy startup msg #1 (version, date, prmfile name)
i2
  • inhibit uvcopy startup msg #2 (copyright, rgstrn#, name)
i4
  • inhibit 'opr' messages
i7
  • inhibit all the above messages
i8
  • inhibit the prompt for ?filename changes
  • caused by prefix '?' on fili1=?filename, filo1=?filename, etc
i16
  • inhibit msg prompts (msgw) & prompts for report disposition
  • also inhibits user option prompt for option changes (same as uop=q0)
i32
  • inhibit uvcopy EOF statistics msgs (record counts, etc)
i63
  • inhibit all msgs above (dont use this unless files coded correctly)
i31
  • inhibit all msgs except prompts for EOF stats & sort status
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

Goto:   Begin this document End this document UVSI Home-Page

C1a. 'rop' - uvcopy RUN options - continued

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'
t2
  • loads alternate ASCII to EBCDIC translate table
    characters > x'80' translated to EBCDIC blank x'40'
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

Goto:   Begin this document End this document UVSI Home-Page

C1b. 'rop' - uvcopy RUN options - continued

x
  • Report Disposition Command defaults
x1
  • 'vi' - unix/linux editor
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
     fili1=tf/cusmas
 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

The options are cumulative; any repeated option letter values would 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 uvcopy startup msg #1 (version, date, prmfile name)
i2
  • inhibit uvcopy startup msg #2 (copyright, rgstrn#, name)
i4
  • inhibit 'opr' messages
i7
  • inhibit all the above messages
i8
  • inhibit the prompt for ?filename changes
  • caused by prefix '?' on fili1=?filename, filo1=?filename, etc
i16
  • inhibit the prompt for report disposition
  • also inhibits user option prompt for option changes (same as uop=q0)
i32
  • inhibit uvcopy EOF statistics msgs (record counts, etc)
i63
  • inhibit all msgs above (dont use this unless files coded correctly)
i31
  • inhibit all msgs except the prompt for ?filename changes

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=DIR
  • DIRectory file records
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

C4. uvcopy 'file typ' options

 fili1=testinp,typ=RSFb16m500,rcs=128
                      *******             - typ option examples
 filo1=testout,typ=LSTdtw,rcs=128         - lower case suffixes to typ
                      ***
a
  • append to the file's existing contents
    (vs default of erasing existing contents)
b1
  • reduce multiple blank lines to 1 blank line
b2
  • remove ALL blank lines
c1
  • convert unprintable characters to periods
c2
  • convert unprintable characters to blanks
c4
  • convert tabs x'09' to 4 blanks
c8
  • convert tabs x'09' to 1 blank
c__
  • apply to typ=LST files input &/or output
d1
  • insert record terminator CR x'0D' for typ=LST & typ=RST files
    (a single CR vs LF for unix vs CRLF for DOS option d1)
  • CR is appended for output records & removed from input records
  • may use this for McIntosh files
d2
  • inserts LF x'0A' on output, remove on input (typ=LST & typ=RST files)
  • d2 is the default (for UNIX files)
d3
  • MSDOS file, inserts CR (and LF) when writing typ=LST/RST files
  • removes when reading into the input area
d4
  • insert null as terminator on output typ=LST files
d8
  • insert tilde as terminator on output typ=LST files
e2
  • insert EBCDIC Line-Feed x'25' in last byte of record (typ=RSTe2)
e1
  • insert Carriage-Return x'0D' in 2nd last byte (use with e2+e1=e3)
e3
  • insert CR+LF in last 2 bytes of record (applies only to 'typ=RSTe3'
f#
  • format for typ=IDX files
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
Note
  • see page 'C7' since option 'f' is related to options 'v' 'x' 'y'
g_
  • get data types for file typ=IDXf3/IDXf8/RSV
g4
  • get active data records (default)
g2
  • get deleted data records
g6
  • get both

Goto:   Begin this document End this document UVSI Home-Page

C5. uvcopy 'file typ' options (continued)

g#
  • delimited input file, applies only to typ=LSTg#
    g# is numeric value of the delimiter character
    example: g124 specifies the pipe symbol '|' x'7C'
  • for uvqrpg only as of Feb 2008 (not yet uvcopy)
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.
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.

k#
  • set key of reference for an indexed (ISAM) file
k1
  • default retrieval sequence is via key #1
k9
  • (typ=ISFk9) causes retrieval in sequence by key #9
l0
  • No record locking
l1
  • read only file locking
l2
  • AUTOLOCK (applies only to ISAM files)
  • only 1 record locked at 1 time in this file
  • records are 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)
l8
  • NO locking, used only for Non-Indexed Sequential files
  • For non-indexed files, only lock options l0, l1, l8 apply.
Note
  • it is easier to use the 'FILE locking' options
    (l0,l1 for ISAM files; l0,l1,l8 for Sequential files)
    if you do NOT need to run 2 jobs at same time updating the same file
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)
m____
  • monitor option (report progress every ____ records)
  • applies to both input & output files (not random)
m1000000
  • default is every 1,000,000 records
m50000
  • would report every 50,000 records (m0 would inhibit)

Goto:   Begin this document End this document UVSI Home-Page

C6. uvcopy 'file typ' options (continued)

n1
  • inhibit error msg if record data length exceeds rcsz specified
  • for typ=LST files where you know there are some exceptionally long
    records you want to split these records without notification
n4
  • typ=RDW: specifies 4 byte record-size prefix Numeric digits
  • for 'typ=RDW' Record Descriptor Word variable length files
  • option typ=RDWn4 for 4 byte Numeric digits (vs binary)
  • also see typ=RDWz2 for 2 byte binary only
  • also see typ=RDWz4 for 2 byte binary + 2 bytes null (4 byte prefix)
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)
r1
  • for typ=RSRr1 Relative files (MicroFocus COBOL compatible)
  • drop record if extra byte = x'00'
s0
  • default displays EOF statistics for all file types
s1
  • inhibit the basic EOF stats line for all file types
s2
  • inhibit the 1 line ISAM summary statistics
s4
  • requests the detailed key statistics lines
    showing key start,length,type for each key
t
  • truncate trailing blanks on output typ=LST files
  • the Line Feed will be inserted after the last nonblank
    rather than at the end of the specified record size
t4
  • write output recsize same as last input recsize
  • LSTt4 inhibits the usual LSTt effect of shortening to last non-blank
    (allows trailing blanks to remain as on input record)
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)
Note
  • see option 'v' on the next page
  • variable record size for typ=ISF & typ=IDXf3/IDXf8 Indexed files
w1
  • signal EOF if x'1A' found in 1st byte of any record
  • applies to typ=LST,typ=RSF,typ=RST,typ=RSR
w2
  • warning for existing output files to be over-written
  • prompts to Overwrite, Rename, Append, @autoAppend @A,@B,@C,etc, Failjob
  • reply O/R/A/@/F
  • '@' for auto append (determines next alpha in series @A,@B,@C,etc
w6
  • inhibit the prompt, automatically append @A,@B,@C,etc
    (option w2 + w4 = w6)
w8
  • roundup output record size (pad x'20's) to multiple of 8 (vs multiple 4)
  • applies only to typ=RSVw8 output

Goto:   Begin this document End this document UVSI Home-Page

C7. uvcopy 'file typ' options (continued)

file typ options for typ=IDX & typ=RSV

Note
  • these options apply only to 'uxcopy' (not 'uvcopy')
  • 'uxcopy' includes the Micro Focus COBOL file handler (EXTFH)
  • to support variable length Indexed files
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 & record-length specified in op2 of 'put'
    output records will be the same size, but with record headers
  • if option v not specified & record-length NOT specified in op2 of put
    output records size taken from register 'v', which is set by last
    input 'get', but may be set explicitly with instrn 'mvn'
  • also see type 'y4' below to determine record size by scanning back
    from max size to the last nonblank/nonnull beyond min size
  • any option 'v' forces option 'y2' (variable format)
v#w8
  • w8 roundup output record size (pad x'20's) to multiple of 8 (vs 4)
x
  • file organization for typ=IDX files
x1
  • Sequential, no Index created
x2
  • Indexed, assumed if 'isk' (Indexed Seqntl Key) is declared
y
  • Recording Mode
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
 z4   - RDW, variable lth, recsize 1st 2 bytes binary, bytes 3&4 x'0000'
        recsize includes prefix-size + data-size (z/z0 default z4)
 z2   - RDW, prefix 2 bytes only, recsize excludes prefix size
      - used by FTP programs for transferring mainframe files to unix/linux
 z8  - same as RDWz4, but bypasses any BDW prefixes, processes only RDW records
 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
n4
  • also note option n4 = 4 byte recsize Numeric digits (vs Binary)

Goto:   Begin this document End this document UVSI Home-Page

C8. uvcopy 'file typ' options (continued)

file typ option 'v' varlth records C-ISAM/D-ISAM

v#
  • min recsize for typ=ISF C-ISAM/D-ISAM variable length Indexed files
  • max recsize specified by rcs=___
note
  • above variable length C-ISAM indexed files NOT compatible with MF COBOL
  • UVSI recommends following IDXf3/IDXf8 for variable length Indexed files
  • Micro Focus COBOL compatible
  • see uvcopy8.htm for test/demo uxcopy jobs to read/write IDXf3/IDXf8.

variable length output record size

If output record size is explicitly specified on op2 of the 'put' instruction, then the variable length record will be written with that record size.

But if op2 of the 'put' is not specified, then the record size will be taken from register 'v' ($rv), which is probably the last input record size since the 'get' instruction stores the record length in $rv.

Goto:   Begin this document End this document UVSI Home-Page

D0. uvcopy INSTRUCTION options - 3 kinds

  1. instruction options - that may be coded on any instruction

  2. instruction options - that apply to 'repeatable' instructions

  3. 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
               -------------------------------
d1
  • convert invalid digits to '0' zeros
  • applies to numeric instructions with operands of type 'z' (zoned)
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)
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
v#
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

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, 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
  • convert tabs to 4 blanks
c8 getc8
  • convert tabs to 1 blank
c1 putc1
  • convert any unprintable chars to blanks
c2 putc2
  • convert any unprintable chars to periods
c4 putc4
  • convert tabs to 4 blanks
c8 putc8
  • convert tabs to 1 blank
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
  • delete CR's
d2 getd2
  • delete LF's
d4 getd4
  • delete NULL's
d8 getd8
  • delete arg4 chars
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, 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
  • convert LF's to blanks
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
  • translate to lower case
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 scnm
  • multiple 1 byte patterns
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
  • stop read on CR
s2 gets2
  • stop read on LF (DEFAULT)
s4 gets4
  • stop read on NULL
s8 gets8
  • stop read on arg4 char
s_ puts_
  • stop write options for typ=LST files
s1 puts1
  • stop write on CR
s2 puts2
  • stop write on LF (DEFAULT)
s4 puts4
  • stop write on NULL
s8 puts8
  • stop write on stopc char
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
  • default is none
t1 gett1
  • terminate with CR
t2 gett2
  • terminate with LF
t4 gett4
  • terminate with NULL
t8 gett8
  • terminate with arg4 char
t_ putt_
  • terminate options for writing file typ=LST
t1 putt1
  • terminate with CR
t2 putt2
  • terminate with LF
  • default for UNIX (& WinDOS), if no option d on file type
t4 putt4
  • terminate with NULL
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 ?

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)
 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  ---

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
 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

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'
 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'
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'
 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'

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'

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.
       3   mvc   cx0(11),'comp-4 sync'
       4   mvc   cx11(80),by6

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'
  1. 'msgw' solicits the search pattern from the operator.

  2. 'mvc' moves the search pattern from $reply (which might be required for another msgw) to area 'd' (which is not used for anything else)

  3. '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.

  4. 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'

  5. 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

J1. uvcopy 'DEBUGGING' your uvcopy parameter files - run option 'd'

Most uvcopy programs will not require the debug option, but it can be very useful 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). Another way is to enter 'd' at the interrupt prompt, but you would have had to use ',rop=e1' to enable the interrupt.

In debug mode, uvcopy will display each instruction before execution & wait for an operator command (see commands on the next page).

sample debug session


 uvcopy cmtbl1,rop=d    - run demo job 'cmtbl1' (customer master table summary)
 ===================    - 'rop=d' causes uvcopy to display each instruction
                           and wait for operator command
                        - 'null entry' executes next instruction
         0        opn.. all
 debug>
       104 loop   get.. fili1,a0(256)
 debug>
       248        skp>. eof
 debug>
       352        xft.. $ca1,a120(5p),12
 debug>
       476        xft.. $ca2,a180(5p),12
 debug>
       600        tbl..t1f2 a60(16),'city na
 debug>
       744        tbl..t2f2 a77(2),'province
 debug>
       888        skp.. loop
 debug> d a0                           <-- 'da0' display area 'a' from byte 0
                                                 (60 bytes by default)
 debug>        012345678901234567890123456789012345678901234567890123456789
          ---->130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD
 debug> r                              <-- 'r' displays 'registers'
                                           (only non-zero registers displayed)
 debug> registers: u=80,v=80,z=256,
 debug> q                              <-- command 'q' = quit

Goto:   Begin this document End this document UVSI Home-Page

J2. uvcopy Debugging uvcopy jobs (rop=d)

Here is the debugging command summary, separated in to 2 groups (program flow & display). You can try these out using the demo uvcopy job listed later on page 'J5'.

command summary - program flow

null entry
  • single step to display next instruction & pause again
b1
  • set Breakpoint on the current instruction just displayed
b0
  • reset Breakpoint on the current instruction just displayed
d a
  • Display area 'a' from byte 0 (default) 60 bytes (default)
p a
  • p=Print same as d=Display
p a0(64)
  • print defaults to 1st 64 bytes of area
p b100(100)
  • print area 'b' bytes 100-199 (max line width 100 bytes)
p20 c0(100)
  • print area 'c' 20 lines of 100 bytes each
  • see more Display examples on next page
e b
  • Display area 'b' translating Ebcdic to ascii
g
  • Go (run) continuously to next breakpoint (or to end of job)
g9
  • Go (execute) the next 9 instructions & then stop
p a0(60)
  • Print (areas a-z)
  • see examples on next page
q
  • Quit, automatically executes the 'eoj' instruction
    to close all open files & exit the program
r
  • Register display (in decimal, only the non-zero registers)
    example: a=4662,d=256,i=3,j=3,u=31,y=3,z=20,
s1
  • set Subrtn enter mode, shows instructions between bal & ret
s0
  • set Subrtn bypass mode, skips instructions between bal & ret
  • the default is to bypass subroutine instructions
t tag
  • run until the specified Tag (label) is found
  • in larger programs, this is usually the 1st debug command
    used to get to that part of the program requiring debugging.
  • you would then single step with the null command & display
    areas with the 'd' or 'x' commands.
Note
  • The 't' is probably the MOST USEFUL DEBUG COMMAND.
  • When necessary, you can quickly add a tag to identify the
    area of the program you wish to investigate.

Goto:   Begin this document End this document UVSI Home-Page

J3. uvcopy Debugging uvcopy jobs (rop=d)

Display/Print Areas - more examples

p a
  • print area 'a' in character (area could be any of 'a' thru 'z')
  • default print width is 64 bytes
p a0(64)
  • print area 'a', from byte 0, for 64 bytes (default line width)
p5 a0(64)
  • print 5 lines from area 'a' byte 0, 64 bytes each line (default)
p b100(100)
  • print area 'b' from byte 100, for length of 100 bytes
  • max line width is 100 bytes
p10 b0(100)
  • print area 'b' from byte 0, 10 lines of 100 bytes each
pe b
  • Display area 'b' with option 'e' to translate EBCDIC to ASCII
x x0(64)
  • print 1st 64 bytes of area 'x' in vertical heXadecimal
  • Characters on line 1 with unprintable bytes replaced by periods,
    Zones on line 2,& Digits on line 3
x x
  • same as above (since displacement default 0 & length default 64)
Note
  • area 'x' is where the registers are stored
  • registers are 8 bytes binary, registers a-z occupy 1st 208 bytes of x
  • registers locations: a=x0(8b), b=x8(8b), c=x16(8b),... z=x200(8b)
x x0(64)
  • print registers a-h (1st 8 registers * 8 byte each = 64 bytes)
xe b
  • Display area 'b' with option 'e' for Ebcdic to Ascii for Char line
  • lines 2 & 3 Zones & Digits will show the EBCDIC codes
x4 a0(64)
  • print 4 64 byte segments from area 'a' in vertical hexadecimal
  • 12 lines on screen, since 3 lines (chars,zones,digits) per 64 bytes

See more sample print commands & results on the next page --->

Goto:   Begin this document End this document UVSI Home-Page

J4. uvcopy Debugging uvcopy jobs (rop=d)

print examples - commands & results

 debug> p a0
                         1         2         3         4         5         6
               0123456789012345678901234567890123456789012345678901234567890123
         ----->130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD NANA
 debug> p4 a0(64)
                         1         2         3         4         5         6
               0123456789012345678901234567890123456789012345678901234567890123
        0000-->130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD NANA
        0064-->IMO          BC V9S1H1    250-754-5531 LARRY WRENCH ..4V|...
        0128-->.........W0....`........)X}..f3.....\.................4V}...f...
        0192-->...............................f.....<........f.C 19950531
 debug> x4 a0(64)
                         1         2         3         4         5         6
               0123456789012345678901234567890123456789012345678901234567890123
        0000-->130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD NANA
               3333332222454545444244545524542222233332445442544422222222224444
               130140000056527255E0DF4F230C44E0000181502F75E02F140000000000E1E1
        0064-->IMO          BC V9S1H1    250-754-5531 LARRY WRENCH ..4V|...
               4442222222222442535343222233323332333324455525544442222201357000
               9DF00000000002306931810000250D754D55310C12290725E38000000246C000
        0128-->.........W0....`........)X}..f3.....\.................4V}...f...
               0000000005300016000000002570063100095000000000000000013570016000
               0C0000C0270D0540C0000C0098D0263C0444C0000C0000C0000C0246D0056C00
        0192-->...............................f.....<........f.C 19950531
               0000008900000000880000000018000680001300000000694233333333222222
               00C0026C0000C0023C0000C0083C0056D0012C0000C0016D3019950531000000

debug> r debug> registers: u=80,v=80,z=256,

 debug> x x80
                         1         2         3         4         5         6
 debug>           012345678901234567890123456789012345678901234567890123456789
            ----->P...P.......................................................
                  5000500000000000000000000000D000B0000000FFFF0000000000000000
                  00000000000000000000010000005A006800C000FFFF0000000000000000
 debug> x x200
                         1         2         3         4         5         6
 debug>           012345678901234567890123456789012345678901234567890123456789
            ----->........4. .....t...........................................
                  000000003820000078EFFFFF000000000000000000000000000000000000
                  000000004E00000044DFFFFF000000000000000000000000000000000000
Note
  • accumulators $ca0, $ca1, $ca2, etc are stored begining at x200
  • 8 bytes each if compile option S64/H64 (or 4 bytes each if H32)
  • above shows $ca1 as x'0000000000208E38' which is +21,335.56
  • $ca2 is x'FFFFFFFFFFED8474' which is negative -155,659.39
  • Intel stores bytes in reverse order

Goto:   Begin this document End this document UVSI Home-Page

J5. uvcopy Debugging uvcopy jobs (rop=d)

cmtbl1 - uvcopy job for debug demo

 # cmtbl1 - table analysis of customer master sales history file
 opr='$jobname - summarize sales (thisyr&lastyr) by city name & province'
 rop=r1   # prompt oprtr for report disposition at EOJ
 fili1=dat1/custmas1,rcs=256,typ=RSF
 filo1=tmp/$jobname.rpt,rcs=80,typ=LSTt
 @run
        opn    all
 # begin loop to read all customer master sales history records
 # - crossfooting & accumulating (tabling) thisyr & lastyr totals
 loop   get    fili1,a0(256)
        skp>   eof
        xft    $ca1,a120(5p),12
        xft    $ca2,a180(5p),12
        tblt1f2 a60(16),'city name;thisyr sales;lastyr sales',$ca1,$ca2
        tblt2f2 a77(2),'province;thisyr sales;lastyr sales',$ca1,$ca2
        skp    loop
 # end of file - print/edit the tables to a file for: lp, cat,or vi
 eof    tbpt1s2 filo1,'sales by city name (this yr & last yr)'
        tbpt2s1 filo1,'sales by province (this yr & last yr)'
        cls    all
        eoj

dat1/custmas1 - input data file


 uvhd filename=dat1/custmas1 r256l60     <-- display 1st record of demo file
 ===================================
                      10        20        30        40        50        6
 r#        1 012345678901234567890123456789012345678901234567890123456789
           0 130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD
             333333222245454544424454552454222223333244544254442222222222
             130140000056527255E0DF4F230C44E0000181502F75E02F140000000000
          60 NANAIMO          BC V9S1H1    250-754-5531 LARRY WRENCH
             444444422222222224425353432222333233323333244555255444422222
             E1E19DF00000000002306931810000250D754D55310C12290725E3800000
         120 ..4V|............W0....`........)X}..f3.....\...............
             013570000000000005300016000000002570063100095000000000000000
             0246C0000C0000C0270D0540C0000C0098D0263C0444C0000C0000C0000C
         180 ..4V}...f..................................f.....<........f.
             013570016000000000890000000088000000001800068000130000000069
             0246D0056C0000C0026C0000C0023C0000C0083C0056D0012C0000C0016D
         240 C 19950531
             4233333333222222
             3019950531000000

We use 'uvhd' to display the file (in vertical hexadecimal) since the records contain 24 packed 5 byte fields from bytes 120 to 240. We use option 'r256' to define the record size. We use option 'l60' to show 60 bytes per line to match the debug display on the previous page (default is 64 for uvhd).

See the uvcopy execution command & output report on the next page --->

Goto:   Begin this document End this document UVSI Home-Page

J6. uvcopy Debugging uvcopy jobs (rop=d)

executing the uvcopy demo job


 uvcopy cmtbl1,fili1=dat1/custmas1,filo1=tmp/cmtbl1.rpt
 ======================================================

 uvcopy cmtbl1    <-- easier alternative (files default as shown above)
 =============

 uvcopy cmtbl1,rop=d    <-- run with debug option
 ===================

 uvlp12 tmp/cmtbl1.rpt  <-- list report
 =====================

tmp/cmtbl1.rpt - output report

 cmtbl1  2004/08/07_08:58:41  sales by city name (this yr & last yr)
 tbl#001 pg#001     -argument-            -acum#1-    %        -acum#2-    %
 line#  count    %  city name         thisyr sales         lastyr sales
     1       4  12  CALGARY               3,150.58    3        3,274.76    7
     2       1   3  CHILLIWACK            4,478.00    4        8,610.30   18
     3       1   3  COQUITLAM             1,420.00    1
     4       1   3  DRAYTON VALLEY          228.01    0        1,765.10    3
     5       3   9  EDMONTON             20,108.35   20       27,919.97   61
     6       1   3  FORT MCMURRAY         1,000.00-   1-         849.88    1
     7       1   3  FORT ST. JOHN            52.46    0          608.06    1
     8       1   3  GRANDE PRAIRIE        1,318.41    1          427.54
     9       1   3  HOPE                     75.70    0          173.25
    10       1   3  KELOWNA                    .00    0
    11       1   3  NANAIMO              21,335.56   21       12,112.76-  26-
    12       1   3  NISKU                 5,725.00    5        1,742.59    3
    13       1   3  NORTH VANCOUVER            .00    0
    14       1   3  PORT COQUITLAM          424.48    0
    15       2   6  PRINCE GEORGE         1,781.75    1        4,395.21    9
    16       1   3  QUESNEL                  66.01    0        4,432.47    9
    17       1   3  RICHMOND                434.98    0          640.04    1
    18       1   3  SURREY               10,761.58   10
    19       1   3  THREE HILLS             340.52    0
    20       4  12  VANCOUVER            24,112.72   24        1,220.16    2
    21       1   3  WARBURG                  17.39-   0        1,534.06    3
    22       1   3  WINTERBURN                 .00    0
    23       1   3  YELLOWKNIFE           4,901.21    4
            32*100   *TOTAL*             99,697.93 *100       45,480.63 *100
 cmtbl1  2004/08/07_08:58:41  sales by province (this yr & last yr)
 tbl#002 pg#001     -argument-            -acum#1-    %        -acum#2-    %
 line#  count    %  province          thisyr sales         lastyr sales
     1       3   9  AB                      323.13    0        1,534.06    3
     2      11  34  AL                   29,530.35   29       35,979.84   79
     3      17  53  BC                   64,943.24   65        7,966.73   17
     4       1   3  NW                    4,901.21    4
            32*100   *TOTAL*             99,697.93 *100       45,480.63 *100

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