Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #2019
| From | "Willie Moore" <williem@wmconsulting.com> |
|---|---|
| Newsgroups | comp.lang.clipper.visual-objects |
| Subject | Re: Converting database from COBOL database to DBF |
| Date | 2011-09-15 07:21 -0500 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <j4sqko$fsn$1@speranza.aioe.org> (permalink) |
| References | <64df97be-986e-4db2-839f-18d979bbd89b@t9g2000yqi.googlegroups.com> <4e6eec73$0$30705$5fc3050@news.tiscali.nl> <6a6fa873-b973-4d2b-bade-d879628225df@n12g2000yqh.googlegroups.com> <Zilcq.2461$7r4.1396@viwinnwfe02.internal.bigpond.com> |
Steven,
That is exactly how I did it when I had to move some data from COBOL to
DBFs. If I remember correctly, the numbers wee not stored in ascii and I had
to do a conversion but it has probably been 25 years since I have had to
touch cobol.
Regards,
Willie
"Stephen Quinn" wrote in message
news:Zilcq.2461$7r4.1396@viwinnwfe02.internal.bigpond.com...
Zeljko
>>
EFT, FIN and KEY extensions
<<
IIRC one will be the database, one will be the index and the other will hold
the database definitions (aka field sizes/types etc..).
I have no idea which is which though as I never got into COBOL - then again
I might be thinking of another database altogether (failing memory<g>).
You might search google groups (the CLIPPER forum) going back to circa 1990+
for posts regarding conversions that have been done in the past and the
tools used.
>>
Problem is that fixed length rows are with no delimiters between
columns/fields, so every import resulting in putting every row in just
one field
<<
Then you need to parse each line into the relevant fields.
Eg // sample code
ptr := FOpen( 'xyz', FREAD_ONLY )
j := 1
FOR i := 1 UPTO 20
x := FRead( ptr, j, 55)
oServer:Fieldput( F1, substr(x, 1, 20) )
oServer:Fieldput( F2 := substr(x, 21, 30 ) )
oServer:Fieldput( F3 := substr(x, 31, 40 ) )
oServer:Fieldput( F4 := substr(x, 41, 50 ) )
oServer:Fieldput( F5 := val( substr(x, 51, 55) ) )
j += 55
NEXT
FClose( ptr )
You find the size of the data by trial and error or by examining the cobol
file with a hexeditor.
CYA
Steve
Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Find similar | Unroll thread
Converting database from COBOL database to DBF Zeljko <astinter@gmail.com> - 2011-09-12 06:20 -0700
Re: Converting database from COBOL database to DBF dlzc <dlzc1@cox.net> - 2011-09-12 21:09 -0700
Re: Converting database from COBOL database to DBF Zeljko <astinter@gmail.com> - 2011-09-15 03:08 -0700
Re: Converting database from COBOL database to DBF John Martens <adsl672100@tiscali.nl> - 2011-09-13 07:39 +0200
Re: Converting database from COBOL database to DBF Zeljko <astinter@gmail.com> - 2011-09-15 03:18 -0700
Re: Converting database from COBOL database to DBF "Stephen Quinn" <stevejqNO@bigpondSPAM.net.au> - 2011-09-15 21:23 +1000
Re: Converting database from COBOL database to DBF "Willie Moore" <williem@wmconsulting.com> - 2011-09-15 07:21 -0500
csiph-web