This tool is a port of the ods5 copr utility to
W2K. While on Linux it gets the record attributes from the Linux ods5 file
system, here on W2K you have to supply the attributes via options. So you need to know or guess the RMS file attributes. The tool can handle most of the RMS formats, including ISAM.
C:\users\bcc\copr>dir isam.txt
Volume in drive C has no label.
Volume Serial Number is 9417-0D93
Directory of C:\users\bcc\copr
11/17/2006 10:15p 5,120 isam.txt
1 File(s) 5,120 bytes
0 Dir(s) 12,009,664,512 bytes free
C:\users\bcc\copr>
C:\users\bcc\copr>copr
copr.exe, version 0.9.1
usage: copr.exe [OPTIONS] ODS2_file
copr.exe -o [optfile] file
OPTIONS
-i insert '\n' after each record
(for example, useful for rfm=var and rat=none)
-n do not insert '\n' after each record
(useful for fixed length records)
-p include/prefix the fixed control field (rfm=vfc, only)
-r keep record structure, but remove gaps
from record word alignment and nospan (rat=blk)
-v verbose
optfile contains assignments for org, rfm, rat, lrl, bks and fsz
if applicable
if omitted options are read from stdin
org keywords: seq, rel, idx
rfm keywords: fix, var, vfc, stm, stmlf, stmcr, udf
rat keywords: ftn, cr, prn, blk, msb (multiple options possible)
lrl, bks, fsz values: 0..32767
the options assign attributes for the input file
Limitations in current version
- only most popular RMS formats implemented
- only stdin as options file implemented
- -r only implemented for sequential files
- -p only implemented for sequential files
C:\users\bcc\copr>
C:\users\bcc\copr>echo org=idx rfm=var rat=cr lrl=0 |copr -o isam.txt
-o, only stdin implemented
four the forth record
one the first record
ten the last record
three the third record
two the second record
C:\users\bcc\copr>
C:\users\bcc\copr>echo org=idx rfm=var rat=cr lrl=0 |copr -o isam.txt >x.lis
-o, only stdin implemented
C:\users\bcc\copr>type x.lis
four the forth record
one the first record
ten the last record
three the third record
two the second record
C:\users\bcc\copr>
C:\users\bcc\copr>echo org=idx rfm=var rat=cr lrl=0 |copr -o -v1 isam.txt >x.lis
-o, only stdin implemented
copr.exe, version 0.9.1
org=idx rfm=var rat=cr lrl=32767
5 records copied
C:\users\bcc\copr>
C:\users\bcc\copr>echo org=idx rfm=var rat=cr lrl=0 |copr -o -v2 isam.txt >x.lis
-o, only stdin implemented
copr.exe, version 0.9.1
org=idx rfm=var rat=cr lrl=32767
prolog: dbktsiz=1,flags=0,avbn=2,amax=2,dvbn=0,mrn=0,eof=0,ver_no=3,gbc=0,colvbn=0
key #0: idxfl=0,noff=0x0,ianum=1,lanum=1,danum=0,rootlev=1,idxbktsz=1,datbktsz=1,rootvbn=10,flags=(),datatype=string,segments=1,nullchar=0,keysz=6,keyref=0,minrecsz=6,idxfill=512,datfill=512,position=(0),size=(6),keynam='',ldvbn=3,type=(string)
area #0: flags=0x00,areaid=0,arbktsz=1,volume=0,aln=0x00,aop=0x20,avail=0,cvbn=1,cnblk=9,used=3,nxtvbn=4,nxt=0,nxblk=0,deq=3,loc=0,rfi=0x000000000000,total_alloc=9,check=0x0000
area #1: flags=0x00,areaid=1,arbktsz=1,volume=0,aln=0x00,aop=0x20,avail=0,cvbn=10,cnblk=9,used=1,nxtvbn=11,nxt=0,nxblk=0,deq=3,loc=0,rfi=0x000000000000,total_alloc=9,check=0x0000
vbn #3: checkchar=0x00,indexno=0,adrsample=0x0003,freespace=0x00b3,nxtrecid=6,nxtbkt=3,level=0,bktcb=(lastbkt=1,rootbkt=0,ptr_sz=0)
dr ctrl=(ptr_sz=2,del=0,rrv=0),rid=1,rrv=0x000000030001,rl=22
dr ctrl=(ptr_sz=2,del=0,rrv=0),rid=2,rrv=0x000000030002,rl=22
dr ctrl=(ptr_sz=2,del=0,rrv=0),rid=3,rrv=0x000000030003,rl=21
dr ctrl=(ptr_sz=2,del=0,rrv=0),rid=4,rrv=0x000000030004,rl=22
dr ctrl=(ptr_sz=2,del=0,rrv=0),rid=5,rrv=0x000000030005,rl=23
5 records copied
C:\users\bcc\copr>