LISTjobs.doc - List Indexed/Sequential data files with selections - Contents

A1. Overview - These jobs intended primarily for data files (vs text files)
- Data files may be sequential or indexed, & might not have
  the linefeeds that are required by uvlist.
- For text files (files with linefeeds), you should use 'uvlist'
  or 1 of its many scripts (uvlp,uvlp12,etc)
- LISTjobs (listsel1/2) provide extensive record selections,
  which are not provided by uvlist.
B1. listrec1 - list long text records in 100 byte segments with scale
- any unprintable characters will be translated to periods
B2. listrec2 - list fixed length records in 100 byte segments with scale
- record length must be supplied since no LineFeeds present
C1. listhex1 - list long text records in 100 byte segments with scale
- same as listrec1, but list records in vertical hexadecimal
C2. listhex2 - list fixed length records in 100 byte segments with scale
- same as listrec2, but list records in vertical hexadecimal
D1. listISF - converts an ISAM file to a text file for listing or viewing
- will output the 1st 79 bytes of each input record (by default)
- do not need to know ISAM file record size or keys
- may bypass & select specified records, may read by any key
- prompts for output file disposition (cat,vi,lp,uvlp,or null)
E1. listsel1 - list/select records from any Indexed file
- selections on 1 or 2 fields by location & contents
- no need to know record size or indexed key locations.
- Options for bypass count & stop count (input &/or output)
- read file on any key, starting & stopping on key values
- EOF prompt for output file action (vi, cat, more, uvlp).
- output selection file left in tmp subdir with time stamp
F1. listselA - UNIX script that executes the 'listsel1' uvcopy job
- listselA makes it easier to specify the many options
  provided by the listsel1 uvcopy job
G1. listsel2 - list/select records from any Sequential file.
- same as above, but without options pertaining to indexed keys
- record sizes cannot be determined automatically for sequential
  but you can provide an indexed file with all filenames
  & record sizes for future convenience.
H1. listselB - UNIX script that executes the 'listsel2' uvcopy job
- listselB makes it easier to specify the many options
  provided by the listsel2 uvcopy job
X0. Summary of uvcopy jobs & scripts documented in this section
 (listrec1/2,listhex1/2,listISF,listsel1,listselA,listsel2,listselB)

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

B1. listrec1 - list long text records in 100 byte segments with scale

'listrec1' will list long text records in 100 byte segments with a scale.

We will demo listrec1 & illustrate the output report, using 1 of the UV test files (/home/uvadm/dat1/custmas2).

Demo Operating Instructions

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

 uvcopy listrec1,fili1=dat1/custmas2  - execute uvcopy/listrec1/demo file
 ===================================
 tmp/custmas2.lst = default filo1 - null accept or reenter ?
 listrec1:990911:113315: EOF fili1 32 rds, 0 wrts, 4096 size; dat1/custmas2
 listrec1:990911:113315: EOF filo1 0 rds, 99 wrts, 3695 size; tmp/custmas2.lst
 enter vi/more/lp/uvlp/uvlp12/uvlp14/.../null
                          --> uvlp14 <-- uvlp14 to get 100 chars on 8 1/2"

sample output report

         10        20        30        40        50        60        70        80        90       100       110       120
 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
 0001:0000 130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD          NANAIMO          BC V9S1H1    604-754-55
      0100 31JOHN HENRY
      0127
 0002:0000 139923    JOHNSTONE BOILER & TANKS 1250 EAST PENDER STREET  VANCOUVER        BC V5L1W1    604-320-18
      0100 45GEORGE BROWN
      0127
 0003:0000 147615    O'CONNER R.V. CENTRE     44430 YALE ROAD WEST     CHILLIWACK       BC V2P6J1    604-858-41
      0100 61BONNIE
      0127

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

B2. listrec2 - list fixed length records, 100 chars/line

'listrec2' will list fixed length records in 100 byte segments with scale. Replace any unprintable characters with periods ('.'s). Options available for recsize, listsize, max records, space 2, translate (see below).

We will demo listrec2 & show the output report, using test/demo file: /home/uvadm/dat1/custmas1 - 256 byte records with 24 packed fields 121-240


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

 uvcopy listrec2,fili1=dat1/custmas1,uop=r256l100m10
 ===================================================
 - options r256 Recsize, l100 Listsize, m10 max recs (dflt space 1, no trnslt)
 - we also entered options below at prompt, redundant since on command line

console log

 uop=q1r256l100m20s1t0 - option defaults
       r256            - recsize default 256 (max 8000, add 1 if Indexed)
           l100        - List size defaults to 1st 100 only
               m20     - list 20 records Max & end job
               m99     - probably would not want to list high numbers
                       - "rop=c99" same (Run OPtion vs User OPtion)
                       - "rop=b99" could be used to Bypass records
                  s1   - space 1 (no space between records)
                  s2   - space 2 (leave 1 blank line between records)
                    t1 - Translate from EBCDIC to ASCII
 uop=q0r950l200m50s2t1 Ex: Recsize 950, List 200, Max 50, Space 2, Translate
 uop=q0r256l100m20s1t0 <-- defaults
 User OPtion (uop) defaults  = q1r256l100m20s1t0r256l100m10
  null to accept or enter/override --> r256l256m3s2 <-- enter here if not above
 tmp/custmas1.lst = default filo01 - null accept or reenter ?
 080409:071610:listrec2: EOF fili01 rds=10 size=8192: dat1/custmas1
 080409:071610:listrec2: EOF filo01 wrts=14 size=1357: tmp/custmas1.lst
 EOJ, Output File written to: tmp/custmas1.lst
 enter command: vi,cat,more,lp,uvlp12,null -->

