This tool is a port of the ods5 copr utility to
Windows, tested on Windows 7. While on Linux it gets the record attributes from the Linux ods5 file
system, here on Windows 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.3w
usage: copr.exe -a - | ATTRFILE [OPTION]... FILE
Copy records from an OpenVMS/ODS-5 file according to its RMS structure,
determined by attributes, which are read from an attribute file
- : stdin contains assignments ...
attrfile : file contains assignments ...
... for attributes org, rfm, rat, lrl, bks and fsz, if applicable
org keywords: seq, rel, idx
rfm keywords: fix, var, vfc, stm, stmlf, stmcr, udf
rat keywords: none, ftn, cr, prn, blk, msb (multiple assignments
possible)
lrl, bks, fsz values: 0..32767
example: org=seq rfm=var rat=cr lrl=28
OPTIONS
-i insert '\n' after each record
(useful for rfm=var and rat=none)
-l prefix each record with a two byte length
(useful for org=idx with variable length records - after
decompressing - and binary data, possibly having '\n' as data)
-n do not insert '\n' after each record
(useful for rfm=fix and rat=cr)
-p include/prefix the fixed control field (rfm=vfc, only)
-r raw mode, preserve internal structure, but remove gaps
from record word alignment and rat=blk
(useful for org=seq rfm=var and binary data, possibly having '\n'
as data)
-vL verbose, level L=1...
Limitations in current version
- only popular RMS formats implemented
- -l only implemented for index sequential files
- -p only implemented for sequential files
- -r only implemented for sequential files
C:\users\bcc\copr>
C:\users\bcc\copr>echo org=idx rfm=var rat=cr lrl=0 |copr -a- isam.txt
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 -a- isam.txt >x.lis
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 -a- -v1 isam.txt >x.lis
copr.exe, version 0.9.3w
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.3w
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>