sample output report

 listrec2 - list (100 bytes/line) file=dat1/custmas1 2008/04/09_07:04:55
                1         2         3         4         5         6         7         8         9        10
 seq#  1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
 00001 130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD          NANAIMO          BC V9S1H1    250-754-55
 00002 132588    GEECOE GENERATOR SERVICESUNIT 170 - 2851 SIMPSON  RICHMOND         BC V6X2R2    604-278-44
 00003 139923    JOHNSTONE BOILER & TANKS 1250 EAST PENDER STREET  VANCOUVER        BC V5L1W1    604-320-18
 00004 142175    LILLY ELECTRIC (1973) LTD16809 - 24TH AVENUE      SURREY           BC V4B5E7    604-534-97
 00005 145264  D MAGRATH SUPPLIES LTD.    1939 KIRSCHNER ROAD      KELOWNA          BC V1Y4N7    250-843-29
 00006 147615  X O'CONNER R.V. CENTRE     44430 YALE ROAD WEST     CHILLIWACK       BC V2P6J1    604-858-41
 00007 149304    POINT GREY GOLF & COUNTRY3350 S.W. MARINE DRIVE   VANCOUVER        BC V6N3Y9    604-732-55
 00008 150825    RIGGERS INDUSTRIAL       960 - 6TH AVENUE         HOPE             BC           604-858-47
 00009 152355    SHAW, JOHN               477 CARIBOO CRES.        PORT COQUITLAM   BC V3M1X1    604-291-62
 00010 154688    TAURUS RESOURCES         1110 - 625 HOWE STREET   VANCOUVER        BC V6C2T6    604 685 85

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

B3. listrec2 - list fixed length records, 100 chars/line

listrec2 with packed fields

We will now rerun listrec2 to list the entire 256 byte record of dat1/custmas1 including the 24 packed fields in 121-240 to illustrate that unprintable characters are replaced by '.' periods.


 uvcopy listrec2,fili1=dat1/custmas1,uop=r256l256m5s2
 ====================================================
 - options r256 Recsize, l256 Listsize, m5 max recs (space 2, no trnslt)
Note
  • we will omit the console log (similar to prior demo)

sample output report

 listrec2 - list (100 bytes/line) file=dat1/custmas1 2008/04/09_07:18:59
                1         2         3         4         5         6         7         8         9        10
 seq#  1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
 00001 130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD          NANAIMO          BC V9S1H1    250-754-55
       31 LARRY WRENCH     ..4V|............W0....`........)X}..f3.....\.................4V}...f....E|...V}
       .......................f.....<........f.C 19950531
 00002 132588    GEECOE GENERATOR SERVICESUNIT 170 - 2851 SIMPSON  RICHMOND         BC V6X2R2    604-278-44
       88 HARRY LIGHT      ...h....8\........U\.............hl........p....#....%<........6.........G......
       ...........................B.<..........A 20030430
 00003 139923    JOHNSTONE BOILER & TANKS 1250 EAST PENDER STREET  VANCOUVER        BC V5L1W1    604-320-18
       45GEORGE BROWN      ...R..........................................................................G\
       ...Il...........................vBL..c.]C 19970131
 00004 142175    LILLY ELECTRIC (1973) LTD16809 - 24TH AVENUE      SURREY           BC V4B5E7    604-534-97
       87 FRITZ BERNAUS    ............v...................................................................
       ........................................C 20001231
 00005 145264  D MAGRATH SUPPLIES LTD.    1939 KIRSCHNER ROAD      KELOWNA          BC V1Y4N7    250-843-29
       87                  ................................................................................
       ........................................C 19970131
Note
  • see 'listhex2' below to show the contents of the packed fields
  • by listing in 'vertical hexadecimal'

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

C2. listhex2 - list fixed length records in vertical hexadecimal

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

We will demo listhex2 & show the output report, using test/demo file: /home/uvadm/dat1/custmas1 - 256 byte records with 24 packed fields 121-240


 uvcopy listhex2,fili1=dat1/custmas1,uop=r256l256m3s2t0
 ======================================================
 - options r256 Recsize, l256 Listsize, m3 max recs, space 2, no trnslt
 - we also entered options below at prompt, redundant since on command line
 uop=q1r256l100m20s1t0 - option defaults
       r256            - recsize default 256 (max 8000, add 1 if Indexed)
           l100        - List size defaults to 1st 100 only
               m20     - list 20 records Max (default) & end job
               m99     - probably would not want to list high numbers
                  s1   - space 1 (no space between records)
                  s2   - space 2 (leave 1 blank line between records)
                    t1 - Translate char-line from EBCDIC to ASCII
 uop=q0r256l100m20s1t0 <-- defaults
 User OPtion (uop) defaults  = q1r256l100m20s1t0r256l256m3s2
  null to accept or enter/override --> r256l256m3s2 <-- enter here if not above
 tmp/custmas1.hex = default filo01 - null accept or reenter ?
 080409:072143:listhex2: EOF fili01 rds=3 size=8192: dat1/custmas1
 080409:072143:listhex2: EOF filo01 wrts=33 size=2768: tmp/custmas1.hex
 EOJ, Output File written to: tmp/custmas1.hex

sample output report

 listhex2 - list Vertical Hexadecimal file=dat1/custmas1 2008/04/09_07:10:35
                1         2         3         4         5         6         7         8         9        10
 seq#  1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
 00001 130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD          NANAIMO          BC V9S1H1    250-754-55
       3333332222454545444244545524542222233332445442544422222222224444444222222222244253534322223332333233
       130140000056527255E0DF4F230C44E0000181502F75E02F140000000000E1E19DF00000000002306931810000250D754D55
       31 LARRY WRENCH     ..4V|............W0....`........)X}..f3.....\.................4V}...f....E|...V}
       3324455525544442222201357000000000000530001600000000257006310009500000000000000001357001600004700057
       310C12290725E38000000246C0000C0000C0270D0540C0000C0098D0263C0444C0000C0000C0000C0246D0056C0035C0046D
       .......................f.....<........f.C 19950531
       00000000880000000018000680001300000000694233333333222222
       0000C0023C0000C0083C0056D0012C0000C0016D3019950531000000
 00002 132588    GEECOE GENERATOR SERVICESUNIT 170 - 2851 SIMPSON  RICHMOND         BC V6X2R2    604-278-44
       3333332222444444244445454525455444554452333222333325445544225444444422222222244253535322223332333233
       13258800007553F5075E5214F20352693535E9401700D02851039D03FE002938DFE40000000002306682220000604D278D44
       88 HARRY LIGHT      ...h....8\........U\.............hl........p....#....%<........6.........G......
       3324455524444522222200060001350000000055000000000000066000000007800021000230000000030000000014100000
       880812290C97840000000048C0088C0000C0055C0000C0000C0058C0000C0030C0013C0045C0000C0056C0000C0067C0000C
       ...........................B.<..........A 20030430
       00000000000000000000000000041300000000004233333333222222
       0000C0000C0000C0000C0000C0027C0000C0000C1020030430000000

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

D1. listISF - list any indexed file (MicroFocus compatible)

listISF
  • list any ISAM file
    (copy to a text file for subsequent lp or vi)
  • ISAM file may have up to 9 keys & rcsz up to 4096 bytes
  • may specify desired key for retrieval sequence
  • may specify output file type & record size may be shortened
    to drop off the tail end of long records

demo operating instructions


 uvcopy listISF,fili1=dat1/custmast
 ==================================
 uop=q1r80  - user option default
       r0   - indicates output rcsz to be taken from input rcsz
       r80  - output rcsz will be 1st 80 of input (try for demo)
 User OPtion (uop) defaults  = q1r80
 null to accept or re-specify (1 or more) --> r76    <-- 76 column output
 ISFk1 = typ default fili1 - null accept or enter new typ ?
                                          ---> ISFk3 <-- to read by key#3
                                               ^^^^^
 RST = typ default filo1 - null accept or enter new typ ?
                                          --->       <-- null for default

EOF fili1 32 rds, 0 wrts, 0 upds, 0 dels, 0 hits, 0 size, fname=dat1/custmast dat1/custmast DISAM STATS: recs=32,rcsz=128,keys=9,keysz=1024 EOF filo1 0 rds, 32 wrts, 0 hits, 2304 size, fname=listISF.tmp

 display/edit/print/none ? (enter: cat/vi/lp[-dp?]/null)
                                         --> vi     <-- display report

output file (listISF.tmp)

 306959    356582 ALBERTA LTD.      DEVITT NURSERY           CALGARY
 308685    FOOTHILLS ELECTRIC       3932 - 3A ST. N.W.       CALGARY
               - - - - - etc (32 records) - - - - -
 211140  D FORD NEW HOLLAND         BOX 1, 440 ELLIS ROAD    WINTERBURN
 234300    TERRITORIAL REWIND       BPX 1648                 YELLOWKNIFE
note
  • uop=r76 has truncated records at 76 bytes
  • typ=ISFk3 reads by key #3 (city sequence)

try--> rerunning this job, specifying various keys (ISFk1,ISFk2,etc).

try--> this job on 1 of your own ISAM files.

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

E1. listsel1 - list/select for any Indexed file

Listsel1 is a powerful & convenient job to list/select desired records from any indexed file, without having to specify record size, or locations of indexed keys. Many options are available:

1 - Bypass a number of records before processing begins

2 - Stop counts based on either input file count or output file count.

3 - Record selection specified by: field displacement, length, content value,& condition (= ! > <). Two selection fields provided.

4 - Read file on any key available (default key #1).

5 - May specify key start & stop values. This is a powerful feature for large indexed files.

6 - End of job prompts for desired action on output file (vi, uvlp12, etc).

7 - Output file left in tmp subdir for later viewing/printing of desired selections.

8 - Output filename (in tmp subdir) is same as input filename, but suffixed with a time-stamp, so you do not lose results of multiple selections, & you can subsequently view/print the most desired selections.

operating instructions


 uvcopy listsel1                   - minimum command line
 ===============                   - will prompt for filename & options

 uvcopy listsel1,filr1=inputfile   - recommend entering filename on command
 ===============================     Note 'filr1=xxx' not 'fili1=xxx'

 uvcopy listsel1,filr1=input,uop=a0b0c0d0g0k0p79m9999999o9999999
 ===============================================================
 See listsel1 tutorial/examples on the next page ------------------>

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

E1. listsel1 - list/select any Indexed file - tutorial/demo #1

Given
  • dat1/custmast indexed file, rcsz=256, 4 keys, 32 records
    01-06=cust#(key1),09-09=Delete flag, 11-35=customer name(key2),
    61-75=city(key3), 78-79=state(key4), 81-120=zip,tel,contact,
    120-256=packed fields (dropped off by outrecsize 79)
Demo#1
  • select records with 'D' in column 9 (displacement 8)
  • enter options on command line to inhibit prompts

 uvcopy listsel1,filr1=dat1/custmast,uop=a8b1,arg1==D   <-- see Notes below
 ====================================================
 uop=a0b0c0d0k1p79s1g0m9999999o9999999 - option defaults
 uop=a0                        - select field#1 displacement (0 rel)
 uop=  b0                      - select field#1 lth >0 prompts for data
 uop=    c0                    - select field#2 displacement (0 rel)
 uop=      d0                  - select field#2 lth >0 prompts for data
 uop=        k1                - key of reference (k1 - k9)
 uop=          p79             - record size for outrecs (dflt 1st 79)
 uop=          p00             - p0 to use input rcsz for output recs
 uop=             s1           - prefix outrecs with orig file seq#
 uop=               g0         - bypass count
 uop=                 m9999999 - input max stop count
 uop=                 o9999999 - output stop count
 User OPtion (uop) defaults  = q1a0b0c0d0k1p79s1g0m9999999o9999999a8b1
  null to accept or re-specify (1 or more) -->
 listsel1:990911:162821: EOF filo1 0 rds, 3 wrts, 231 size; tmp/custmast.162820
 listsel1:990911:162821: EOF filr1 31 rds, 0 wrts, 0 upds, 0 dels, 8224 size; dat1/custmast
 listsel1:990911:162821: DISAM: recs=30,rcsz=256,keys=7; dat1/custmast
 display/edit/print ? enter: vi/cat/more/uvlp12/null --> more <--
 000005: 145264  D MAGRATH SUPPLIES LTD.    1939 KIRSCHNER ROAD      KELOWNA
 000015: 211140  D FORD NEW HOLLAND         BOX 1, 440 ELLIS ROAD    WINTERBURN
 000029: 403887  D MILNER, LARRY            BOX 28 RAU ROAD R.R.8    QUESNEL

3 records (with 'D' in col 8) have been selected from 32 input records.

Options & arguments were entered on command line to avoid prompts

 'uop=a8b1' - indicates displacement 8, length 1
            - still got prompts, could inhibit via option 'q0' (uop=q0a8b1)
 'arg1==D'  - specifies the test condition & value
              the 2nd '=' is the test condition & 'D' is the value
            - repeat demo with changes to inhibit prompts & select not 'D's

 uvcopy listsel1,filr1=dat1/custmast,uop=q0a8b1,arg1=!D
 ======================================================

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

E2. listsel1 - list/select any Indexed file - tutorial/demo #2

Given
  • dat1/custmast indexed file, rcsz=256, 4 keys, 32 records
    01-06=cust#(key1),09-09=Delete flag, 11-35=customer name(key2),
    61-75=city(key3), 78-79=state(key4), 81-120=zip,tel,contact,
    120-256=packed fields (dropped off by outrecsize 79)
Demo#2
  • Read the custmast indexed file by key#3 (city-name),
    starting with 'VANCOUVER'

 uvcopy listsel1,filr1=dat1/custmast,uop=k3o5,arg3=VANCOUVER <-see Notes below
 ===========================================================
 uop=a0b0c0d0k1p79s1g0m9999999o9999999 - option defaults
 uop=a0                        - select field#1 displacement (0 rel)
 uop=  b0                      - select field#1 lth >0 prompts for data
 uop=    c0                    - select field#2 displacement (0 rel)
 uop=      d0                  - select field#2 lth >0 prompts for data
 uop=        k1                - key of reference (k1 - k9)
 uop=          p79             - record size for outrecs (dflt 1st 79)
 uop=          p00             - p0 to use input rcsz for output recs
 uop=             s1           - prefix outrecs with orig file seq#
 uop=               g0         - bypass count
 uop=                 m9999999 - input max stop count
 uop=                 o9999999 - output stop count
 User OPtion (uop) defaults  = q1a0b0c0d0k1p79s1g0m9999999o9999999k3o5
  null to accept or re-specify (1 or more) -->
 listsel1:990911:162659: EOF filo1 0 rds, 5 wrts, 388 size; tmp/custmast.162656
 listsel1:990911:162659: EOF filr1 5 rds, 0 wrts, 0 upds, 0 dels, 8224 size; dat1/custmast
 listsel1:990911:162659: DISAM: recs=30,rcsz=256,keys=7; dat1/custmast
 display/edit/print ? enter: vi/cat/more/uvlp12/null --> more <--
 000001: 139923    JOHNSTONE BOILER & TANKS 1250 EAST PENDER STREET  VANCOUVER
 000002: 149304    POINT GREY GOLF & COUNTRY3350 S.W. MARINE DRIVE   VANCOUVER
 000003: 154688    TAURUS RESOURCES         1110 - 625 HOWE STREET   VANCOUVER
 000004: 401210    COAST RANGE CONSTRUCTION 1103-207 W. HASTINGS ST  VANCOUVER
 000005: 208060    E&L TRUCKING             LAND & CATTLE LTD        WARBURG

'uop=k3__' - specifies reading by indexed key #3 (city-name) 'uop=__o5' - specifies output 5 records max

 'arg3=VANCOUVER' - specifies starting key as 'VANCOUVER'
                  - would select 7 records to EOF (if option 'o5' not spcfd)
 'arg3=VAN:WIN'  - could specify ending key via ':' separator

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

F1. listselA - script to execute listsel1, making options easier to specify

Given
  • same problem as on previous page, using 'listsel1' to list custmast
    records with 'D' in byte 8, but using the 'listselA' script, which
    makes it easier to specify the options.

listsel1 command (vs listselA below)


 uvcopy listsel1,filr1=dat1/custmast,uop=a8b1,arg1==D
 ====================================================

listselA command (vs listsel1 above)


 listselA dat1/custmast a8b1 =D       <-- Note simplified command line
 ==============================
 uop=a0b0c0d0k1p79s1g0m9999999o9999999 - option defaults
 uop=a0                        - select field#1 displacement (0 rel)
 uop=  b0                      - select field#1 lth >0 prompts for data
 uop=    c0                    - select field#2 displacement (0 rel)
 uop=      d0                  - select field#2 lth >0 prompts for data
 uop=        k1                - key of reference (k1 - k9)
 uop=          p79             - record size for outrecs (dflt 1st 79)
 uop=          p00             - p0 to use input rcsz for output recs
 uop=             s1           - prefix outrecs with orig file seq#
 uop=               g0         - bypass count
 uop=                 m9999999 - input max stop count
 uop=                 o9999999 - output stop count
 User OPtion (uop) defaults  = q1a0b0c0d0k1p79s1g0m9999999o9999999a8b1
  null to accept or re-specify (1 or more) -->
 listsel1:990911:163045: EOF filo1 0 rds, 3 wrts, 231 size; tmp/custmast.163045
 listsel1:990911:163045: EOF filr1 31 rds, 0 wrts, 0 upds, 0 dels, 8224 size; dat1/custmast
 listsel1:990911:163045: DISAM: recs=30,rcsz=256,keys=7; dat1/custmast
 display/edit/print ? (enter: vi/cat/more/uvlp12/null)
 000005: 145264  D MAGRATH SUPPLIES LTD.    1939 KIRSCHNER ROAD      KELOWNA
 000015: 211140  D FORD NEW HOLLAND         BOX 1, 440 ELLIS ROAD    WINTERBURN
 000029: 403887  D MILNER, LARRY            BOX 28 RAU ROAD R.R.8    QUESNEL

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

G1. listsel2 - list/select for Sequential files

Listsel2 is a powerful & convenient job to list/select desired records from any sequential file (vs listsel1 for Indexed files). Many options are available:

1 - Bypass a number of records before processing begins

2 - Stop counts based on either input file count or output file count.

3 - Record selection specified by: field displacement, length, content value,& condition (= ! > <). Two selection fields provided.

4 - End of job prompts for desired action on output file (vi, uvlp12, etc).

5 - Output file left in tmp subdir for later viewing/printing of desired selections.

6 - Output filename (in tmp subdir) is same as input filename, but suffixed with a time-stamp, so you do not lose results of multiple selections, & you can subsequently view/print the most desired selections.

operating instructions


 uvcopy listsel2                   - minimum command line
 ===============                   - will prompt for filename & options

 uvcopy listsel2,fili1=inputfile   - recommend entering filename on command
 ===============================     Note 'fili1' not 'filr1' (as for indexed)

The record size cannot be determined automatically for sequential files & listsel2 will therefore prompt you for the input record size.

Alternatively you can provide a control file with all your filenames & record-sizes to prevent the prompts for record sizes. To create the control file, see REFORMjobs.doc. See sample /home/uvadm/ctl/ctlfile1.

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

G1. listsel2 - list/select any Indexed file - tutorial/demo

Given
  • dat1/sales2 SEQUENTIAL file (vs prior demo Indexed file)
    01-06=cust#,11-12=slsmn#,14-19=date,21-28=inv#,31-36=prod#,
    39-44=qty,46-52=price,54-62=amount
Required
  • list records for salesman# 21 (cols 11-12, zero relative 10-11)
  Note2 - Extra prompt below to enter record size for sequential file
          if not entered via user option 'r' (for example: uop=r64)
        - record sizes cannot be determined automatically (as for ISAM files)

 uvcopy listsel2,fili1=dat1/custmas1,uop=r64a10b2,arg1=21
 ========================================================
 uop=a0b0c0d0p79s1g0m9999999o9999999 - option defaults
 uop=a0                      - select field#1 displacement (0 rel)
 uop=  b0                    - select field#1 lth >0 prompts for data
 uop=    c0                  - select field#2 displacement (0 rel)
 uop=      d0                - select field#2 lth >0 prompts for data
 uop=        p79             - record size for outrecs (dflt 1st 79)
 uop=        p00             - p0 to use input rcsz for output recs
 uop=           s1           - prefix outrecs with orig file seq#
 uop=             r999       - input rcsz (override vtocIS1 ctl file)
 uop=                 g0         - bypass count
 uop=                   m9999999 - input max stop count
 uop=                   o9999999 - output stop count
 User OPtion (uop) defaults  = q1a0b0c0d0p79s1g0m9999999o9999999r64a10b2
  null to accept or re-specify (1 or more) -->   <-- accept cmd line dflts
 listsel2:990911:164649: EOF fili1 20 rds, 0 wrts, 1280 size; dat1/sales2
 listsel2:990911:164649: EOF filo1 0 rds, 5 wrts, 355 size; tmp/sales2.164648
 display/edit/print ? enter: vi/cat/more/uvlp12/null --> more <--
 000001: 130140    21 940802 IN111001  HAM001  000020 0000001 000000020
 000002: 130140    21 940802 IN111001  SCR012  000021 0001001 000021021
 000011: 308685    21 990812 IN6605    SAW001  00001p 0000001 00000001p
 000012: 308685    21 990812 IN6605    WID115  00001q 0001001 00001101q
 000013: 308685    21 990812 CR8835    TAB013  00001r 0002001 00002401r

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

G2. listsel2 - list/select any Indexed file - tutorial/demo

Given
  • dat1/sales2 SEQUENTIAL file (vs prior demo Indexed file)
    01-06=cust#,11-12=slsmn#,14-19=date,21-28=inv#,31-36=prod#,
    39-44=qty,46-52=price,54-62=amount
Required
  • list records for salesman# '21', for years > '97'

 uvcopy 'listsel2,fili1=dat1/custmas1,uop=r64a10b2c13d2,arg1=21,arg2=>97'
 ========================================================================
Note
  • the '>' symbol must be '\' escaped, or enclose the entire command
    line in quotes (as was done here)
 uop=a0b0c0d0p79s1g0m9999999o9999999 - option defaults
 uop=a0                      - select field#1 displacement (0 rel)
 uop=  b0                    - select field#1 lth >0 prompts for data
 uop=    c0                  - select field#2 displacement (0 rel)
 uop=      d0                - select field#2 lth >0 prompts for data
 uop=        p79             - record size for outrecs (dflt 1st 79)
 uop=        p00             - p0 to use input rcsz for output recs
 uop=           s1           - prefix outrecs with orig file seq#
 uop=             r999       - input rcsz (override vtocIS1 ctl file)
 uop=                 g0         - bypass count
 uop=                   m9999999 - input max stop count
 uop=                   o9999999 - output stop count
 User OPtion (uop) defaults  = q1a0b0c0d0p79s1g0m9999999o9999999r64a10b2c13d2
  null to accept or re-specify (1 or more) -->   <-- accept cmd line options
 listsel2:990911:170118: EOF fili1 20 rds, 0 wrts, 1280 size; dat1/sales2
 listsel2:990911:170118: EOF filo1 0 rds, 3 wrts, 213 size; tmp/sales2.170117
 display/edit/print ? enter: vi/cat/more/uvlp12/null --> more <--
 000011: 308685    21 990812 IN6605    SAW001  00001p 0000001 00000001p
 000012: 308685    21 990812 IN6605    WID115  00001q 0001001 00001101q
 000013: 308685    21 990812 CR8835    TAB013  00001r 0002001 00002401r
Note
  • compare output results to the previous page
  • we now get only 3 records vs 5, due to 2nd field year > 97

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

X0. Summary of uvcopy jobs documented in this section

Only a few jobs are listed here, but you can list any of these jobs from the uvadm/pf directory, for example:


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

 uvlp pf/util/listsel1    - list any jobs of interest
 =====================
                'X#' <-- indicates listing present on following pages
B1. listrec1 - 'X1' list long text records in 100 byte segments with scale
- any unprintable characters will be translated to periods
B2. listrec2 - list fixed length records in 100 byte segments with scale
- record length must be supplied since no LineFeeds present
C1. listhex1 - list long text records in 100 byte segments with scale
- same as listrec1, but list records in vertical hexadecimal
C2. listhex2 - 'X2' list fixed length records in 100 byte segments with scale
- same as listrec2, but list records in vertical hexadecimal
D1. listISF - converts an ISAM file to a text file for listing or viewing
- will output the 1st 79 bytes of each input record (by default)
- do not need to know ISAM file record size or keys
- may bypass & select specified records, may read by any key
- prompts for output file disposition (cat,vi,lp,uvlp,or null)
E1. listsel1 - list/select records from any Indexed file
- selections on 1 or 2 fields by location & contents
- no need to know record size or indexed key locations.
- Options for bypass count & stop count (input &/or output)
- read file on any key, starting & stopping on key values
- EOF prompt for output file action (vi, cat, more, uvlp).
- output selection file left in tmp subdir with time stamp
F1. listselA - 'X3' UNIX script that executes the 'listsel1' uvcopy job
- listselA makes it easier to specify the many options
  provided by the listsel1 uvcopy job
G1. listsel2 - list/select records from any Sequential file.
- same as above, but without options pertaining to indexed keys
- record sizes cannot be determined automatically for sequential
  but you can provide an indexed file with all filenames
  & record sizes for future convenience.
H1. listselB - UNIX script that executes the 'listsel2' uvcopy job
- listselB makes it easier to specify the many options
  provided by the listsel2 uvcopy job

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

X1. listings of some uvcopy jobs

listrec1 - list text records in 100 byte segments

 # listrec1 - uvcopy Parameter File from UVSI stored in: /home/uvadm/pf/util/
 # listrec1 - list text records in 100 byte segments with scale
 #          - includes option to count & report any specified character
 #            (see listrec2 for fixed lth records, with no linefeeds)
 #
 # record sizes > 100 will be output in 100 byte sets
 # - with a blank line at the end of the record size
 # records prefixed with rec# & recsize in 9 bytes ex '0001:0256'
 #
 #ex1: uvcopy listrec1,fili1=dat1/custmas1,filo1=tmp/custmas1.lst
 #     ==========================================================
 #
 #ex2 - will illustrate user option to count spcfd char (uop=c?)
 #      & run options 'b' bypass records & 'c' to copy(print) spcfd records
 #    - run options specified on command line using 'rop=b999c999'
 #
 #ex2: uvcopy listrec1,fili1=data/xxx,filo1=tmp/xxx,uop=c1,rop=b2000c50
 #     =================================================================
 #                                                  ^^^^^^  ^^^^^^^^^^^^
 opr='$jobname - list text records in 100 byte segments with scale'
 opr='uop=c0l100m20s1t0 - option defaults'
 opr='    c1   - count & report number of specified chars/record'
 opr='         - will solicit the character to be counted below'
 opr='      l100        - List size defaults to 1st 100 only'
 opr='          m20     - list 20 records Max & end job'
 opr='          m99     - probably would not want to list high numbers'
 opr='                  - "rop=c99" same (Run OPtion vs User OPtion)'
 opr='                  - "rop=b99" could be used to Bypass records'
 opr='             s1   - space 1 (no space between records)'
 opr='             s2   - space 2 (leave 1 blank line between records)'
 opr='               t1 - Translate from EBCDIC to ASCII'
 uop=q1c0l100m20s1t0    # option defaults
 rop=r1  #run option to prompt at EOJ for report disposition (vi,cat,more,etc)
 was=a9000
 fili1=?infile,typ=LSTl8,rcs=9000
 filo1=?tmp/xxx,typ=LSTtl8,rcs=128
 # setup report header
 lodv1=h0(200)
 $jobname - list text records (100 bytes/line) file=$fili1 $datetime count=?
 rec#:rcsz (10's scale will be stored here)
           (units scale will be stored here)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

 @run
        opn    fili1
 #
 # if option c, solicit the character to be counted
        cmn    $uopbc,1              count spcfd char/record ?
        skp<   man06
        msgwna1 'enter character to be counted/reported per record'
        mvc    c0(1),$arg1           store char to be counted
 #
 # if outfile name default xxx, replace with infile basename (in tmp dir)
 man06  mvc    f1(80),$fili1
        scnr   f0(80),'/'            scan from right for '/'
        mvc    f100(80),fx1          select base filename
        cat    f100(80),'.lst'       concat extension
        repf   $filo1,'xxx',f100(40)
        opn    filo1
 # at begining, create title & report scale (allow 5 digit rec# + blank)
 # move scales into report header lod'd into area h above
        mvc    h210(100),$tscale     scale 10,20,30,etc
        mvc    h410(100),$uscale     scale 1234567890,etc
        rtsv3  h0(200),h0(200),'?',c0(1)  insert count char & expand $vars
        wtbe   filo1,h0(200),h0(200)  dump report header to outfile
 #

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

 # begin loop to get records & output in 100 byte segments
 man20  get    fili1,a0(5000)        get max 5000 bytes text rec
        skp>   eof
        mvn    $rr,$rz               actual size stored in rgstr z by get
        trt    a0($rr5000),$trtchr   translate non-print chars to periods
        add    $ca1,1                count records for rec# on left
 # create record prefix in 1st 10 bytes 'rec#:dsp/size'
        mvn    b0(4),$ca1            insert rec#
        mvc    b4(1),':'             separator
 #
 # begin loop to output 100 byte segments until end of rcsz
 # - insert current segment dsplcmnt in bytes 5-8 (0,100,200,etc)
        mvn    $rp,0                 clear output ctl rgstr
 man24  mvc    b10(100),ap0          move current 100 byte segment to outarea
        mvn    b5(4),$rp             insert current segment dsplcmnt
        putb   filo1,b0              output current segment & blank after
        add    $rp,100               up to next segment
        cmn    $rp,$rr               reached end of record ?
        skp=>  man30
        skp    man24
 #
 # end record - insert record-size in bytes 5-8 of extra line between recs
 # if option c, count & report number of specified characters/record
 man30  mvn    b5(4),$rr             insert record size
        cmn    $uopbc,1              option c ?
        skp<   man34
        mvc    b10(7),'"?"=999'
        rep    b10(7),'"',x'27'      replace double quotes with single
        mvc    b11(1),c0             insert char to be counted
        cnt    a0(5000),c0(1)        count specified character
        mvn    b14(3),$ci1           insert count
 man34  put    filo1,b0              write rec-size & possible char count
        put    filo1,' '             write blank line between records
        cmn    $ca1,$uopbm           reached Max records ?
        skp=>  eof
        skp    man20
 #
 eof    cls    all
        eoj
 #Note: option 'rop=r1' causes prompt for file display/view/print

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

X2. listings of some uvcopy jobs

listhex2 - list fixlth records in Vertical Hex

 # listhex2 - uvcopy Parameter File from UVSI stored in: /home/uvadm/pf/util/
 # listhex2 - list fixed lth records in Vertical HEXadecimal 100 byte segments
 #          - VHEX 3 line groups: characters, hex-zones, hex-digits,
 #          - for fixed length records, with no linefeeds, max 8000
 #
 #ex: uvcopy listhex2,fili1=data/xxx,filo1=tmp/xxx,uop=r256l100m20s2t1
 #    ================================================================
 # - 256 byte Records, List 1st 100 bytes, Max 20 recs, Space 2, Trnslt to ASCII
 #
 #NOTE - run options 'b' Bypass records & 'c' to Copy(print) specified number
 #     - must be specified on the command line using 'rop=b999c999'
 #
 #ex: uvcopy listhex2,fili1=data/xxx,filo1=tmp/xxx,uop=r256,rop=b2000c50
 #    ==================================================================
 #                                                          ^^^^^^^^^^^^
 # - also see listrec1 for var lth text files LF terminated
 # - also see listhex1 for var lth text files in vertical hex
 # - also see listhex2 for fixed lth recs no LFs in vertical hexadecimal
 #
 opr='$jobname - list fixlth records in Vertical Hexadecimal 100 byte segments'
 opr='uop=q1r256l100m20s1t0 - option defaults'
 opr='      r256            - recsize default 256 (max 8000, add 1 if Indexed)'
 opr='          l100        - List size defaults to 1st 100 only'
 opr='              m20     - list 20 records Max (default) & end job'
 opr='              m99     - probably would not want to list high numbers'
 opr='                 s1   - space 1 (no space between records)'
 opr='                 s2   - space 2 (leave 1 blank line between records)'
 opr='                   t1 - Translate char-line from EBCDIC to ASCII'
 opr='uop=q0r950l100m50s2t1 Ex: Recsize 950, List 100, Max 50, Space 2, Translate'
 opr='uop=q0r256l100m20s1t0 <-- defaults'
 uop=q1r256l100m20s1t0    # option defaults
 rop=r1  #run option to prompt at EOJ for report disposition (vi,cat,more,etc)
 was=a8192b8192c8192d8192
 fili1=?infile,typ=RSF,rcs=8192
 filo1=?tmp/xxx,typ=LSTt,rcs=128
 #
 # setup report header
 lodv1=h0(200)
 $jobname - list Vertical Hexadecimal file=XXX $datetime
       ----- 10's scale stored here  -----
 seq#  ----- units scale stored here -----
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

 @run
        opn    fili1                   open input file
 # if outfile name default xxx, replace with infile basename (in tmp dir)
        mvc    f1(80),$fili1
        scnr   f0(80),'/'              scan from right for '/'
        mvc    f100(80),fx1            select base filename
        cat    f100(80),'.hex'         concat extension
        repf   $filo1,'xxx',f100(40)
        opn    filo1
 # at begining, create title with filename & report scale
 # move scales into report header lod'd into area h above
        mvn    $rl,$uopbl              store List size option in rgstr 'l'
        mvc    h206($rl100),$tscale+1  scale 10,20,30,etc
        mvc    h406($rl100),$uscale+1  scale 1234567890,etc
        repf1  h0(128),'XXX',$fili1    insert filename into header 1
        wtbe   filo1,h0(200),h0(200)   dump report header to outfile
 #
 # begin loop to get records & output in 100 byte segments
 man20  mvn    $rr,$uopbr              store option rcsz in rgstr 'r'
        get    fili1,a0($rr8000)       rcsz request in rgstr 'r'
        skp>   eof
 # request size in rgstr 'r', actual read in rgstr 'z' (may be diff at EOF)
        mvn    $rr,$rz                 actual size may be less at EOF
 # convert to vertical hexadecimal: chars, zones, digits in areas b,c,d
 # - if option translate EBCDIC to ASCII, use option 'a1' on vhx
        vhx    b0($rz8000),c0,d0,a0($rz8000)
        tsb    o20(1),x'01'            translate EBCDIC to ASCII ?
        skp!   1
        vhxa1  b0($rz8000),c0,d0,a0($rz8000)
 # insert seq# to print in 1st 5 bytes of 1st segment only
        add    $ca1,1                  count records
        mvn    p0(5),$ca1              insert sequence#
        mvn    $ra,0                   init record segment register
 # begin loop to output 100 byte segments until end of rcsz
 # - calc print size remaining = (list_size - bytes_printed)
 man24  mvn    $rp,$rl                 list-size
        sub    $rp,$ra                 bytes printed = bytes remaining
        mvc    p6($rp100),ba0          insert current char segment
        putb   filo1,p0                output char line current segment
        mvc    p6($rp100),ca0          insert current zones segment
        putb   filo1,p0                output zones line current segment
        mvc    p6($rp100),da0          insert current digits segment
        putb   filo1,p0                output digits line current segment
        add    $ra,100                 up to next segment
        cmn    $ra,$rl                 reached end of List size ?
        skp<   man24
        cmn    $ca1,$uopbm             reached Max records ?
        skp=>  eof
        cmn    $uopbs,2                space 2 ?
        skp<   man20
        put    filo1,' '               write blank line between records
        skp    man20
 #
 eof    cls    all
        eoj
 #Note: option 'rop=r1' causes prompt for file display/view/print

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

X3. listings of some uvcopy jobs (script)

 ## listselA - list/select from any Indexed file with options to
 ##          - calls uvcopy job 'listsel1' (for Indexed files)
 ## - select records on 1 or 2 fields <=> specified values
 ## - set starting key to specified value
 ## - bypass specified no of records
 ## - may limit input or output to spcfd number of records
 ## - output report will be tmp/filename:yymmdd:HHMMSS
 ## - prompt for report disposition (vi, more, cat, uvlp12, etc)
 ##
 ##usage: listselA filename options seldel1 seldel2 setkey
 ##       ================================================
 ##
 ##ex1: listselA dat1/custmast a8b1 =D
 ##     ==============================
 ##     - select recs with 'D' in byte 8
 ##
 ##ex2: listselA dat1/custmast a60b16o10 =VANCOUVER
 ##     ===========================================
 ##     - select recs with 'VANCOUVER' in bytes 60-75 output 10 max
 ##
 ##ex3: listselA dat1/custmast k3 - - VANCOUVER
 ##     =======================================
 ##     - same as above, but read by key#3 (city field) (much faster)
 ##
 ##usage: listselA filename options select1 select2 setkey
 ##       ================================================
 ## arguments         $1       $2       $3      $4     $5
 ##    $1  - filename
 ##    $2  - options (see above, string together, no spaces)
 ##    $3  - select field 1, prefix =equal >greaterthan <lessthan !not=
 ##    $4  - select field 2, same condition codes as above
 ##    $5  - set start key value begin:end  (:end optional)
 ## options
 ##    a   - displacement to 1st select field (zero relative)
 ##    b   - length of 1st select field
 ##    c   - displacement to 2nd select field (zero relative)
 ##    d   - length of 2nd select field
 ##    g   - bypass record count (dflt 0)
 ##    i   - input record stop count (dflt 9999999)
 ##    o   - output record stop count (dflt 9999999)
 ##    p79 - record size for output file (default 79, use p0 for entire rec)
 ##    s1  - sequence# output records (dflt s1=yes, s0=no)
 ##    k1  - set key of reference (default key1)
 #------------------------- end of help screen --------------------------
 # lines above with '##' in cols 1-2 are displayed as the help screen
 # setup default path & determine filename
 dir=/hat/prod/data
 if [[ "$1" = */* ]]; then file=$1; else file=$dir/$1; fi
 # if arg1 not spcfd (or not valid file) - display the help screen
 listselApath=$(whence listselA)
 if [[ ! -f $file ]]; then grep ^## $listselApath | more; exit 9; fi
 #
 uvcopy listsel1,filr1=$file,uop="$2",arg1u="$3",arg2u="$4",arg3u="$5"
 #====================================================================
 exit 0

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

Visitor Counters for ThisYear and LastYear